Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Nov 14, 2025

Backport of #121625 to release/10.0

/cc @janvorli

Customer Impact

  • Customer reported
  • Found internally

The issue causes an exception thrown within a non-exceptionally called finally to not to be handled by a proper catch handler in some cases. It was independently reported by two different customers, the RavenDB being one of them. In the RavenDB case, it was causing a deadlock.

Regression

Testing

The fix was verified using a customer provided minimal repro app. This app was added as a regression test to the coreclr tests suite. The issue was missed because none of our coreclr and libraries tests exercise that specific case.

Risk

Low, it just fixes a part of the condition that was always true and replaces it by a proper check for collided unwind.

janvorli and others added 3 commits November 14, 2025 13:19
A recent fix that has moved 2nd pass of the exception handling to native code has accidentally broken detectin of collided unwind, that means detection of when exception escapes a catch or exceptionally called finally funclets. Unfortunately none of our coreclr and libraries test exercise the specific case when the problem occurs, which is as follows: * There is a try / catch inside of an outer catch * The try block contains try / finally and the non-exceptionally called finally throws. In this case, the stack walk out of the throwing finally funclet was incorrectly classifed as an exception collision and the catch was skipped. The problem was that the last part of the condition to detect the collided unwind was wrong. In fact, it was always true, so any unwind out of a funclet was considered to be a collision even if the funclet was a finally that was called non-exceptionally. This change fixes it by identifying the collision by the fact that the stack walker has moved from a funclet to native code, which is the only case when the exception is really escaping an exceptionally called funclet. I have also added a regression test for the issue. Close #121578
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ExceptionHandling-coreclr Servicing-consider Issue for next servicing release review

3 participants