Skip to content

Assert failure: !CREATE_CHECK_STRING(pMT && pMT->Validate()) in _coreclr_GitHub_135463_test135463::Runtime_135463.TestEntryPoint() #137606

Description

@VincentBu

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1681617
Build error leg or test failing: _coreclr_GitHub_135463_test135463::Runtime_135463.TestEntryPoint()

Console Log: console log
Source: runtime-coreclr gcstress-extra/coreclr windows arm64 Checked gcstress0xc_disabler2r @ Windows.11.Arm64.Open/Regressions.0.1.WorkItemExecution

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": ["_coreclr_GitHub_135463_test135463::Runtime_135463.TestEntryPoint()", "!CREATE_CHECK_STRING(pMT && pMT->Validate())"],
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1681617
Error message validated: [_coreclr_GitHub_135463_test135463::Runtime_135463.TestEntryPoint() !CREATE_CHECK_STRING(pMT && pMT->Validate())]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 11/16/2026 1:30:22 AM UTC

Report

💡 View the full list in 🌐 Build Insights

Build Repository Branch Test Pull Request
1693956 dotnet/runtime main OutOfProcessTest.Regressions/coreclr/GitHub_135530/test135530/test135530.cmd
1681617 dotnet/runtime main Regressions.0.1.WorkItemExecution

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 2

Activity

  1. added
    blocking-clean-ci-optional
    Known Build Error
    on Nov 16, 2026
  2. added
    untriaged
    on Nov 16, 2026
  3. added and removed
    area-Infrastructure-coreclr
    on Nov 19, 2026
  4. dotnet-policy-service commented on Nov 19, 2026

    @dotnet-policy-service
    Contributor

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

  5. jkotas commented on Nov 19, 2026

    @jkotas
    Member

    FYI @pcshrosbree The test added in #135463 is failing in GC stress

  6. pcshrosbree commented on Nov 19, 2026

    @pcshrosbree
    Contributor

    Thanks, I'll take a look.

  7. pcshrosbree commented on Nov 20, 2026

    @pcshrosbree
    Contributor

    Quick status: I've reproduced this on Windows arm64 with this leg's settings, much more often when the whole Regressions work item runs than with the test alone. It still happens with #135638 reverted. In the crash dumps, the GC reads a saved register value that points at zeroed memory, and in one failure under an instrumented runtime, that value was the object's address from before the previous GC moved it. I'm still investigating and will follow up when I have a complete answer. I can share the details and dumps now if you're interested.

  8. pcshrosbree commented on Nov 21, 2026

    @pcshrosbree
    Contributor

    TL;DR: The crash dumps point to how the runtime handles a thread abort on Windows. A GC moves an object while a separate unwinder context still holds the object's old address. A frame is later filled from that stale context, and the next GC asserts. It reproduces on Windows x64 and on arm64, including arm64 runs with #135638 reverted or at the commit just before #137168.

    Following up on my earlier note. The dumps identify a stale-context transfer in the runtime's Windows APC-abort / exception-handling path. A GC moves an object while a separate unwinder context still holds its old address, and the SoftwareExceptionFrame is later filled from that context. Nothing I found implicates the JIT's GC info for ControlledExecution.Run.

    Where it reproduces, with this leg's settings (GCStress=0xC, ReadyToRun=0, TieredCompilation=0) and the whole Regressions work item:

    Platform Runtime Runs #137606 asserts
    Windows arm64 main 278 1
    Windows arm64 main, #135638 reverted 225 4
    Windows arm64 main + diagnostic logging 636 6
    Windows arm64 main + diagnostic logging, #135638 reverted 590 1
    Windows arm64 main just before #137168 (24ed9ae) 514 1
    Windows arm64 main at #137168 (82716fe) 515 2
    Windows x64 main 205 2
    Windows x64 main + diagnostic logging 890 1
    macOS arm64 main 2,575 0
    Linux x64 main 2,967 0
    Linux arm64 main 690 0

    All runs are Checked builds. Where the row does not name another commit, they are main at 8fef9c3. The last column counts only this assert; other failures are not counted. Reverting #135638 does not eliminate the failure. Across the Windows arm64 main and diagnostic rows, 7 of 914 runs hit it without the revert and 5 of 815 with it. Those rows mix stock and diagnostic runs, so these are counts, not comparable rates. The same assert occurs at the commit just before #137168. This sequence uses the Windows OS-unwind path; this assert was not observed in the listed macOS and Linux runs.

    Upstream's weekend gcstress0x3 run also hit this assert on Windows arm64, in GitHub_135530 (another ControlledExecution.Run abort test), in build 1681324 on 2026-11-14; its log shows only the top frames.

    The sequence comes from six Windows dumps. The x64 dump taken with the diagnostic logging shows every step. The other five show parts of it: two x64 dumps taken with the unmodified runtime, and three arm64 dumps taken with the diagnostic logging.

    1. The abort is handled inside a suspension APC. HandleSuspensionForInterruptedThread pushes a RedirectedThreadFrame over the APC's saved CONTEXT.
    2. HandleThreadAbort reaches RaiseException through RaiseTheExceptionInternalOnly. The OS unwind gives the second-pass handler a separate unwinder context that holds the register's value from before the move.
    3. A compacting GC moves the CancellationTokenSource+CallbackNode that ControlledExecution.Run keeps in a callee-saved register (x21 on arm64, rdi on x64). The GC updates the RedirectedThreadFrame's context, but the unwinder's context keeps the old address.
    4. In the second pass, after the RedirectedThreadFrame has been popped, ProcessCLRException fills the SoftwareExceptionFrame with SetContext(pContextRecord) (exceptionhandling.cpp#L551-L553). Three of the dumps place pContextRecord in RtlUnwindEx's frame, so the SoftwareExceptionFrame gets the old address.
    5. The next GC reports that register from the SoftwareExceptionFrame, finds invalid memory (zeros, in the four full dumps where that memory was read), and asserts. In two of the three arm64 dumps, the stale value propagated further, and the assert came from a FaultingExceptionFrame instead.

    In the arm64 dump where the integer and control registers of the two contexts were compared, the unwinder's CONTEXT and the APC CONTEXT agree in X1–X20, X22–X28, FP, LR, SP and PC; X0, X21 and ContextFlags differ. The instrumented x64 dump records four events in order:

    • the unwinder's context holding the old value;
    • a GC that moves the object and updates the RedirectedThreadFrame's context, but not the unwinder's;
    • the fill from the unwinder's context;
    • the GC that asserts.

    In one arm64 run, 13 GCs ran between the move and the fill. In the x64 run, no additional GC ran between the move and the fill. In all four dumps taken with the diagnostic logging, the GC that moved the object ran on a different thread from the aborting one. As one control observation, an earlier abort in the same x64 run went through the same frames with no GC between receiving the unwinder's context and filling the SoftwareExceptionFrame, and did not fail.

    The sequence shows why the SoftwareExceptionFrame receives the old address: it is filled from the unwinder's context, while the GC updated the RedirectedThreadFrame's context. I'll leave the choice of fix to you: reporting the unwinder's copy to the GC, refreshing the value from the redirected context, or avoiding the unwinder's copy when filling the frame.

    I'm now working on a test that forces a GC inside this window, so that the failure reproduces reliably instead of only occasionally. I'll post it here when it's ready. I can also share the dumps, the instrumentation patch and the per-step evidence if you're interested.

  9. added a commit that references this issue on Nov 27, 2026
    dd864af
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Known Build Errorarea-VM-coreclrblocking-clean-ci-optionaluntriaged

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions