On Mon, 2 Aug 2021, Jeremy Drake via Mingw-w64-public wrote:

Ruby was running into a crash calling longjmp on a jmp_buf obtained by
calling setjmp from a function that had previously called alloca.  This
was resulting in mingw_getsp returning the *current* SP rather than the
"frame address"/"base pointer" for the frame.  This caused longjmp to
raise STATUS_BAD_STACK from RtlUnwindEx.

https://github.com/msys2/MINGW-packages/issues/9271

Signed-off-by: Jeremy Drake <[email protected]>
---
mingw-w64-headers/crt/setjmp.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

LGTM, thanks, pushed it.

Yes, mingw_getsp() is only a rough estimate of the right value. It's odd though how it seems to kinda work in many cases even though it isn't exactly right, I wonder in which cases the windows unwind implementation cares about the exact vs approximate value of it...

// Martin



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to