Skip to content

Fix interpreter threadabort in finally#123231

Merged
janvorli merged 1 commit intodotnet:mainfrom
janvorli:fix-interpreter-threadabort
Jan 16, 2026
Merged

Fix interpreter threadabort in finally#123231
janvorli merged 1 commit intodotnet:mainfrom
janvorli:fix-interpreter-threadabort

Conversation

@janvorli
Copy link
Member

This fixes the
System.Runtime.Tests.ControlledExecutionTests.CancelItselfFromFinally libraries test that was failing with the interpreter. The issue was that finally block was being aborted due to the fact that instead of the complex COMPlusCheckForAbort, the interpreter was only checking if abort was requested.

This fixes the
System.Runtime.Tests.ControlledExecutionTests.CancelItselfFromFinally
libraries test that was failing with the interpreter.
The issue was that finally block was being aborted due to the fact that
instead of the complex COMPlusCheckForAbort, the interpreter was only checking
if abort was requested.
@janvorli janvorli added this to the 11.0.0 milestone Jan 15, 2026
@janvorli janvorli self-assigned this Jan 15, 2026
Copilot AI review requested due to automatic review settings January 15, 2026 22:39
@janvorli janvorli requested review from BrzVlad and kg as code owners January 15, 2026 22:39
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @BrzVlad, @janvorli, @kg
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes interpreter thread abort handling in finally blocks by replacing a simple IsAbortRequested() check with the more comprehensive COMPlusCheckForAbort() function.

Changes:

  • Replaced Thread::IsAbortRequested() with COMPlusCheckForAbort(resumeIP) in the interpreter's catch exception handler
  • Updated the conditional check from checking thread state to checking the return value of COMPlusCheckForAbort()
  • Removed the now-unused pThread local variable

@janvorli janvorli merged commit 0bb2889 into dotnet:main Jan 16, 2026
109 checks passed
rosebyte pushed a commit that referenced this pull request Jan 19, 2026
This fixes the
System.Runtime.Tests.ControlledExecutionTests.CancelItselfFromFinally
libraries test that was failing with the interpreter. The issue was that
finally block was being aborted due to the fact that instead of the
complex COMPlusCheckForAbort, the interpreter was only checking if abort
was requested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants