Skip to content

Conversation

@jakobbotsch
Copy link
Member

#122195 introduced a runtime async test that is the first one to run in combination with other stress configurations. It revealed that when leave callbacks are emitted we do not appropriately zero the async continuation on standard returns.

Fix #122475

Copilot AI review requested due to automatic review settings December 12, 2025 11:46
@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 12, 2025
@dotnet-policy-service
Copy link
Contributor

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

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 a JIT codegen issue where the async continuation return register was zeroed too early, before the profiler leave callback was invoked. This caused incorrect behavior when async methods with profiler instrumentation returned normally (non-suspending returns).

Key Changes

  • Move the zeroing of REG_ASYNC_CONTINUATION_RET to occur after the profiler leave callback in genReturn
  • Add explicit GC tracking calls (gcMarkRegPtrVal) at the points where the async continuation register state changes
  • Remove the centralized GC marking for the async continuation register from genMarkReturnGCInfo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failure: Interop/COM/RuntimeAsync/RuntimeAsync/RuntimeAsync.cmd

1 participant