[clr-interp] Tweak GC reporting#122620
Merged
davidwrighton merged 5 commits intodotnet:mainfrom Jan 5, 2026
Merged
Conversation
The interpreter calling convention can result in double reporting of arguments passed to callee's. This works today as all of the arguments will be conservatively reported, but it also adds the problem of excess conservative reporting. This change fixes that most of that problem by only dropping reporting of conservative pointers when they point into a callee's stack space. Note that this does not fix is the scenario where an object reference is held on the IL stack across a call. In those cases the value shall still be reported conservatively. This PR also tweaks the Collect0 test to disable it under the interpreter as the C# compiler generates that particular problematic pattern for this test case.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses GC reporting issues in the CoreCLR interpreter by reducing excess conservative reporting of arguments. The main change optimizes GC stack slot reporting by detecting when a stack slot belongs to a callee's frame rather than the caller's frame, avoiding double reporting. Additionally, a test is disabled under the interpreter due to a known issue with object references held on the IL stack across calls.
Key Changes
- Modified GC stack slot reporting to skip conservatively reported slots when they point into a callee's stack space
- Added logic to detect callee frame boundaries using
InterpMethodContextFrame - Disabled
Collect0test under the interpreter due to incompatible C# compiler output patterns
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/tests/GC/API/GC/Collect0.cs | Adds ActiveIssue attribute to disable test under CoreCLR interpreter |
| src/coreclr/vm/gcinfodecoder.cpp | Implements GC reporting optimization for interpreter frames by detecting and skipping slots in callee frames |
Contributor
|
Tagging subscribers to this area: @BrzVlad, @janvorli, @kg |
BrzVlad
reviewed
Dec 18, 2025
This was referenced Dec 19, 2025
Open
BrzVlad
approved these changes
Dec 22, 2025
This was referenced Jan 9, 2026
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.
The interpreter calling convention can result in double reporting of arguments passed to callee's. This works today as all of the arguments will be conservatively reported, but it also adds the problem of excess conservative reporting. This change fixes that most of that problem by only dropping reporting of conservative pointers when they point into a callee's stack space.
Note that this does not fix is the scenario where an object reference is held on the IL stack across a call. In those cases the value shall still be reported conservatively. This PR also tweaks the Collect0 test to disable it under the interpreter as the C# compiler generates that particular problematic pattern for this test case.