Subject: bug#27585: segfault when evaluating a file containing only backticks

From: Daniel Colascione <[email-masked]>
Date: Thu, 06 Jul 2017 08:52:44 -0700

On July 5, 2017 12:47:22 PM PDT, Eli Zaretskii <[email-masked]> wrote:
>> From: Steve Kemp <[email-masked]>
>> Date: Wed, 05 Jul 2017 18:55:31 +0000
>> 
>> > See above: the machinery to try and prevent it exists, but it
>doesn't
>> > always succeed.  And it really can't be 100% reliable.  So I'm
>unsure
>> > what did you expect, and why.
>> 
>>   Honestly?  I expect Emacs to not crash.
>
>You wrote a program that triggers infinite recursion.  Such programs
>will crash in most, if not all, languages.  So your expectations are
>unrealistic.
>
>>  I expect evaluating lisp to not kill the editor
>
>Valid Lisp, I agree.  But yours isn't.
>
>Moreover, there are those among us (I'm not one of them) who thinks
>Emacs shouldn't even try to recover from stack overflow, they say it
>should crash hard right there and then.

Native stack? Certainly. The current approach, a signal handler that longjmps to top-level, cannot possibly work reliability, since it interrupts and abandons whatever the code is doing. If it has some kind of lock held and you try to take that lock again, you deadlock. Data structures might be in completely incoherent states. The last time we had this discussion, someone asserted that the worst that could happen might be a "memory leak". That's very wrong.

This signal handler is a huge, ticking time bomb, and I completely turn it off in my Emacs. Everyone else should too.

Recovering when elisp blows the stack is a different matter.

>
>So your expectations are not necessarily shared, even as aspirations,
>by some developers.
>
>> > IOW: why would someone want to run such a silly "program"?
>> 
>>   In the real world?  Nobody.
>
>Then why are we discussing this use case?  Let's talk about
>more practical and interesting cases.