[clr-interp] StackMark handling for interpreter#120278
Merged
davidwrighton merged 5 commits intodotnet:mainfrom Oct 1, 2025
Merged
[clr-interp] StackMark handling for interpreter#120278davidwrighton merged 5 commits intodotnet:mainfrom
davidwrighton merged 5 commits intodotnet:mainfrom
Conversation
Member
davidwrighton
commented
Sep 30, 2025
- StackMark handling relies on comparing the stackmark's address to the stack pointer, but the interpreter stack is seperate.
- Fix this by converting the StackMark pointer to a pointer on the OS stack and then do the compares
- StackMark handling relies on comparing the stackmark's address to the stack pointer, but the interpreter stack is seperate. - Fix this by converting the StackMark pointer to a pointer on the OS stack and then do the compares
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes StackMark handling for the interpreter by addressing the issue that StackMark pointer comparisons don't work correctly when the interpreter uses a separate stack from the OS stack.
Key changes:
- Adds a new function to convert StackMark pointers from interpreter stack to OS stack addresses
- Updates StackMark usage patterns in reflection and appdomain code to use converted pointers for stack comparisons
- Maintains backward compatibility by conditionally compiling interpreter-specific logic
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/coreclr/vm/stackwalk.h | Declares new conversion function for StackMark pointers |
| src/coreclr/vm/stackwalk.cpp | Implements logic to convert interpreter stack pointers to OS stack pointers |
| src/coreclr/vm/reflectioninvocation.cpp | Updates SkipStruct to use converted StackMark pointers for frame comparisons |
| src/coreclr/vm/appdomain.cpp | Updates CallersDataWithStackMark to use converted StackMark pointers for frame comparisons |
Contributor
|
Tagging subscribers to this area: @BrzVlad, @janvorli, @kg |
Contributor
|
Tagging subscribers to this area: @mangod9 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
janvorli
reviewed
Oct 1, 2025
Removed unnecessary while loops for traversing interpreter method context frames.
This file contains hidden or 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
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.