On 12/23/2015 09:55 AM, Eli Zaretskii wrote: >> Cc: eggert@cs.ucla.edu, aurelien.aptel+emacs@gmail.com, >> p.stephani2@gmail.com, tzz@lifelogs.com, emacs-devel@gnu.org >> From: Daniel Colascione >> Date: Wed, 23 Dec 2015 09:41:20 -0800 >> >>> We could try calling shut_down_emacs from the signal handler, but I'm >>> not sure if the small alternate stack will be enough for write-region. >>> Something to investigate, I guess. >> >> We can make the alternate signal stack as large as we want. > > Not as large as is safe to run arbitrary Lisp. Then don't run arbitrary lisp after we've segfaulted. > >>>> The next time Emacs starts, we can restore the buffers we've saved >>>> this way and ask users to save them --- just like autosave, but done >>>> on-demand, at crash time, in C code, on the alternate signal stack. >>> >>> Why "like autosave"? What will be different from actually >>> auto-saving? shut_down_emacs does that automatically. >>> >> >> Er, yes, I noticed that after I wrote the email that we already do what >> I propose, more or less. In this case, we don't lose very much by just >> deleting the stack overflow code and relying on autosave. > > Auto-save will only save buffers that visit files. > A minimal, C-only autosave run in the signal-handling path could save all buffer content.