James Vega wrote:
> As one of my users discovered[0], if Vim is killed and autocmds are run
> as part of the shutdown, Vim will crash instead of closing gracefully.
> =46rom what I can tell, it looks like Vim is exceeding the stack since the
> shutdown process (and autocmds) are being run in the context of the
> alternate signal stack and that stack is likely only 8k.
>
> This can readily be reproduced using the attached crash.vim.
>
> $ vim -u crash.vim --noplugin -N
> $ kill $pidOfVim
> Vim: Caught deadly signal TERM
> Vim: Finished.
> Vim: Double signal, exiting
>
> If it is indeed a problem with exceeding the stack, then two possible
> solutions seem evident to me.
>
> 1) Change the signal handler to simply set a flag that Vim needs to
> exit, return from the signal handler, have another portion of the
> code that checks for that flag (RealWaitForChar ?), and initiate the
> shutdown steps from there.
>
> 2) Ignore autocommands if Vim is exiting due to a deadly signal. Just
> do the minimum necessary steps to gracefully exit -- i.e., flush out
> the swapfiles, viminfo, and quit.
>
> The attached patch does 2) but 1) seems like a more robust (although
> potentially more invasive) change.
Hmm, tricky.
Going back to the original stack will fail in other situations. Esp.
when something works recursively and we run out of stack space.
Your solution sounds like a reaonable solution. I'll look into it
later.
--
>From "know your smileys":
<<<:-{ Worf (Never smiles anyways, so he's a bad smiley)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php