-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 unwound stack range check for the new EH #99041
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With the old EH, the unwound stack range limits are using SP for each frame on x64 and a caller SP on arm64, arm, riscv64 and longsoon. The ExceptionTracker::IsInStackRegionUnwoundBySpecifiedException takes that into consideration when detecting whether a frame with a specific SP was already unwound or not. With the new EH though, the range is always based on the actual SP of the frame, so the check was being done incorrectly on non-x64 architectures. That lead to a crash in a test that has dynamic method code on stack and its frame was unwound. The bug has caused that method to not to be reported to GC, so the dynamic method was destroyed by GC. And later on, another GC stack walk has crashed while trying to get info on the method. This change fixes it by making the check with new EH enabled the same for all architectures, the same as it was for x64 in the old EH. Close dotnet#98914
/azp run runtime-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-coreclr crossgen2 |
Azure Pipelines successfully started running 1 pipeline(s). |
/backport to release/9.0-preview2 |
Started backporting to release/9.0-preview2: https://github.com/dotnet/runtime/actions/runs/8081325683 |
4 tasks
The CI failures are known - the #98817 |
jkotas
approved these changes
Feb 28, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the old EH, the unwound stack range limits are using SP for each frame on x64 and a caller SP on arm64, arm, riscv64 and longsoon. The
ExceptionTracker::IsInStackRegionUnwoundBySpecifiedException
takes that into consideration when detecting whether a frame with a specific SP was already unwound or not.With the new EH though, the range is always based on the actual SP of the frame, so the check was being done incorrectly on non-x64 architectures.
That lead to a crash in a test that has dynamic method code on stack and its frame was unwound. The bug has caused that method to not to be reported to GC, so the dynamic method was destroyed by GC. And later on, another GC stack walk has crashed while trying to get info on the method.
This change fixes it by making the check with new EH enabled the same for all architectures, the same as it was for x64 in the old EH.
Close #98914