Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSlide Python read_bad_associated_image test crashes on Windows Server 2022 #47

Closed
bgilbert opened this issue Aug 6, 2022 · 2 comments · Fixed by #49
Closed

OpenSlide Python read_bad_associated_image test crashes on Windows Server 2022 #47

bgilbert opened this issue Aug 6, 2022 · 2 comments · Fixed by #49
Labels

Comments

@bgilbert
Copy link
Member

bgilbert commented Aug 6, 2022

The OpenSlide Python test_read_bad_associated_image crashes in CI on 64-bit Windows Server 2022 with:

Windows fatal exception: code 0xc0000028

which is STATUS_BAD_STACK, invalid or unaligned stack during an unwind operation.

This doesn't occur on Windows Server 2019. It occurs with both 20220806 and 20220803-nightly. It also occurs with 20171122, though the error there is less helpfully 0x80000003, a breakpoint exception.

@bgilbert bgilbert added the defect label Aug 6, 2022
@bgilbert
Copy link
Member Author

bgilbert commented Aug 6, 2022

(I assume this is a problem with setjmp/longjmp.)

bgilbert added a commit to bgilbert/openslide that referenced this issue Aug 6, 2022
Both decoders use setjmp/longjmp for error handling, which has
historically had problems on 64-bit Windows with MinGW.

xref openslide/openslide-bin#47

Signed-off-by: Benjamin Gilbert <[email protected]>
bgilbert added a commit to bgilbert/openslide that referenced this issue Aug 6, 2022
Both decoders use setjmp/longjmp for error handling, which has
historically had problems on 64-bit Windows with MinGW.  Let's include
it in our smoke tests.

xref openslide/openslide-bin#47

Signed-off-by: Benjamin Gilbert <[email protected]>
@bgilbert
Copy link
Member Author

bgilbert commented Aug 7, 2022

It appears this is a longstanding problem with MinGW 64-bit builds, which try to pass SEH unwind info to _setjmp() but apparently don't get it quite right. This bug gives a lot of context, and I also found this Postgres thread. Some codebases have opted to work around this using the more limited __builtin_setjmp/__builtin_longjmp GCC intrinsics, but those might bite us later. Instead, we can continue using the real setjmp implementation, but avoid passing unwind info; #49 does this. We don't actually need the unwind info because every stack frame between our setjmp/longjmp pairs is C code written for Unix, so it doesn't expect any unwind cleanup on the way out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant