-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix several issues with interpreter and EH #119784
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
Conversation
This change fixes few issues I have found while investigating coreclr tests failures when running interpreted * The GC info for reverse pinvoke stubs didn't have the revPInvokeOffset set * When SfiNext reached native marker state, it was doing one more unwind to get to the frame function state. That is benign for non-interpreter scenarios, as it doesn't change the regdisplay, but it is useless due to that. But for interpreter, it can actually incorrectly move to interpreted code. The fix is to not to do that unwind and just return. * The StackFrameIterator::SkipTo that is called when SfiNext collides with the previous EH was missing copying of the first argument register that can hold the InterpreterFrame pointer. * When SfiNext moved out of the last interpreted code frame and the caller of the interpreted code was not managed code (e.g. the CallDescrWorker), the StackFrameIterator's regdisplay was not updated to that context.
There was a problem hiding this 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 several issues with interpreter and exception handling (EH) in the CoreCLR runtime to address test failures when running interpreted code.
Key changes:
- Fixed GC info for reverse pinvoke stubs by setting the
revPInvokeOffset - Corrected stack frame iterator behavior when reaching native marker states
- Added proper register copying for interpreter frame pointers during stack unwinding
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/coreclr/vm/stackwalk.cpp | Added first argument register copying for interpreter frame addresses and logging for debugging |
| src/coreclr/vm/exceptionhandling.cpp | Fixed stack frame iterator logic for native markers and interpreter frame unwinding |
| src/coreclr/interpreter/compiler.cpp | Added reverse pinvoke frame slot configuration for unmanaged callers only methods |
|
Tagging subscribers to this area: @BrzVlad, @janvorli, @kg |
|
Adding NO-MERGE until the #119863 gets in. We will need to backport the other to .NET 10 and this would make the backport more complicated. |
This change fixes few issues I have found while investigating coreclr tests failures when running interpreted
revPInvokeOffsetsetSfiNextreached native marker state, it was doing one more unwind to get to the frame function state. That is benign for non-interpreter scenarios, as it doesn't change the regdisplay, but it is useless due to that. But for interpreter, it can actually incorrectly move to interpreted code. The fix is to not to do that unwind and just return.StackFrameIterator::SkipTothat is called whenSfiNextcollides with the previous EH was missing copying of the first argument register that can hold theInterpreterFramepointer.SfiNextmoved out of the last interpreted code frame and the caller of the interpreted code was not managed code (e.g. theCallDescrWorker), theStackFrameIterator's regdisplay was not updated to that context.