bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#39962: 27.0.90; Crash in Emacs 27.0.90


From: Eli Zaretskii
Subject: bug#39962: 27.0.90; Crash in Emacs 27.0.90
Date: Fri, 13 Mar 2020 11:19:41 +0200

> From: Pip Cet <pipcet@gmail.com>
> Date: Fri, 13 Mar 2020 08:39:41 +0000
> Cc: pieter-l@vanoostrum.org, 39962@debbugs.gnu.org, eggert@cs.ucla.edu
> 
> > The default stack size on GNU/Linux is 2MB, right?  Maybe it's high
> > time we raised that, what with the memory size today's machines
> > routinely have at their disposal.
> 
> Well, it's just virtual memory, so raising it shouldn't be a problem,
> though apparently the stack size is limited to 4 GB.

We have a long way to go before we get anywhere near that limit ;-)

> > FWIW, the MS-Windows build have
> > been using a 8MB run-time stack for a very long time.
> 
> "ulimit -s" produces 9788 here.

That's system-wide, but what is the stack size that the Emacs binary
can use?

> > But the question is how
> > many such recursive symbols are there in Pieter's sessions? are they
> > anywhere near the 1000000000 mark you used in your test program?
> 
> If I'm reading the code correctly, the recursion depth is equal to the
> number of messages in VM's list, so a few tens of thousands of symbols
> seem possible. Not anywhere near a billion, though.

Your test code crashes before 100,000, so the question is how many
tens of thousands of messages does Pieter's session have?  If it's
anywhere near 100,000, then we are really close to the limit, but I
suspect it's much lower, which might suggest the recursion in VM is
much deeper.

> It should certainly be possible to warn the user when stack usage
> during GC exceeded a given percentage of the possible stack size;
> hopefully, that would happen at least once before a crash.
> 
> It would also be possible to modify the code in sysdep.c to report
> when it has detected an unrecoverable stack overflow.

How do you do that without consuming more stack?

Btw, we already have stack-overflow protection in Emacs, but it is
disabled during GC.

> Do you happen to know whether anyone is looking at gcc -fsplit-stack
> support for Emacs?

I'm not aware of anyone working on that, no.  But I also am not sure
this is something we should do.  First, it only works on GNU/Linux,
while Pieter is on macOS AFAIU.  And second, if you read the GCC
manual's description of that switch, you will see some serious
caveats, which could mean using that option might produce an
unworkable binary.  IOW, it doesn't sound to me as an option that is
recommended for general-purpose use.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]