Skip to content

[release/10.0] [RuntimeAsync] A few fixes for issues found when enabling rt async in Libraries. - #119960

Merged
agocke merged 5 commits into
release/10.0from
backport/pr-119864-to-release/10.0
Sep 22, 2025
Merged

[release/10.0] [RuntimeAsync] A few fixes for issues found when enabling rt async in Libraries.#119960
agocke merged 5 commits into
release/10.0from
backport/pr-119864-to-release/10.0

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

Backport of #119864 to release/10.0

/cc @VSadov

Customer Impact

  • Customer reported

  • Found internally

  • In async methods the GS cookie check, if also present, could end up using (and corrupting) the same register as used to return continuation.

  • Synthetic async thunks that provide interop between ordinary task-returning methods and runtime async methods, did not special-case ValueTask, which is sufficiently different to require slightly different IL.

  • When multiple awaits are in the same try block, the async analysis could pay attention only to the first one and skip over others.

These bugs require fairly trivial fixes, but otherwise could result in crashes in affected scenarios.

Regression

  • Yes
  • No

This is new code/scenarios with runtime async.

Testing

The fix was verified on existing libraries tests that caught the issues.

Risk

Low, most changes are to the new code that is only enabled with runtime async.

@VSadovVSadov added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI area-VM-coreclr runtime-async labels Sep 22, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@VSadov

Copy link
Copy Markdown
Member

@AndyAyersMS - could you take a look at this backport PR?

@JulieLeeMSFTJulieLeeMSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Fixing crash.

@JulieLeeMSFTJulieLeeMSFT added this to the 10.0.0 milestone Sep 22, 2025
Comment threadsrc/coreclr/vm/asyncthunks.cpp
Comment threadsrc/coreclr/vm/asyncthunks.cpp
@kg

kg commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

I don't see anything fatal, so seems fine.

@AndyAyersMSAndyAyersMS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JIT changes LGTM.

@JulieLeeMSFT

Copy link
Copy Markdown
Member

Adding @davidwrighton for VM review.

@JulieLeeMSFTJulieLeeMSFT added the Servicing-approved Approved for servicing release label Sep 22, 2025
@agocke
agocke enabled auto-merge (squash) September 22, 2025 22:04
@agocke
agocke disabled auto-merge September 22, 2025 22:04
@agocke
agocke merged commit a83ae91 into release/10.0Sep 22, 2025
108 of 117 checks passed
@agocke
agocke deleted the backport/pr-119864-to-release/10.0 branch September 22, 2025 22:05
@VSadov

Copy link
Copy Markdown
Member

Thanks!!!

@davidwrightondavidwrighton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actionsgithub-actionsBot locked and limited conversation to collaborators Oct 23, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIarea-VM-coreclrruntime-asyncServicing-approvedApproved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@VSadov@kg@JulieLeeMSFT@AndyAyersMS@davidwrighton@agocke