Subject: Re: bug#33034: `unwind-protect' cleanup form is not executed if body dies in stack overflow

From: Eli Zaretskii <[email-masked]>
Date: Sat, 13 Oct 2018 15:35:34 +0300

> From: Paul Pogonyshev <[email-masked]>
> Date: Sat, 13 Oct 2018 13:38:11 +0200
> Cc: [email-masked]
> 
> OK, but why does it hit the limit? Logically, by the time cleanup form
> is called, all the (overflow) stack frames should be removed and the
> cleanup form should see practically empty stack. It shouldn't be much
> different from calling cleanup without overflowing the stack to begin
> with.

I don't think your expectation, that the stack should be unwound
before the cleanup runs, is correct.  The implementation calls the
cleanup forms before it jumps to top-level, and I see nothing in the
documentation to promise anything different.