Windows: closing the window sometimes aborts on an unhandled ProcessShutdown (PPSA03706) #3506

Closed
opened 2026-10-11 12:01:05 +00:00 by santhoshkumar-dev · 0 comments
santhoshkumar-dev commented 2026-10-11 12:01:05 +00:00 (Migrated from github.com)
Contributor

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 the ProcessShutdown exception that shutdown uses to stop threads, but nothing catches it on that thread's path:

[libc] unhandled exception '15ProcessShutdown' thrown from 00007ff94662dfc6
terminate called after throwing an instance of 'ProcessShutdown'
FATAL: abort() (SIGABRT) on thread 14000
    #0 0x00007ff9465da927 libc.prx+0xa927
    #1 0x00007ff94666b459 libc.prx+0x9b459
    #2 0x000000004f72e640
[gpu] storage image 0x215410000 destroyed with GPU results pending
...

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

  • Windows 11 Pro 26200, AMD Radeon RX 6700 XT, MinGW-w64 GCC 15.2.0, Release.
  • PPSA03706 (My Friend Peppa Pig, Unity). On main it stops earlier on MSAA, so this was run on main 0f863c102 plus #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 is main's.

What the log shows

  • thrown from 00007ff94662dfc6 is libc.prx+0x5dfc6, __cxa_throw + 0x56. Host code throws through the __cxa_throw wrapper in exception/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.
  • The aborting thread's backtrace stops after libc's ReportBacktrace (+0xa927) and a frame at +0x9b459 that 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 throw ProcessShutdown. The guest entry points that are wrapped catch it and park in LibcAwaitExit_nid_postfix(): VideoOut's Output.cpp/Event.cpp/Buffer.cpp, and the AGC driver's Submit, AgcDriverWaitIdle, AgcDriverRegisterShader and AgcDriverSuspendPoint.

Not every throw site is reached only through one of those wrappers. Driver::checkStopping() (Lifecycle.cpp) also runs from Driver::CheckFailure(), which is called from ShaderRegistry.cpp, PacketExecution.cpp and Presentation.cpp, and VideoOut's CheckAlive() runs at several places in VideoOutDriver.cpp. A guest call that reaches one of these without a ProcessShutdown → LibcAwaitExit catch would produce exactly this abort. Which one escaped here is not confirmed.

Suggestions

  • Have the unhandled-exception message name the caller of the __cxa_throw wrapper (its own return address, passed down from NativeThrow), so the escaping throw site shows up in logs.
  • Audit guest-callable exports that can reach checkStopping()/CheckAlive() for a missing catch (const ProcessShutdown&) { LibcAwaitExit_nid_postfix(); }.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5800854954 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3506). Originally posted by [santhoshkumar-dev](https://github.com/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 the `ProcessShutdown` exception that shutdown uses to stop threads, but nothing catches it on that thread's path: ``` [libc] unhandled exception '15ProcessShutdown' thrown from 00007ff94662dfc6 terminate called after throwing an instance of 'ProcessShutdown' FATAL: abort() (SIGABRT) on thread 14000 #0 0x00007ff9465da927 libc.prx+0xa927 #1 0x00007ff94666b459 libc.prx+0x9b459 #2 0x000000004f72e640 [gpu] storage image 0x215410000 destroyed with GPU results pending ... ``` 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 - Windows 11 Pro 26200, AMD Radeon RX 6700 XT, MinGW-w64 GCC 15.2.0, Release. - PPSA03706 (My Friend Peppa Pig, Unity). On `main` it stops earlier on MSAA, so this was run on main `0f863c102` plus #419 and #2169 ([`test/pr419-pr2169-ppsa03706`](https://github.com/santhoshkumar-dev/AnyPS5/tree/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 is `main`'s. ### What the log shows - `thrown from 00007ff94662dfc6` is `libc.prx+0x5dfc6`, `__cxa_throw` + 0x56. Host code throws through the `__cxa_throw` wrapper in `exception/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. - The aborting thread's backtrace stops after libc's `ReportBacktrace` (`+0xa927`) and a frame at `+0x9b459` that 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 throw `ProcessShutdown`. The guest entry points that are wrapped catch it and park in `LibcAwaitExit_nid_postfix()`: VideoOut's `Output.cpp`/`Event.cpp`/`Buffer.cpp`, and the AGC driver's `Submit`, `AgcDriverWaitIdle`, `AgcDriverRegisterShader` and `AgcDriverSuspendPoint`. Not every throw site is reached only through one of those wrappers. `Driver::checkStopping()` (`Lifecycle.cpp`) also runs from `Driver::CheckFailure()`, which is called from `ShaderRegistry.cpp`, `PacketExecution.cpp` and `Presentation.cpp`, and VideoOut's `CheckAlive()` runs at several places in `VideoOutDriver.cpp`. A guest call that reaches one of these without a `ProcessShutdown` → `LibcAwaitExit` catch would produce exactly this abort. Which one escaped here is not confirmed. ### Suggestions - Have the unhandled-exception message name the caller of the `__cxa_throw` wrapper (its own return address, passed down from `NativeThrow`), so the escaping throw site shows up in logs. - Audit guest-callable exports that can reach `checkStopping()`/`CheckAlive()` for a missing `catch (const ProcessShutdown&) { LibcAwaitExit_nid_postfix(); }`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#3506
No description provided.