Crash diagnostics: thread dump at the unhandled exception; XCL_TRACE_ALLOC commit tracer #161
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/164"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by Sr-0w on 2026-11-23T18:04:11Z.
Summary
Two diagnostics that found the retail title issues fixed in #162 and #163:
eh.rs). The retail title's Breakpad keeps the process alive after the crash, so the dump at process exit came late or never. Now the other threads are dumped once, right afterreport::write_final; that showed which thread the game's watchdog was waiting for.XCL_TRACE_ALLOC=1(newalloc_trace.rs): detoursntdll!NtAllocateVirtualMemoryand counts every commit ≥XCL_TRACE_ALLOC_MINbytes (default 1 MiB) under its call stack. Every 15 s it logs the total, the bytes per owning module (first frame outside ntdll / CRT / kernel32 / d3d12), and the top 8 stacks. The detour runs inside heap allocations with the heap lock held, so it takes no lock and allocates nothing (a fixed 4096-slot table of atomics). A first version with aMutexdeadlocked the game. It is off by default and installs nothing then.On the retail title before #162 it put 20+ GB of commit on
amdxc64.dllpipeline compiles.Test plan
cargo build --releaseXCL_TRACE_ALLOC=1: reports every 15 s, no deadlock, game unaffectedthread dump (104 threads)logged right after the unhandled exception🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Sr-0w on 2026-11-23T19:19:42Z.
New commit
ce0cb0a: the D3D12 debug-layer relay logged only the first 200 messages, warnings included. The error just before GTA VI's device removal came after hundreds of early warnings and was never logged. Now: the first 200 warnings, and the first 20 errors of each message id.🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by einfachama on 2026-11-24T11:46:04Z.
Test report for the commit tracer in #164 at my retail title's first menu, on NVIDIA Ada with 8 GB.
What I tested:
99db9be(thread dump +XCL_TRACE_ALLOC) merged ontomain64b3f35. The PR's second commitce0cb0aconflicts withmaininreal.rs, andmainalready has its own per-id debug-layer cap there, so I keptmain's side and did not testce0cb0a. Local merge commitc5dc444.Tested
cargo test --workspace -- --test-threads=4: 701 passed, 0 failed, 41 ignored, the same asmain64b3f35. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware. The PR adds no test.scripts/smoke.ps1 -Seconds 60, unattended (XCL_NETWORK=0), the learned window in both runs:XCL_TRACE_ALLOC: 1 607 frames, peak commit 14 447 MB, 0 crashes;XCL_TRACE_ALLOC=1: 1 610 frames, peak commit 14 580 MB, 0 crashes;main64b3f35on the same machine: 1 609 and 1 614 frames, 14 575–14 578 MB.So the detour costs no frames here, and there was no deadlock.
8.81 GB committed in blocks of 1024 KB or more, 42 call stacks; by modulexcl.exe 8.72 GB, nvwgf2umx.dll 0.08 GB, MSTTSEngine_OneCore.dll 0.01 GB. The largest stack is one 4.00 GB block, the size of the coherent window; the next is 2.16 GB in 1 081 blocks.memory:line puts the process's commit at 14 580 MB at the same moment, so ~5.6 GB is not in the trace. That is about the size of local video memory then (6 142 MB: target pages 3 578, sparse pools 896, arenas 465).uma.rsnotes that WDDM charges commit for each video-memory allocation; those charges don't go throughNtAllocateVirtualMemory, so I'd expect the tracer to miss them. If that's right, the world-loading growth in #542 / #646, much of which is target pages and sparse pools, would show up only partly in the trace. I didn't check this past the menu.Not tested
ce0cb0a(see above). World loading: it runs this 32 GB machine out of memory, so I stopped at the menu.AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T15:22:20Z.
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T02:46:02Z.
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.Pull request closed