Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[clr-interp] Tweak GC reporting - #122620

#122620
Merged
davidwrighton merged 5 commits into
dotnet:maindotnet/runtime:mainfrom
davidwrighton:tweak_gc_reportingdavidwrighton/runtime:tweak_gc_reportingCopy head branch name to clipboard
Jan 5, 2026
Merged

[clr-interp] Tweak GC reporting#122620
davidwrighton merged 5 commits into
dotnet:maindotnet/runtime:mainfrom
davidwrighton:tweak_gc_reportingdavidwrighton/runtime:tweak_gc_reportingCopy head branch name to clipboard

Conversation

@davidwrighton

Copy link
Copy Markdown
Member

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.

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.
Copilot AI review requested due to automatic review settings December 17, 2025 21:28
@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Dec 17, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 Collect0 test 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

Comment thread src/coreclr/vm/gcinfodecoder.cpp Outdated
Comment thread src/coreclr/vm/gcinfodecoder.cpp Outdated
Comment thread src/coreclr/vm/gcinfodecoder.cpp
@jkotas jkotas added area-CodeGen-Interpreter-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Dec 17, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @BrzVlad, @janvorli, @kg
See info in area-owners.md if you want to be subscribed.

Comment thread src/coreclr/vm/gcinfodecoder.cpp Outdated
@davidwrighton
davidwrighton merged commit 6b4ee34 into dotnet:main Jan 5, 2026
104 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 5, 2026
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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.