Skip to content

[arm64] GC hole: JIT must kill the destination register right after adrp #136411

Closed

Description

@VSadov

Re: #135794 (comment)

Found after enabling GC stress in R2R code.

On arm64, adrp+add (IF_LARGEADR) and adrp+ldr (IF_LARGELDC) are emitted as one emitter instruction (emitOutputLoadLabel/emitOutputLJ). GC liveness of the register written by adrp therefore can't change between the two machine instructions. If it held a live GC ref before the pair, it is still reported as one while it holds a non-GC page address.

In fully interruptible code a thread can be suspended at the second instruction, so this is a real GC hole, not just a GC stress artifact. R2R uses the pair (relocatable address) for the async ResumeInfo address (genAsyncResumeInfo).

Found via GC stress on R2R (#135794, #108249). The arm64 async.0.1 run (MutateImplicitByRef) took a SIGILL at add x0,x0,#0xdd8. x0 was reported as a GC ref holding an image page address, and Object::Validate crashed. This is from a core dump; the GC info was not decoded.

Fix: emit the GC kill for the register right after adrp, like the existing TLS-GD adrp case (emitGCregDeadUpd(REG_R0, dst)).

Activity

  1. added
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Oct 24, 2026
  2. dotnet-policy-service commented on Oct 24, 2026

    @dotnet-policy-service
    Contributor

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

  3. removed
    untriagedNew issue has not been triaged by the area owner
    on Oct 26, 2026
  4. added this to the 12.0.0 milestone on Oct 26, 2026
  5. added a commit that references this issue on Oct 27, 2026
    425a54e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-arm64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions