runtime: a fatal exception names its place in the title: RVA, stack, registers (RT-FATAL-REPORT-RVA) #2555
Closed
leonida/mandy
kristofbarany wants to merge 0 commits from
leonida/fatal-report into main
pull from: leonida/fatal-report
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!2555
Loading…
Reference in a new issue
No description provided.
Delete branch "leonida/fatal-report"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request closed
This pull request cannot be reopened because the branch was deleted.
Claimed in the coordination issue as: RT-FATAL-REPORT-RVA (https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7232350334)
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 of#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)#2555 | head db0ecbacecdbb9e836b8a52032b58a4c6ea5c206 | 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 02f71ccfe 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
Reviewed the diff and tested merged onto
main(493867366) with Ninja Release (MSVC).Using
ReadProcessMemoryinrt::fatal_report::describekeeps 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
19.44+ Live Hardwareint3SEH Verification (db0ecbacec+origin/mainadfb3821a2)Verdict: PASS (0 blockers, 0
/W4warnings in new code)Environment & Merge Check
10.0.26200), MSVC19.44.35228(x64,/W4 /permissive- /utf-8 /O2 /EHsc)origin/main(adfb3821a2,git merge-tree --write-treerc=0);runtime/src/main.cppcompiles cleanly under/W4;test_ctest_registration.py,test_ci_registration.py, andtest_text_encoding.pyallOK.Red -> Green & Live Hardware SEH Results
runtime/src/fatal_report.handfatal_report_testare absent onorigin/main(C1083), wheresave_caches_on_fatal_exceptionlogs only the exception code without RVA, stack, or register context.PR #2555 + origin/main):fatal_report_test.exe: PASS (7 checks, 0 failures,0/W4warnings).int3(__debugbreak()) SEH probe: Raised a realEXCEPTION_BREAKPOINT(0x80000003) inside nested non-inlined PE functions and passedGetExceptionInformation()intort::fatal_report::describeagainstGetModuleInformationbase/size — confirmed accurate fault RVA ([rt] fault at title +0x203a), innermost-first hardware stack return RVAs (+0x20fb +0x19560 ...), and live register dump (rc=0).Diff Audit Notes (Non-Blocking Suggestions)
r10andr11(the two volatile x64 scratch/indirect-call registers) are omitted from the[rt] registers:format string betweenr9andr12; including them could help when diagnosing indirect/CFG call faults.describe()builds its output instd::stringinsidesave_caches_on_fatal_exception; if a fatal exception ever occurs while the default process heap lock is held or corrupted, formatting stack-buffered lines directly toSTD_ERROR_HANDLE(WriteFile/fputsonchar buf[512]) would keep the diagnostic completely heap-free.AI-assisted.
Run of #2555 (
fatal_report), red then green.git merge-tree --write-tree main <head>merges cleanly.Commands (in a vcvars64 shell, build folder inside the worktree):
Green (PR head): builds,
fatal_reportPassed (1/1, 0.02 s).Red (non-test changes reverted:
runtime/src/fatal_report.hremoved andruntime/src/main.cppback to the base, test and CMake registration kept): the target does not build (C1083: cannot open include file '../src/fatal_report.h') and the same ctest endsfatal_report (Not Run), 0 of 1 passed. Since the PR adds a new header, red here is a build failure and not an assertion failure. The stale test executable from the green build was deleted before this ctest, so it could not pass by leftover.Overlap (checked with
git merge-tree): this PR conflicts with #2306 (which contains #2276) inruntime/src/main.cpp; both add a crash report with registers and stack, so only one of the two can go in as is.Link check: merged into main 1bc055e6c, gta6rt.exe builds and links (RelWithDebInfo, MSVC 19.44); no new imports vs main.
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
origin/main4364a4fa6:So: it applies, its own test passes, and the whole runtime still compiles with the change - which matters more than usual here because
main.cppis where the fatalpath lives and a mistake there would show up as a build break rather than a test failure.
What this does not cover: anything that needs the game to run. I built
gta6rtbut did not launch it, so the part that prints an RVA and registers for a realexception is unexercised -
fatal_report_testdrives the formatter with synthetic data, which is the testable half.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.
merge-treeclean;db0ecbacecherry-picks ontomain0ae217cebwithout a conflict. Four files,161 insertions(+), 1 deletion(-):fatal_report.h(new),main.cpp, the test, and its CMake registration.2. It builds and passes, three times:
fatal_report_test.exe-> exit 0, 0, 0.3. The negative control cannot be built.
fatal_report.his a new file and the test includes it (6 references); with the header removed the compile stops at:So there is no
mainversion of this test to run against - the same shape as #2651 and #2645. What that proves is that the test exercises the new reporting path; it does not prove the path is right.A trap I fell into and caught in this same round: my first attempt reverted only
main.cpp(the header does not exist onmain, sogit checkout origin/main -- …fails for it), Ninja reported "no work to do", and the binary from the previous build answeredexit 0. That number was the old executable, not the reverted source. The.exetimestamp is what exposed it -07:00:45, unchanged - and the compile failure above is the real result of the attempt.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
d367675c7.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
db0ecbace.runtimeand builtfatal_report_test(MSVC 14.52.37025, Windows SDK 10.0.26100).Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711.
AI-assisted: yes (opencode).
Maintainer review: not ready to merge. Blockers: (1)
gh pr checksreports no checks for the current head; the comments contain test runs, but no current CI result is available. (2) This PR overlaps the still-open #2306 crash-reporting change; the intended single implementation needs to be resolved before merge. (3) The latest independent review reports the new fatal path can allocate/use CRT stderr before cache saving and that the stack scan is not bounded to the faulting thread stack; no fix or response is present in the discussion. (4) A later negative-control report saysfatal_report_teststill passes after reverting the source change, so the test does not demonstrate the new behavior. Please address these points or explain why each is safe, then refresh validation.Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.