You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Assert failure: !CREATE_CHECK_STRING(pMT && pMT->Validate()) in _coreclr_GitHub_135463_test135463::Runtime_135463.TestEntryPoint() #137606
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
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.
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:
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.
The abort is handled inside a suspension APC. HandleSuspensionForInterruptedThread pushes a RedirectedThreadFrame over the APC's saved CONTEXT.
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.
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.
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.
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.
Activity
dotnet-policy-service commentedon Nov 19, 2026
Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.
jkotas commentedon Nov 19, 2026
FYI @pcshrosbree The test added in #135463 is failing in GC stress
pcshrosbree commentedon Nov 19, 2026
Thanks, I'll take a look.
pcshrosbree commentedon Nov 20, 2026
Quick status: I've reproduced this on Windows arm64 with this leg's settings, much more often when the whole
Regressionswork 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.pcshrosbree commentedon Nov 21, 2026
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
SoftwareExceptionFrameis later filled from that context. Nothing I found implicates the JIT's GC info forControlledExecution.Run.Where it reproduces, with this leg's settings (
GCStress=0xC,ReadyToRun=0,TieredCompilation=0) and the wholeRegressionswork item: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
gcstress0x3run also hit this assert on Windows arm64, inGitHub_135530(anotherControlledExecution.Runabort 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.
HandleSuspensionForInterruptedThreadpushes aRedirectedThreadFrameover the APC's savedCONTEXT.HandleThreadAbortreachesRaiseExceptionthroughRaiseTheExceptionInternalOnly. The OS unwind gives the second-pass handler a separate unwinder context that holds the register's value from before the move.CancellationTokenSource+CallbackNodethatControlledExecution.Runkeeps in a callee-saved register (x21 on arm64, rdi on x64). The GC updates theRedirectedThreadFrame's context, but the unwinder's context keeps the old address.RedirectedThreadFramehas been popped,ProcessCLRExceptionfills theSoftwareExceptionFramewithSetContext(pContextRecord)(exceptionhandling.cpp#L551-L553). Three of the dumps placepContextRecordinRtlUnwindEx's frame, so theSoftwareExceptionFramegets the old address.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 aFaultingExceptionFrameinstead.In the arm64 dump where the integer and control registers of the two contexts were compared, the unwinder's
CONTEXTand the APCCONTEXTagree in X1–X20, X22–X28, FP, LR, SP and PC; X0, X21 and ContextFlags differ. The instrumented x64 dump records four events in order:RedirectedThreadFrame's context, but not the unwinder's;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
SoftwareExceptionFramereceives the old address: it is filled from the unwinder's context, while the GC updated theRedirectedThreadFrame'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.
Refresh callee-saved registers in the EH second pass