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

Fix handling ThreadAbortException at the end of catch #89781

Merged
merged 6 commits into from
Aug 3, 2023

Conversation

janvorli
Copy link
Member

@janvorli janvorli commented Aug 1, 2023

After the catch handler for ThreadAbortException exits, the
exception needs to be rethrown immediately. This was not
implemented on Unix and this change makes that work on
Unix amd64, arm64 and arm.

Close #72703

After the catch handler for ThreadAbortException exits, the
exception needs to be rethrown immediatelly. This change
makes that work.
@janvorli janvorli added this to the 8.0.0 milestone Aug 1, 2023
@janvorli janvorli requested a review from jkotas August 1, 2023 14:00
@janvorli janvorli self-assigned this Aug 1, 2023
@janvorli
Copy link
Member Author

janvorli commented Aug 1, 2023

This change was tested with a slightly modified. sample from an original #12739 on Linux amd64, macOS arm64. Linux Arm testing is in progress, I am stuck with some VS Code issues.

@jkotas
Copy link
Member

jkotas commented Aug 1, 2023

Can we add a ControlledExecution test that exercises this path?

@janvorli
Copy link
Member Author

janvorli commented Aug 1, 2023

@jkotas we actually have a test like that, it just contains workaround for Unix. I just needed to remove that workaround.

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
@janvorli
Copy link
Member Author

janvorli commented Aug 1, 2023

Hmm, it seems that macOS x64 is failing in the test executing the new code path. I need to investigate it.

The non-local label was preventing unwinding through \stub\()_RspAligned
@janvorli
Copy link
Member Author

janvorli commented Aug 2, 2023

I've found the macOS x64 issue - the non-local \stub\()_RspAligned label was preventing correct unwinding through the RedirectForThrowControl.

@janvorli janvorli closed this Aug 3, 2023
@janvorli janvorli reopened this Aug 3, 2023
@janvorli janvorli merged commit b2e18f8 into dotnet:main Aug 3, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Thread Abort second pass redirection on Unix
3 participants