Repository navigation
runtime: a fatal exception names its place in the title: RVA, stack, registers (RT-FATAL-REPORT-RVA) - #2555
runtime: a fatal exception names its place in the title: RVA, stack, registers (RT-FATAL-REPORT-RVA)#2555kristofbarany wants to merge 1 commit into
Conversation
…registers)
The fatal-exception filter printed only the code ("unhandled exception 0x80000003"), so a
title's soft assert (int3 after a report call) could not be traced from the log. It now
also prints the faulting address as an RVA of the title's image, the stack qwords that
point into the image (likely return addresses, innermost first), the general registers,
and the RVA of the vtable of an object in rbx. Reads go through ReadProcessMemory, so a
bad stack pointer ends the walk instead of faulting inside the handler
(runtime/src/fatal_report.h).
Found with it: the title's out-of-memory int3 when its own upscaler is forced on Series S
(the allocation size in rdi, the allocator's vtable from rbx).
Test: fatal_report_test (made-up exception record, context and stack over a stand-in image).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
#2555 | head db0ecba | ctest -C RelWithDebInfo -R "^fatal_report$" (MSVC RelWithDebInfo; gta6rt also built) | red: n/a, the test includes the new src/fatal_report.h, so on main it does not compile (new diagnostic, not a fix of something main gets wrong) | green: main 02f71cc merged into the head, 7 checks, 0 failures, 1/1 passed | full suite: not run (a game boot was using the machine) | Windows 11, RTX 4070 SUPER, NVIDIA 621.01, Python 3.14 | AI-assisted: yes, Claude Code |
lixonik
left a comment
There was a problem hiding this comment.
Reviewed the diff and tested merged onto main (493867366) with Ninja Release (MSVC).
Using ReadProcessMemory in rt::fatal_report::describe keeps the fatal-exception diagnostic safe against bad stack/object pointers, and the RVA/stack/register/vtable formatting and unit tests are clean.
Tests run
ctest --output-on-failure -R "^fatal_report$": 1/1 passed (fatal_report0.02 s).python -m unittest tests/test_ctest_registration.py: 7/7 passed (1.01 s).
AI-assisted (Antigravity, Gemini).
Native Windows 11 + MSVC
|
|
Run of #2555 (
Commands (in a vcvars64 shell, build folder inside the worktree): Green (PR head): builds, Red (non-test changes reverted: Overlap (checked with |
timbot103
left a comment
There was a problem hiding this comment.
Static audit of db0ecbace against 48bae6cad. I found two issues.
runtime/src/fatal_report.h:37andruntime/src/main.cpp:374: the top-level filter allocates and writes through CRTstderrbefore saving caches. A failed allocation can bypass the save and filter delegation, and a blocked report holds the existingcall_once. Please format into a fixed-size buffer, bypass CRT stdio for the new output, and preserve cache saving and filter delegation when reporting fails.runtime/src/fatal_report.h:45:ReadProcessMemorychecks readability. A corruptRspcan still point into a readable non-stack page. Please bound the scan to the faulting thread's stack and cover readable non-stack memory and the upper stack boundary in the synthetic test.
AI-assisted.
|
Verified on the C++ runtime here, because this one can be built and run without the game. The branch is 1780 commits behind, so the question is whether it still applies at all. Applied onto So: it applies, its own test passes, and the whole runtime still compiles with the change - which matters more than usual here because What this does not cover: anything that needs the game to run. I built Written with an AI assistant. |
|
Independent verification on this machine (Windows 11, MSVC 19.44.35226). It applies, builds and passes; the negative control is impossible by construction, and I say so rather than dress up a passing number. 1. It applies. 2. It builds and passes, three times: 3. The negative control cannot be built. So there is no A trap I fell into and caught in this same round: my first attempt reverted only What I did not test: a fatal exception in a real run. The test builds the report from a synthetic fault record; whether the RVA, stack and register block it prints point at the right place in the title needs a crash under the loader, which is the situation this reporting exists for and one this machine cannot stage. Written with an AI assistant. |
|
Verified with a negative control, and the result is worth knowing: the tests pass with the header reverted, so they do not observe the change. 1. It applies and builds. merge-tree clean onto main 2. With the branch: 3. The control - revert only the source change, keep the test, rebuild: What that says: the fault report written for an exception is not observed by $(System.Collections.Hashtable.test). The test keeps passing when both the header and its wiring in main.cpp are put back to main's versions. What I am not saying: that the change is wrong. Two readings are possible and I did not choose between them - the test may be a unit test of a header whose behaviour is unchanged in the cases it covers (in which case green either way is correct and the change is elsewhere), or it may be a test that was written beside the change rather than against it. What would settle it in one case: a test that drives the path through the new code - e.g. for this one, the fault report written for an exception with an input that only the new code handles - and asserts on the result. If no such input exists, the change is additive and the control is expected to be green, which is also a useful thing to write in the pull request. Why I am commenting: I verify open pull requests that replay onto current main, build the binaries their tests name, run them, then revert only the source change. A green control is a real result, and it is the one a reviewer cannot get from the diff. Written with an AI assistant. |
|
Independent check on Windows (not the author), at
Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711. AI-assisted: yes (opencode). |
|
Maintainer review: not ready to merge. Blockers: (1) |
Claimed in the coordination issue as: RT-FATAL-REPORT-RVA (#1608 (comment))
What and why
gta6rt's fatal-exception filter printed only the exception code (
[rt] unhandled exception 0x80000003: writing the session pipeline cache ...), so a title's soft assert (anint3after a report call) could not be traced from thelog. It now also prints, once, before the pipeline cache is written:
rsp.rbxwhen its first qword points into the image.ReadProcessMemory, so a bad stack pointer ends the walk instead of faulting again inside thehandler (
runtime/src/fatal_report.h). The image's base and size are recorded right after the title is loaded.Found with it (the use that motivated it, see #2554): with the title's own upscaler forced on Series S, the title
stops about 30 s in at its out-of-memory report. The report gave the
int3's RVA, the allocator call on the stack,the request size in
rdi(2.1 MiB) and the allocator object's vtable fromrbx; reading that object's fieldsthen showed the full 1,277 MiB range.
Tested
fatal_report_test(new): a made-up exception record, context and stack over a stand-in image: the RVA, the imageaddresses in order with the limit, the registers,
rbx's vtable, and a fault outside the image, an unknown image,an unreadable stack pointer and null exception pointers (no fault, a report). 7/7.
cteston this branch (Windows 11, MSVC 2022, Ninja, RelWithDebInfo): 508 of 510 passed. The two failures,xbox_present(present failed (VkResult -11)) andd3d12_set_descriptor_heaps(recorded_commandscheck), areseparate executables that do not build
src/main.cppor the new header, and fail the same way on the branch ofruntime: LEONIDA_TITLE_PATCH, checked byte patches of the title from the environment (RT-TITLE-PATCH-ENV) #2554.
tests/test_docs_env_vars.py,test_ctest_registration.py,test_text_encoding.py: OK.scripts/check_no_game_data.pyon the changed files: clean.int3(three runs, the same RVA each time). Not yet run in the game on thismain.GPUs tested: NVIDIA GeForce RTX 4070 12 GB, driver 621.40, Windows 11 (ctest)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)