Skip to content

Crash diagnostics: thread dump at the unhandled exception; XCL_TRACE_ALLOC commit tracer - #164

Open
Sr-0w wants to merge 2 commits into
ivall:mainfrom
Sr-0w:crash-diagnostics
Open

Sr-0w wants to merge 2 commits into
ivall:mainfrom
Sr-0w:crash-diagnostics

Conversation

@Sr-0w

@Sr-0w Sr-0w commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

Two diagnostics that found the GTA VI issues fixed in #162 and #163:

  • Thread dump right at the unhandled exception (eh.rs). GTA VI'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 after report::write_final; that showed which thread the game's watchdog was waiting for.
  • XCL_TRACE_ALLOC=1 (new alloc_trace.rs): detours ntdll!NtAllocateVirtualMemory and counts every commit ≥ XCL_TRACE_ALLOC_MIN bytes (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 a Mutex deadlocked the game. It is off by default and installs nothing then.

On GTA VI before #162 it put 20+ GB of commit on amdxc64.dll pipeline compiles.

Test plan

  • cargo build --release
  • GTA VI with XCL_TRACE_ALLOC=1: reports every 15 s, no deadlock, game unaffected
  • GTA VI crash: thread dump (104 threads) logged right after the unhandled exception

🤖 Generated with Claude Code

https://claude.ai/code/session_01XTYmP6vKUQKatSiA2PC95B

…ALLOC commit tracer

A title crash handler (GTA VI's Breakpad) can keep the process alive for minutes after the
unhandled exception, so the thread dump at exit came late or never: the other threads are
now dumped once, right after the final report.

XCL_TRACE_ALLOC=1 detours ntdll!NtAllocateVirtualMemory and counts every commit of
XCL_TRACE_ALLOC_MIN bytes or more (default 1 MiB) under its call stack; every 15 s the stacks
and modules holding the most are logged. The detour runs inside heap allocations with the heap
lock held, so it takes no lock and allocates nothing (a fixed table of atomics). It showed
GTA VI's 20+ GB coming from amdxc64.dll's pipeline compiles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XTYmP6vKUQKatSiA2PC95B
… the first 200 messages

Hundreds of early warnings used the 200 slots; the error before GTA VI's device removal
(CreateUnorderedAccessView of a resource without unordered access) was never logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XTYmP6vKUQKatSiA2PC95B
@Sr-0w

Sr-0w commented Nov 23, 2026

Copy link
Copy Markdown
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant