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).
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)