Repository navigation
runtime: say so when the title's hang watchdog ends the run (RT-WATCHDOG-FIRED-NOTE) - #2156
Closed
quartz-heron-58 wants to merge 1 commit into
Closed
quartz-heron-58 wants to merge 1 commit into
quartz-heron-58 wants to merge 1 commit into
Conversation
…DOG-FIRED-NOTE) The retail title's watchdog ends a run whose main loop stalled for 30 s by calling a crash callback and writing to address 0. The log then showed only an access violation in title code, which reads as a fault of the layer or of whatever happened just before (ProjectLeonida#2019, ProjectLeonida#1915). The unhandled-exception filter now recognises that write and prints one line naming the watchdog, the 30 s window and LEONIDA_TITLE_WATCHDOG=0. It uses what main.cpp already knew: the verified trap instruction, and its address as the fault's instruction or as a return address on the faulting thread's stack. The exception continues as before. The watchdog's constants and the recognition move to src/title_watchdog.h (pure, no Windows), with a CPU-only test of 19 cases. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
|
Checked
AI-assisted. |
Contributor
Author
|
Closing this. Since it was opened, main took the watchdog's trap and kick addresses out of the repository (RT-BOOT-COMBINED, LEONIDA_TITLE_WATCHDOG_KICK), and this branch still carries them in runtime/src/main.cpp; reworking it would mean a different change, and the note it adds matters less now that the watchdog can be kept kicked. Thanks @moffington for checking it. AI-assisted (Claude Code). |
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.
Claimed in the coordination issue as: RT-WATCHDOG-FIRED-NOTE (#1608)
What and why
The retail title runs a hang watchdog: when its main loop has not reported progress for 30 one-second ticks, it calls a crash callback and writes to address 0 on purpose (the comment at the top of
runtime/src/main.cpphas described this sinceLEONIDA_TITLE_WATCHDOGwas added). Under the runtime the main loop can stall that long for ordinary reasons, a pipeline build for instance. The log then showed only an access violation writing address 0 in title code, and people take it for a fault of the layer or of whatever happened just before it: #2019 (read as a consequence of two DirectStorage errors), #1915, and my own first boots with input. Each time someone had to explain it by hand.Now the runtime says it. When the unhandled-exception filter sees that write, it prints once:
How it is recognised, with nothing main.cpp did not already know:
LEONIDA_TITLE_WATCHDOG=0already made; any other build is left alone);The constants and the recognition move from main.cpp to
runtime/src/title_watchdog.has pure functions (trap_present,fired), so they can be tested without Windows or a game file. No new addresses, no behaviour change: the exception goes on to the cache write and the title's filter exactly as before, andLEONIDA_TITLE_WATCHDOG=0works as it did.Tested
Windows 11 (26300), MSVC Build Tools 2022, RelWithDebInfo,
scripts\build_runtime.ps1 -FetchSdl3on main c50ed94 plus this commit: build exit 0.title_watchdog_test(new, CPU only, a zeroed buffer stands in for the image): 19 checks, 0 failures. ctesttitle_watchdogandarena_blockspass.LEONIDA_TITLE_WATCHDOGunset: the last submission report is at 200 s, the title's exception (write to address 0, three title frames, the second one the trap's address) is at 228.8 s, and the log has the new line exactly once, directly before "unhandled exception 0xc0000005: writing the session pipeline cache". No device-loss report in that run. One run.scripts/check_no_game_data.pyon the four changed files: clean.Not run: the whole ctest set; a run with
LEONIDA_TITLE_WATCHDOG=0on this branch (the kick path only changed in where it gets its constants and its build check); Linux/Wine and clang-cl; a build withoutLEONIDA_VULKAN_DEVICE(the filter does not exist there, so the note does not either).Seen while testing, not from this change: ctest
gameinput_scriptfails on main c50ed94 in an SDL3 build (reported in #1608; it comes from #2098's change to how long a scripted press is held).GPUs tested: NVIDIA GeForce RTX 4080, driver 621.24, Windows 11 (the real boot above; the unit test needs no GPU)
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: no translator rule)🤖 Generated with Claude Code