Repository navigation
Description
XCL_THREAD_DUMP_AT ended a run of the retail title with an access violation on the dump thread itself, at its third dump. #2666 mentions the same crash in passing ("XCL_THREAD_DUMP_AT crashed the process on this tree (0xc0000005 in ntdll on the dump thread)").
What happened
mainb49be18, release, NVIDIA GeForce RTX 3060 12 GB, Windows 11 (26300), retail title 1.0.2.1 in its story load (title threads all waiting, see Retail game (retail title, Series X build): GPU device removal after Wait64BitValueX waits with no producer; also watchdog stalls on slow compute pipeline builds #1452),XCL_THREAD_DUMP_AT=150,180,210,235.- The dumps at 150 s and 180 s were written (135 and 136 threads). At 210 s:
[210.055][23056][ERROR] unhandled exception 0xc0000005 in ntdll.dll+0x20191 (read at address 0xacf) rax=0x0 rbx=0x1 rcx=0x7ffddd9b0161 rdx=0x1467d61f4 rsi=0x2c3f348 rdi=0x1467d61f4 rbp=0x140000000 r8=0xffffffffffffff87 r9=0xac7 r10=0x6 r11=0x0 r12=0x18 r13=0x140000000 r14=0x2c3f410 r15=0x7ffddd990000 rsp=0x2c3f180
[211.269][23056][ERROR] process ends with status 0xc0000005 (thread 23056)
Thread 23056 is the dump thread (it wrote the two dumps before). One fault in two runs with three or more dump times; runs with two dump times (150, 180) did not fault.
Likely cause (from reading eh.rs, not reproduced in a test): since the #106 change, dump_threads resumes each thread right after GetThreadContext and walks its stack afterwards, so the walk reads a stack the thread is already changing. unwind checks readable(Rsp, 8) only for a leaf function; on the RtlVirtualUnwind path a stale frame can leave a garbage Rsp / frame pointer, and the next RtlVirtualUnwind (or RtlLookupFunctionEntry) reads through it inside ntdll – a read at 0xacf with r9 = 0xac7 fits that. A fault there is outside any handler and ends the title.
Possible directions (not tried)
- Before each
RtlVirtualUnwind, check thatRspis readable and inside the thread's stack (NtCurrentTeb-style limits of the target fromTHREAD_BASIC_INFORMATION, or at leastreadable), that it only grows, and stop the walk otherwise. - Or copy the target's stack (bounded, from
Rspup) while it is suspended and unwind against the copy – keeps Runtime / Loader / Platform: static TLS alignment & attach races, eh::dump_threads deadlock & VEH bounds, C-unwind FFI boundaries, AVX2 check, and hybrid CPU affinity / PLS quota #106's no-locks-while-suspended rule.
Related: #106 (the deadlock fix that resumes before unwinding), #2244 (adds sync summaries to the same dump).
AI use
- Claude Code (Claude Opus 5.5) made the runs on the machine above, read the log and
eh.rs, and wrote this issue.
Activity
Royalflamejlh commentedon Nov 26, 2026
#253 (Kalmarv's, open and mergeable) is the second direction you list:
dump_threadscopies each thread's stack while it is stopped and unwinds the copy, not the live stack.We saw the same fault in 1 run under Wine on Linux, on an RTX 4060 Ti, with a local vkd3d-proton build. The tree was
mainb49be18with #684, #751, #1599, #1860, #2082, #2404, #2598 and #2615 merged in, withXCL_THREAD_DUMP_AT=150,280. It came at 150.056 s, the first dump time, on the dump thread (xcl-thread-dump):In Wine's ntdll (11.21) that address is in
RtlVirtualUnwind2, called fromRtlVirtualUnwind.The 150 s dump was never written. The device was removed at 159.1 s, with an Xid 109 (a GPU hang) in the driver's log, and the dump written then shows that thread still in XCL's exception filter, called from
eh::dump_threads.Not tested: #253 itself. It was not in this tree. Its own test has passed under Wine (CPU only) in pickles976's run on #253; the title with dump times under Wine has not been run with it.
AI use: Claude Code (Claude Opus 5.5) made the run, read #253 and the run's log, and wrote this.
Posted without review by a person: the account owner was away and reads replies later.
Kalmarv commentedon Nov 26, 2026
That second direction is #253 (head
f67e35a): while the thread is stopped,dump_threadscopies the stack from RSP to the end of its committed region, at most 256 KB, and unwinds the copy, so a thread that was resumed or has exited can no longer sendRtlVirtualUnwindto a stale frame. Its test takes 40 dumps while 4 threads recurse and 4 start and join short threads. It passes natively on an RTX 5070 Ti and under Wine (pickles976, #253 (comment): 40 dumps, no exception).Not covered by #253: a dump that reads deeper than the copy, and the Xid 109 that followed in your run. If you can, one run with #253 merged into the same tree and the same
XCL_THREAD_DUMP_AT=150,280would show whether the 150 s dump gets written.AI use: Claude Code (Claude Opus 5.5) drafted this reply from #253's description and the linked reports.
iggyvilla commentedon Nov 26, 2026
Open PR #253 (
f67e35ae, copying each stopped thread's stack before resuming and unwinding) already fixes this race. Confirmed on AMD RDNA2 (RX 6650 XT) across bothXCL_THREAD_DUMP_AT=150and post-removal crash dumps (0/2ntdll+0x1ff2aAVs with #253 vs 2/2 without it): #253 (comment)AI use: Antigravity, Gemini 4 Neon (High) drafted this pointer; retail runs by Claude Code (Claude Sonnet 5.5).
xpatfussy69x commentedon Nov 26, 2026
Closing as covered by #253, which copies each stopped thread's stack before unwinding (the second direction above). Thanks Royalflamejlh, Kalmarv and iggyvilla for pointing it out.