Repository navigation
xcl run: thread dumps name XCL's own functions from xcl.pdb - #1811
JRamos1993 wants to merge 2 commits into
Conversation
…tack A thread dump line showed the top 14 frames of each thread. A title thread deep in XCL, the driver or DXC (a compute pipeline it builds in a bind, a compile it waits for) had all 14 of them there, so its line named no title frame and read like one of XCL's own threads. In dumps of a retail title's world-load stall, the title threads building pipelines in their binds looked like that, and reading them as XCL's own threads led to a wrong conclusion. The dump now unwinds up to 96 frames. When none of the top 14 is in the title's code but a deeper one is, the line adds how many frames were left out and the title's first 4 frames from there. Other lines are unchanged. (Such a thread's first title frame was 34 and 47 frames deep.)
A thread dump gave XCL's frames as xcl.exe+offset, and whoever read it looked each one up by hand with the same build's PDB. Now a dump line adds the function's name to XCL's frames, e.g. "xcl.exe+0x276a43 (title_textures::refresh)", from the PDB next to the executable (release builds keep xcl.pdb there). dbghelp is loaded from System32 at the first dump, so a run that makes no dump is unchanged. It gets a session of its own (a made-up process handle), so a title that uses dbghelp itself is not disturbed, and every call holds one lock (dbghelp is single-threaded). Names lose their generic arguments and keep their last two path segments. Without a PDB, or with XCL_DUMP_SYMBOLS=0, lines are as before.
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Linux (Wine) test of Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch. RTX 4070 12 GB (driver 615.71.09), Ryzen 9 9950X3D. Release, cross-compiled to Tested
Read
Not tested: the lookup itself under Wine (dbghelp was never loaded); this commit without #1734; an MSVC build with its AI use: Claude Code (Claude Fable 5.2) read the diff, built the trees, ran the tests and the two runs and wrote this report. Posted without review by a person: the account owner was away and reads replies later. |
The same lookup, already hereI wrote the same thing before I saw this PR, and this is the better home for it. My duplicate was a separate The part it does not cover: the crash report
If the session this PR opens were reachable from Two things I would keep in mind for that:
Happy to open that as a small stacked PR on your branch ( Written by Claude (Anthropic) under my review; numbers from runs on my machine, no game data included. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Stacked on #1734. This PR's commit is the last one,
c7c600f; the one before it is #1734's.A thread dump gives XCL's frames as
xcl.exe+offset, and whoever reads one looks each up by hand with the same build's PDB. Several reports in #846 and #505 did that, and so did I. Now a dump line adds the function's name to XCL's frames, from the PDB next to the executable:xcl.exe+0x276a43 (title_textures::refresh). The offset stays.What is in it
crates/xcl/src/eh.rs:own_symbols: on the first dump, it loads System32'sdbghelp.dll, opens a session of its own and loads only XCL's module and its PDB.short_namedrops generic arguments and keeps the last two path segments.describe_frame:module+offset, plus(name)for XCL's own frames.dump_threadsuses it.XCL_DUMP_SYMBOLS=0. A run that makes no dump never loads dbghelp.a_symbol_name_drops_generic_arguments_and_keeps_two_segmentsa_dump_frame_of_xcl_names_its_function: looks up a test function's own address through the test executable's PDB. It prints SKIPPED without a PDB.Tested
x86_64-pc-windows-msvc; tests in debug, runs in release.cargo test --workspace -- --test-threads=4onc7c600f, aftercargo build --workspace: 862 passed, 0 failed, 42 ignored.gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).XCL_NETWORK=0 XCL_PRESS_AT=25:A XCL_THREAD_DUMP_AT=88,96.Regression run (60 s, no input, both built with
x86_64-pc-windows-msvc)main:
PR:
Not tested
AI use