mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-19 15:09:58 -04:00
Skip RivaTuner's restore at a fatal error on the RTSS thread too, not only at a crash there.
The review of the RTSS thread change found that only main.c crash_handler skipped rtss_limit_restore on the "rtss" thread. An rt_fatal on that thread while it holds rtss_limit.c's lock still called the restore from dispatch.c fatal_end, whose trylocks then spent a second for nothing before the end went on. A-14 names fatal_end. fatal_end now reads plat_thread_name and calls rtss_limit_restore only when the thread is not "rtss", as crash_handler does. Not reproduced in the game before the change. tests/fatal_exit_check.c's stand-in restore now says it ran, and a new fatal_rtss mode calls rt_fatal on a thread spawned with the name "rtss": on the code before this change the restore ran there (the check fails), now it does not, and the process still ends with 70 after the rumble stop. The other cases check that the restore runs from any other thread. fatal_exit_check and the compile check of dispatch.c pass, with no -Wall warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,8 @@ checks statically that no runtime file outside the platform layer ends the proce
|
||||
error's end and the lost device's (runtime/vk_device.c lost_wait_exit) end with plat_terminate. No game files, no GPU.
|
||||
|
||||
A fatal error stops HD rumble on a thread of its own and waits for it 300 ms at most (runtime/dispatch.c
|
||||
rt_rumble_stop_bounded), so a stop that hangs on SDL's lock does not hold the end.
|
||||
rt_rumble_stop_bounded), so a stop that hangs on SDL's lock does not hold the end. A fatal error on RTSS's own thread
|
||||
("rtss") skips RivaTuner's restore, whose lock that thread may hold.
|
||||
|
||||
Two failures at once end once: two threads that fault, a fault while a fatal error is reported and a fatal error
|
||||
while a crash is: the first report is written whole, the process ends with its code, and the second adds no line
|
||||
@@ -105,7 +106,10 @@ def static_checks():
|
||||
|
||||
CASES = [
|
||||
# mode, exit code, lines that must be there, lines that must not
|
||||
('fatal', 70, ['FATAL: the test\'s fatal error 1', 'frametime: at a fatal error', 'rumble: stopped'], ['detach:']),
|
||||
('fatal', 70, ['FATAL: the test\'s fatal error 1', 'frametime: at a fatal error', 'rumble: stopped', 'rtss: restored'],
|
||||
['detach:']),
|
||||
# rt_fatal on RTSS's own thread, which may hold the lock the restore tries: no restore from there
|
||||
('fatal_rtss', 70, ['FATAL: the test\'s fatal error 3', 'rumble: stopped'], ['rtss: restored', 'detach:']),
|
||||
# the rumble stop hangs (SDL's lock held by a thread that crashed): the end goes on after 300 ms
|
||||
('fatal_rumble', 70, ['FATAL: the test\'s fatal error 1'], ['rumble: stopped', 'detach:']),
|
||||
# two faults at once: the first report whole, the second thread waits (dispatch.c rt_ending_enter)
|
||||
|
||||
Reference in New Issue
Block a user