Windows: closing the window sometimes aborts on an unhandled ProcessShutdown (PPSA03706) #3506
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 santhoshkumar-dev on 2026-10-11T12:01:05Z.
What happens
Closing the game window sometimes ends in
abort()instead of a clean exit. One guest thread receives theProcessShutdownexception that shutdown uses to stop threads, but nothing catches it on that thread's path:It is intermittent: of two closes of the same title, one aborted like this and the other exited cleanly. Both were ordinary window closes (
WM_CLOSE, the title bar's X), during gameplay at about 30 fps.Where to reproduce
mainit stops earlier on MSAA, so this was run on main0f863c102plus #419 and #2169 (test/pr419-pr2169-ppsa03706). That branch changes only AGC graphics state, pipeline and target code, and nothing in libc, libSceVideoOut or the AGC driver's lifecycle/entry points, so the shutdown path ismain's.What the log shows
thrown from 00007ff94662dfc6islibc.prx+0x5dfc6,__cxa_throw+ 0x56. Host code throws through the__cxa_throwwrapper inexception/Exports.cpp(NativeThrow), and__cxa_throw_nid_postfix(exception/Runtime.cpp) logs its own__builtin_return_address(0), which is that wrapper. So for host-thrown exceptions the message names the wrapper, and the throw site is not identified.ReportBacktrace(+0xa927) and a frame at+0x9b459that resolves only to.gcc_except_table, so it does not reach the guest caller either.Shutdown path (from the source)
SDL_QUIT→LibcRequestExit_nid_postfix(0)(VideoOutDriver.cpp) sets the stop token. Threads blocked in the driver then throwProcessShutdown. The guest entry points that are wrapped catch it and park inLibcAwaitExit_nid_postfix(): VideoOut'sOutput.cpp/Event.cpp/Buffer.cpp, and the AGC driver'sSubmit,AgcDriverWaitIdle,AgcDriverRegisterShaderandAgcDriverSuspendPoint.Not every throw site is reached only through one of those wrappers.
Driver::checkStopping()(Lifecycle.cpp) also runs fromDriver::CheckFailure(), which is called fromShaderRegistry.cpp,PacketExecution.cppandPresentation.cpp, and VideoOut'sCheckAlive()runs at several places inVideoOutDriver.cpp. A guest call that reaches one of these without aProcessShutdown→LibcAwaitExitcatch would produce exactly this abort. Which one escaped here is not confirmed.Suggestions
__cxa_throwwrapper (its own return address, passed down fromNativeThrow), so the escaping throw site shows up in logs.checkStopping()/CheckAlive()for a missingcatch (const ProcessShutdown&) { LibcAwaitExit_nid_postfix(); }.🤖 Generated with Claude Code