fix(agc): catch shutdown in shader ABI resolution #3528

Merged
MarcZX10 merged 1 commit from upstream-pr/3528 into main 2026-10-11 21:06:08 +00:00
MarcZX10 commented 2026-10-11 12:31:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T12:31:18Z.


What

The shader ABI helpers in core/libs/prx/libSceAgcDriver/Execution/src/Driver/EntryPoints.cpp:126-140 call Driver::ResolveShaderAbi, ResolveGraphicsAbi and ResolveGraphicsStagesAbi. Those paths call CheckFailure(), which throws ProcessShutdown when window-close shutdown begins, but these C ABI entrypoints do not catch it. Unlike submit, wait-idle, shader-registration and suspend entrypoints, the exception can escape into the guest caller and terminate the process.

Catch ProcessShutdown at all three entrypoints and route the caller through LibcAwaitExit_nid_postfix(). The new child-process regression requests exit, calls shader ABI resolution with a null shader (the shutdown check runs before argument validation), and verifies the process exits cleanly. On current main, that test aborts on the unhandled exception. The report in #3506 does not identify its exact escaping title callsite, so this change covers the confirmed shader-resolution path without claiming to reproduce the title-specific stack.

Related to #3506.

Tested

Ubuntu 24.04, GCC 13.3.0, glibc 2.39:

  • agc_driver_resolution_shutdown aborts on current main with an unhandled ProcessShutdown, and passes with this change.
  • agc_driver_wait_shutdown and agc_driver_resolution_shutdown pass together (2/2).
  • git diff --check and python3 tools/check_conventions.py --base upstream/main pass.
  • Windows and a game title were not tested.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes (Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4819062482 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3528). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T12:31:18Z. --- ### What The shader ABI helpers in `core/libs/prx/libSceAgcDriver/Execution/src/Driver/EntryPoints.cpp:126-140` call `Driver::ResolveShaderAbi`, `ResolveGraphicsAbi` and `ResolveGraphicsStagesAbi`. Those paths call `CheckFailure()`, which throws `ProcessShutdown` when window-close shutdown begins, but these C ABI entrypoints do not catch it. Unlike submit, wait-idle, shader-registration and suspend entrypoints, the exception can escape into the guest caller and terminate the process. Catch `ProcessShutdown` at all three entrypoints and route the caller through `LibcAwaitExit_nid_postfix()`. The new child-process regression requests exit, calls shader ABI resolution with a null shader (the shutdown check runs before argument validation), and verifies the process exits cleanly. On current `main`, that test aborts on the unhandled exception. The report in #3506 does not identify its exact escaping title callsite, so this change covers the confirmed shader-resolution path without claiming to reproduce the title-specific stack. Related to #3506. ### Tested Ubuntu 24.04, GCC 13.3.0, glibc 2.39: - `agc_driver_resolution_shutdown` aborts on current `main` with an unhandled `ProcessShutdown`, and passes with this change. - `agc_driver_wait_shutdown` and `agc_driver_resolution_shutdown` pass together (2/2). - `git diff --check` and `python3 tools/check_conventions.py --base upstream/main` pass. - Windows and a game title were not tested. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes (Codex)
adriadam10 commented 2026-10-11 21:06:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:06:06Z.


Checked on Linux: agc_driver_resolution_shutdown fails without the EntryPoints.cpp change and passes with it; the other shutdown tests still pass. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6113750411 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3528#issuecomment-6113750411). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T21:06:06Z. --- Checked on Linux: `agc_driver_resolution_shutdown` fails without the `EntryPoints.cpp` change and passes with it; the other shutdown tests still pass. Merging.
Sign in to join this conversation.
No reviewers
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!3528
No description provided.