-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Handled SEH exceptions cause test failures #2286
Comments
+1. In particular, this breaks MSVC AddressSanitizer-enabled builds, because, apparently, ASAN uses SEH for its internal shenanigans:
If Catch needs to handle SEH, it should wrap its |
Thankfully, the workaround of disabling SEH in Catch2, as suggested on #898, saves the situation here.
|
This avoids issues with Catch2's handler firing too early, on structured exceptions that would be handled later. This issue meant that the old attempts at structured exception handling were incompatible with Windows's ASan, because it throws continuable `C0000005` exception, which it then handles. With the new handling, Catch2 is only notified if nothing else, including the debugger, has handled the exception. Signed-off-by: Alan Jowett <alanjo@microsoft.com> Closes catchorg#2332 Closes catchorg#2286 Closes catchorg#898
Describe the bug
Throwing an SEH exception causes the current test to fail, even if the exception is caught within the body of the current test
Expected behavior
Tests should not fail for SEH exceptions which don't escape the body of the function.
Reproduction steps
Platform information:
Additional context
Problem occurs because Catch2 registers an exception handler via
AddVectoredExceptionHandler()
, however vectored exception handlers are executed before walking the frame based exception handlers. I would think that Catch2 should be using frame based handlers to ensure that any tested code has a chance to handle the exception itself first (although I don't know how practical that is with the existing code)The text was updated successfully, but these errors were encountered: