Skip to content

Allow composability of unhandled exception filters on Windows#3033

Merged
horenmar merged 1 commit intocatchorg:develfrom
dunhor:except
Sep 27, 2025
Merged

Allow composability of unhandled exception filters on Windows#3033
horenmar merged 1 commit intocatchorg:develfrom
dunhor:except

Conversation

@dunhor
Copy link
Contributor

@dunhor dunhor commented Sep 26, 2025

Situation

Currently, I'm doing some long overdue investigations of some test reliability. The unfortunate thing is that failures almost exclusively come from CI builds. Some of these failures are crashes. In such cases, it would be very beneficial to get a stacktrace printed out in the output, however this is proving tricky because Catch2 is calling SetUnhandledExceptionFilter and overriding the handler I'm trying to install.

The Change

The change is very simple. If a handler previously existed, Catch2 will invoke it after printing out its output. I've also updated the comment to better reflect that it's returning EXCEPTION_CONTINUE_SEARCH even in scenarios where the exception is one that the library cares about.

@dunhor dunhor changed the title Allow composability of unhandled exception filters Allow composability of unhandled exception filters on Windows Sep 26, 2025
@codecov
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.75%. Comparing base (3bcd0a4) to head (2ee8f39).
⚠️ Report is 1 commits behind head on devel.

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3033      +/-   ##
==========================================
- Coverage   90.77%   90.75%   -0.02%     
==========================================
  Files         201      201              
  Lines        8707     8709       +2     
==========================================
  Hits         7903     7903              
- Misses        804      806       +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@horenmar
Copy link
Member

Thanks.

It was always supposed to do that, but back when we used VectoredExceptionHandler (?) we would only need to return EXCEPTION_CONTINUE_SEARCH. However, VEH was causing issues with Windows impl of ASan, so we moved to SetUnhandledExceptionFilter, but didn't modify the logic accordingly.

@horenmar horenmar merged commit 0e772cc into catchorg:devel Sep 27, 2025
83 of 84 checks passed
@dunhor dunhor deleted the except branch September 28, 2025 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants