Skip to content

[clr-interp] Fix interpreter safepoint to just do a GC transition and not call the managed JIT_GCPoll helper#120302

Merged
davidwrighton merged 1 commit intodotnet:mainfrom
davidwrighton:fix_interpreter_safepoint
Oct 1, 2025
Merged

[clr-interp] Fix interpreter safepoint to just do a GC transition and not call the managed JIT_GCPoll helper#120302
davidwrighton merged 1 commit intodotnet:mainfrom
davidwrighton:fix_interpreter_safepoint

Conversation

@davidwrighton
Copy link
Member

The managed helper includes the GC poll within it, since JIT_GCPoll is itself managed, when we are in a pure interpreted environment, we will go into infinite recursion triggering the INTOP_SAFEPOINT code

Copilot AI review requested due to automatic review settings October 1, 2025 18:31
Copy link
Contributor

Copilot AI left a 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 an infinite recursion issue in the CoreCLR interpreter's safepoint implementation. The problem occurs when using a pure interpreted environment where calling the managed JIT_GCPoll helper from INTOP_SAFEPOINT creates recursion since JIT_GCPoll itself is managed code.

Key changes:

  • Replaces the managed JIT_GCPoll() call with a direct GC transition using GCX_PREEMP()
  • Adds explanatory comment about the purpose of the GC transition

@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 Oct 1, 2025
@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 Oct 1, 2025
@dotnet-policy-service
Copy link
Contributor

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

@davidwrighton davidwrighton merged commit 42bbba9 into dotnet:main Oct 1, 2025
101 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2025
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