libSceSystemService: sceSystemServiceLoadExec("exit") runs the title's exit handlers, which the console doesn't; Wind Waker (PPSA99309) segfaults in one #5235
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 David-cmrg on 2026-10-13T15:22:49Z.
PS5_SwitchWaker (Wind Waker, PPSA99309, catalog 1.0.1) without a disc image shows "no game found" and then asks the shell to close it. On Linux,
main9510e71d6, llvmpipe, the process then ends with a segmentation fault (exit code 139) instead of exit code 0:The title ends in its own
catchReturnFromMain, which its CRT calls aftermainreturns (ps5/src/platform.c). It callssceSystemServiceLoadExec("exit", NULL)and then sleeps forever. Its comment gives the reason:exit()and returning from_startboth kill the title and "the console then reports a crash over a run that worked"; the shell closes the title asynchronously, so the title must wait and never return. VLC for PS5 ends the same way, with_exit(0)right aftersceSystemServiceLoadExec("exit", NULL)(plat_quit). So on the console, a title'satexitand__cxa_atexithandlers don't run aftersceSystemServiceLoadExec("exit").AnyPS5 runs them.
sceSystemServiceLoadExec("exit")callsLibcExit_nid_no_patch(0), which runsLibcRunShutdown, thenCxaFinalize(nullptr), thenstd::exit. In gdb, the main thread entersCxaFinalizeafterLibcRunShutdownand then faults in the title's code, in one of its__cxa_atexitdestructors. Going by the code, they also ran before #4872, from the hostatexitentry that the title's first__cxa_atexitregisters.Ending
"exit"withLibcRunShutdown, a flush andLibcTerminate, without the title's handlers, would match the console. #4846 would stay fixed, because no guest code runs during the exit.