Skip to content

[release/11.0] Fix GC hole caused by adrp and add instructions on arm64 - #136945

Open
github-actions[bot] wants to merge 2 commits into
release/11.0from
backport/pr-136412-to-release/11.0
Open

github-actions[bot] wants to merge 2 commits into
release/11.0from
backport/pr-136412-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #136412 to release/11.0

/cc @VSadov @copilot

Customer Impact

  • Customer reported
  • Found internally

Fount in internal stress testing

Regression

  • Yes
  • No

The issue is more general, but the scenario where it was found involves runtime async.
It can affect code that used to not have GC holes before net11.

Testing

The GC stress infrastructure will be supporting R2R code when #135794 merges.
Once that is enabled the hole is detectable via regular GC stress runs. (that is how it was found)

Risk

Low.
The fix follows an already-established pattern used for TLS-GD relaxation

- Fixes #136411

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: VSadov <8218165+VSadov@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@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 Nov 3, 2026
@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.

ins = INS_adrp;
fmt = IF_DI_1E;
dst = emitOutputShortAddress(dst, ins, fmt, relPageAddr, addrReg);
emitGCregDeadUpd(addrReg, dst);

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.

It looks odd to me to do this update here, inside emitOutputLJ, but the other update in the caller. Should both be done in the caller or both inside emitOutputLJ?

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.

Agreed. Moved the LARGEADR update into emitOutputLoadLabel next to the adrp, so both updates live where the adrp is emitted

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@VSadov VSadov added the Servicing-consider Issue for next servicing release review label Nov 5, 2026
@VSadov
VSadov requested a balanced review from Copilot November 5, 2026 20:43
@VSadov VSadov added this to the 11.0.0 milestone Nov 5, 2026
@VSadov
VSadov requested a review from jakobbotsch November 5, 2026 20:44

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.

🔵 Needs a closer look

Static inspection supports the ARM64 GC-liveness fix, but its intra-instruction-descriptor boundary changes still need maintainer-confirmed release/11.0 ARM64/R2R GC-stress validation that source-only review could not provide.

No open issues 🎉

What changed in this PR

Backports #136412 to release/11.0 to fix an ARM64 garbage-collection liveness gap in CoreCLR’s JIT emitter, exposed by ReadyToRun GC stress testing.

Changes:

  • Marks the destination register as no longer holding a GC reference immediately after adrp in both affected emission paths.
  • Adds a comment explaining the timing for the adrp/add sequence.

Builds and tests were not run.

File Description
src/​coreclr/​jit/​emitarm64.cpp Updates register GC liveness after adrp in emitOutputLoadLabel and emitOutputLJ.

Review effort: Balanced

@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!

This branch has not been deployed

No deployments
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-consider Issue for next servicing release review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants