Skip to content

[release/11.0] JIT: Exclude byref-like structs from async continuation capture - #136166

Merged
JulieLeeMSFT merged 5 commits into
dotnet:release/11.0from
EgorBo:backport-136085-release-11.0
Nov 16, 2026
Merged

JulieLeeMSFT merged 5 commits into
dotnet:release/11.0from
EgorBo:backport-136085-release-11.0

Conversation

@EgorBo

@EgorBo EgorBo commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Fixes Issue #136000

main PR #136085

Description

Backport of #136085 to release/11.0. Exclude byref-like structs from async continuation capture even when they contain no byrefs, as required by the runtime-async specification. The original regression test is placed under the release branch's existing merged runner.

Customer Impact

  • Customer reported
  • Found internally

Applications using runtime-async can suffer GC corruption and fatal crashes when a byref-like local containing object references is captured into a reused continuation without write barriers. Reported with an interpolated string handler used for logging on Linux x64.

Regression

  • Yes
  • No

Affects the new runtime-async implementation in .NET 11. Reproduced on .NET 11 RC1 and RC2.

Testing

Test is backported.

Risk

Low. Extends the existing exclusion of stack-only locals from async continuation capture using the existing layout predicate. No change to non-async methods.

Note

PR description generated with GitHub Copilot.

…et#136085)

Backport to release/11.0. Place the original regression test in the release
branch's existing merged runner and register it in Regression_ro_2.csproj.

(cherry picked from commit 9a88a84)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 362440cb-6282-4636-8d33-5d2e543985c2
@EgorBo EgorBo added this to the 11.0.0 milestone Oct 20, 2026
@EgorBo EgorBo added Servicing-consider Issue for next servicing release review area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labels Oct 20, 2026
@EgorBo
EgorBo temporarily deployed to copilot-pat-pool October 20, 2026 17:56 — with GitHub Actions Inactive
@EgorBo
EgorBo temporarily deployed to copilot-pat-pool October 20, 2026 17:56 — with GitHub Actions Inactive
@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.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 362440cb-6282-4636-8d33-5d2e543985c2
@EgorBo

EgorBo commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

PTAL @jkotas backport of #136085

@jkotas

jkotas commented Oct 21, 2026

Copy link
Copy Markdown
Member

The new test is failing on Apple mobile in this PR and in main as well (#136000)

Backport the interpreter fix from dotnet#136172 (6f6de27). Check for a continuation before clearing byref-like locals so synchronously completed awaits preserve their initialized values.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 37277a04-f6d5-407d-a072-a81cded25839
@EgorBo

EgorBo commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

The new test is failing on Apple mobile in this PR and in main as well (#136000)

Fixed. I just realized that my fix mirrors #136172 (in main).

Comment thread src/coreclr/vm/interpexec.cpp Resolved
…36000

Zeroing of byref-like structs differs between the interpreter and the JIT when the await does not suspend (and is wrong in the JIT), so the test no longer covers Task.CompletedTask.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9fab45db-751c-46af-91fe-dae26f06fe20
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9fab45db-751c-46af-91fe-dae26f06fe20
@ViveliDuCh

Copy link
Copy Markdown
Member

Hi,

the code complete date for 11.0.1 (the December 2026 release) is Monday 16 November. Make sure to merge this PR on that date at the latest, or it won't make it into that release.

As a reminder, if this is a product change, you also need Tactics approval before merging this PR (test-only or infra-only changes don't require Tactics approval).

Happy to help with the merge if needed!

@jakobbotsch

Copy link
Copy Markdown
Member

/azp run runtime

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@jakobbotsch

Copy link
Copy Markdown
Member

/ba-g Failures are #136325 (too many to handle, it seems)

@JulieLeeMSFT JulieLeeMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Nov 16, 2026
@JulieLeeMSFT
JulieLeeMSFT merged commit 0eaf983 into dotnet:release/11.0 Nov 16, 2026
118 of 121 checks passed
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 Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants