Repository navigation
tools: minidump_summary.py attributes the title's own crash dumps to mapped modules - #8575
Davidutz19 wants to merge 2 commits into
Conversation
…mapped modules The title's crash reporter writes a minidump to T:\ under gta6rt (overlay .gta6rt-temp). The dump's ModuleList comes from the host loader and names gta6rt.exe and the host DLLs, not the images gta6rt maps itself, so the fault and guest frames are bare addresses. The tool reads the dump and the startup trace of the same run (its map events) and prints the exception, each thread's instruction pointer and a scan of the faulting thread's saved stack as module+RVA. docs/boot.md says where the dumps land and how to read them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
svds12343
left a comment
There was a problem hiding this comment.
Independent Windows CPU review of 66c7719823306f1e1c1868db0f4667864e00ef50 (parent 867d922f09b86583859796a174df89555fb32da8). Two reproducible correctness issues are attached inline; requesting changes for those. Implementation stays with this PR's owner.
Coordination claim: #8504 (comment)
Environment: Windows 11 25H2 build 26200.9457, CPython 3.12.5, redirected stdout cp1252. CPU only, GPU/driver unused. AI-assisted (OpenAI Codex). Only the PR's hand-written synthetic fixture and invented trace names were used; no game files, real dumps or external services.
Validation:
python -I tests/test_minidump_summary.py -v: 7/7 pass.python -I tests/test_tool_stdout_encoding.py -q: its three executable checks pass; the audit fails with 13 unguarded programs. An audit of the actual parent files finds 12;tools/minidump_summary.pyis the additional one.python -I reports/codex-review-8575/probe.py: all reproduction/control assertions pass. Removing just the MemoryList directory entry while preserving the ThreadList stack descriptor and bytes changes the reported candidate count from 3 to 0. Supplying that descriptor as a memory range restores all 3. ASCII text output, JSON output and a stdout-reconfigure control exit 0; an invented non-ANSI module name in ordinary redirected text mode exits 1 with UnicodeEncodeError.python -I tests/test_ci_registration.py -q: 14 passed;python -I tests/test_docs_repo_paths.py -q: 3 passed;python -I tests/test_docs_table_rows.py -q: 2 passed.python -m compileall -q tools/minidump_summary.py tests/test_minidump_summary.py,python -I tools/minidump_summary.py --help, diff check and the no-game-data scanner pass.
The independent probe is local review code, not a competing implementation. No runtime, translator, GPU or real-dump execution. See inline comments for minimal reproductions and the relevant documented descriptor.
| def summarize(dump: Minidump, mapped: list, trace_pid, all_threads: bool, limit: int) -> dict: | ||
| own = dump.modules() | ||
| symbolize = Symbolizer(own + mapped) | ||
| ranges = dump.memory() |
There was a problem hiding this comment.
[P2] Include the stack range carried by each ThreadList entry
ranges includes only MemoryList/Memory64List entries, while stack_scan() discards the RVA from thread["stack"]. A dump can carry the saved stack through its MINIDUMP_THREAD.Stack descriptor; the bytes need not also be found through this separate list. With this PR's synthetic fixture, remove the MemoryList directory entry but preserve the ThreadList descriptor and saved bytes: the scan silently changes from 3 candidates to 0 and reports that no module address was found. Using [thread["stack"]] as the range restores all 3. Please use the thread's own descriptor (with bounds checks) or include it in the ranges, and add a test without the duplicate MemoryList entry. The current fixture always duplicates the stack there, hiding this path.
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| sys.exit(main()) |
There was a problem hiding this comment.
[P2] Apply the repository's stdout encoding guard
The new entry point lacks sys.stdout.reconfigure(errors="replace"). On Windows/Python 3.12 with redirected stdout (cp1252 here), a valid trace map event whose invented module name contains U+E9C3 makes python -I -X utf8=0 tools/minidump_summary.py <synthetic.dmp> --trace <synthetic.trace> exit 1 with UnicodeEncodeError while printing the mapped-module line. ASCII names, --json (which escapes the name), and a launcher applying the normal stdout guard all exit 0. The existing test_tool_stdout_encoding.py audit newly flags this file: 13 missing guards at this head versus 12 on its actual parent. Please add the same guarded reconfigure used by the other CLI tools and a subprocess regression with redirected stdout; the current StringIO-based text test cannot expose the encoding failure.
|
Tested
No game files. AI-assisted (Claude). |
|
Tested
AI-assisted (Claude Code). |
|
Tested 66c7719 on Windows 11 (CPU only, no GPU needed): pass Windows 11 Pro, Python 3.14.7, no GPU or game files involved; pytest/numpy/Pillow pinned from
AI-assisted (Claude Code, Claude Opus 5.5). |
… guard stdout Review of ItsNotRexed#8575 (svds12343): - stack_scan now searches the ThreadList entry's own stack descriptor first, so a dump that does not repeat the saved stack in MemoryList/Memory64List still scans it. New test builds the dump without MemoryList. - The entry point reconfigures stdout with errors="replace" like the other tools. New subprocess test runs the tool's __main__ with a strict cp1252 stdout and a mapped-module name it cannot encode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@svds12343 thanks, both reproduced and fixed in
Checked: both new tests fail on AI-assisted (Claude). No game data. |
Claimed in the coordination issue as a new item (claim).
Depends on: none. It builds on
main. #8161 movesT:into a per-process subfolder of.gta6rt-temp. The newdocs/boot.mdsection only says thatT:maps to the overlay's.gta6rt-tempfolder, so it stays true either way.What and why
The title has its own crash reporter. Under
gta6rtit cannot upload anything, but it still writes a minidump throughCreateFileWtoT:\<guid>.dmp, which lands in<overlay>/.gta6rt-temp. The dump's ModuleList comes from the host loader. It namesgta6rt.exeand the Wine or Windows DLLs, but not the executable and the four package DLLs thatgta6rt's PE loader mapped by hand. A debugger therefore shows the fault and every guest frame as a bare address.The startup trace (
--trace) already has amapevent withmodule,baseandsizefor each mapped image.tools/minidump_summary.pyreads a dump and the trace of the same run and prints, asmodule+0xRVAwith both module lists:rip/rsp. For the faulting thread these come from the exception stream's own CONTEXT, because the thread's ThreadList context is the reporter's;--all-threads) that point into a known module past its header page. This is a scan, not an unwind, and the docs and--helpsay so.It warns when the dump's process id (MiscInfo) differs from the trace's
trace_openpid, and when a mapped range overlaps one of the dump's modules. Thread names are counted, not printed. The tool uses only the standard library and follows the repo's conventions:python -I, a--helpdocstring,--json, and oneERROR:line with exit 2 for a missing or invalid input.docs/boot.mdgets a short section, "The title's own crash dumps", anddocs/README.mdnames the tool in theboot.mdrow.I chose a tool over a runtime change, for example wrapping
MiniDumpWriteDumpto add the mapped modules through a callback. The trace already has everything the attribution needs, and the tool reads dumps from any build, including old ones.Tested
NixOS, Python 3.12, CPU only for the tool. The dumps came from a clang-cl 21.1.8 cross build under Wine 11.21 Staging on a GTX 1060 / NVIDIA 580.
tests/test_minidump_summary.py(7 tests, OK). It builds a synthetic AMD64 minidump in memory with SystemInfo, MiscInfo, a one-module ModuleList, a ThreadList with a CONTEXT and saved stack, a MemoryList and an Exception stream with its own CONTEXT, and pairs it with a synthetic trace that has amapevent and a truncated last line. The tests check the exception and access attribution, the use of the exception context for the faulting thread, the stack scan (skipping slots below the fault'srspand values in a header page), bare addresses without--trace, the pid-mismatch warning, read access and other codes, the text report, and exit 2 with oneERROR:line for four bad inputs.python -m compileall -q tools tests,test_ci_registration,test_docs_repo_paths,test_docs_table_rows: OK.test_docs_cli_flagsandtest_text_write_line_endingsfail onmainthe same way with and without this change (docs/embedded_shaders.mdflags;tools/leonida_tui.py,tools/wave_diff.py). Neither failure involves the files changed here.scripts/check_no_game_data.pyon the changed files: clean.ERROR:line and exit 2. Of the 15, 9 guest faults (6 access violations, 3 breakpoints) resolve to the executable and 1 access violation togta6rt.exe. 5 C++ exceptions resolve to the host'sRaiseException. For the 4 dumps whose run trace I kept, the exception address matches the trace'sexceptionevent. The faulting thread's stack scan also contains every frame of the trace's unwound stack in the same order (15 of 15 in three runs, 4 of 4 in one), mixed with data-pointer candidates. Without--tracethose addresses stay bare. The dumps, traces and outputs stayed local.AI-assisted (Claude). Tested on NixOS / GTX 1060 / NVIDIA 580 / Wine 11.21 Staging.
🤖 Generated with Claude Code