Repository navigation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on xcl-dev#1734. This PR's commit is the last one,
c7c600f; the one before it is xcl-dev#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 xcl-dev#846 and xcl-dev#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
Mirror of xcl-dev#1811 (auto-synced, do not edit).