Closing Syobon Action (PPSA47402) aborts: its exit handler submits a flip after the VideoOut shutdown ("exit thread cannot wait for itself") #5931
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from boykopovar/AnyPS5. Originally posted by ahmad3a4 on 2026-10-14T16:16:06Z.
What happens
Syobon Action (PPSA47402, 01.001.000 from the homebrew catalog, GPL-3.0, kvaps/syobon-action-ps5) runs on Windows: its SDL start-up passes, it presents frames, and Enter moves on to the lives screen ("× 1") at about 30 FPS. Closing the window then aborts, 4 of 4 runs:
and the process ends with
0xC0000409instead of exit code 0.Where
The aborting thread is the exit thread. Its stack, symbolized against the patched
libSceVideoOut.prx:eboot.exe+0x27da0…+0x2acedf)sceVideoOutSubmitFlipVideoOutDriver::GetConfig, which throwsProcessShutdownbecause the flip queue is stoppingcatchinsceVideoOutSubmitFlipcallsLibcAwaitExit_nid_postfixLibcAwaitExit_nid_postfixthrows "exit thread cannot wait for itself"So the title's exit handler (the SDL port's video shutdown, by the look of it) submits one more flip.
Reading
maine34c4792:LibcExit_nid_no_patchrunsLibcRunShutdown_nid_postfix(the AGC and VideoOut shutdown callbacks) and only thenCxaFinalize_nid_no_patch, which runs the guest'satexit/__cxa_atexithandlers.ProcessShutdownintoLibcAwaitExit_nid_postfix. That parks every other thread, but it cannot park the exit thread.LibcRequestExit_nid_postfix) and for the title's ownexit().#5277 / #5284 hit the same message from a nested
exit(); this is a driver call from an exit handler instead.Options
exit()runs the handlers while VideoOut and AGC still work, and other threads keep running until_exit. Other threads would then still be parked by the shutdown token. The exit thread, which runs the handlers, would be let through until the callbacks run.sceSystemServiceLoadExec("exit"), because the shell closes a title without them. A title's ownexit()would still hit this.VIDEO_OUT_ERROR_INVALID_HANDLE(and the AGC equivalent) once the drivers are shut down, as if the output had been closed. The handler continues and the remaining handlers run, but the title sees an error the console wouldn't give.Option 1 matches the console for both kinds of exit. It changes the order set in
39fd90b05, so I'd like to hear which direction you prefer before sending a pull request. I can send it with a test in the style ofGuestSystemExit.cpp, where an exit handler calls a VideoOut entry point.Setup
Windows 11 Pro (26200), RTX 3060 Ti, WinLibs GCC 15.2.0 r7, Release,
maine34c4792. The catalog zip (SHA-25686e763fa…) unpacked and relinked with--windows --to-intel, run from the output folder, closed withWM_CLOSEafter 15 to 33 s. Linux not tested.AI-assisted.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T17:59:46Z.
PR #5978 addresses the explicit guest
exit()and return-from-main path: guest finalizers run while the shutdown token is still live, then the AGC/VideoOut shutdown callbacks run. It depends on #5843, which preserves the separate no-handler path for host window close. The Linux build compiled both changed C++ files and a focused probe passed; the CTest binaries abort at the host CPU-feature guard before the test logic runs, so those tests are not reported as passing.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-16T23:53:56Z.
#5978 (
29a546d37) is on main now: the guest's exit handlers run before the VideoOut shutdown, which is the flip-after-shutdown shape in your stack. It was tested only in unit tests, not on this title. Could you close Syobon Action again on current main and say whether theexit thread cannot wait for itselfabort is gone? If it is, this can close.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T02:32:04Z.
The shutdown ordering change from #5978 is now on
mainand appears to cover the reported flip-after-shutdown path. When convenient, could you close Syobon Action again on currentmainand report whether the abort is gone? If it persists, the current log and tested commit would help isolate what remains.Imported from boykopovar/AnyPS5. Originally posted by ahmad3a4 on 2026-10-18T12:27:01Z.
Checked on current main
0d078f75d(with #5843 and #5978): the abort is gone.Windows 11 Pro, i5-13400, WinLibs GCC 15.2.0 r7, Release. Syobon Action (PPSA47402) relinked with main's relinker, run to the title screen (30 FPS) and closed through the window after 15 s, 3 times: exit code 0 each time, with no
exit thread cannot wait for itselfand no abort in the log. Before #5843 and #5978 the same close aborted every time.Closing this. Thanks @MarcZX100, @Ondra97 and @oneandonlydean.