fix(libc): resume host foreign exceptions with host unwinder #3520

Merged
MarcZX10 merged 1 commit from upstream-pr/3520 into main 2026-10-11 19:37:59 +00:00
MarcZX10 commented 2026-10-11 12:11:53 +00:00 (Migrated from github.com)

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


What

On current main, the Linux GCC 13.3 reproduction for issue #3459 aborts in LibcUnwind::Step(context) at core/libs/prx/libc/src/exception/Unwind.cpp:519 while resuming a host C++ exception. The custom unwinder owns AnyPS5 exceptions, but this host exception must be resumed by the host unwinder. Delegate non-native exceptions to the next Linux _Unwind_Resume implementation. Keep AnyPS5-native exceptions and active forced unwinds on the existing custom path.

Tested

Ubuntu 24.04, GCC 13.3.0, glibc 2.39:

  • guest_kernel_stack_protect fails on the base commit with Subprocess aborted, then passes with this change.
  • exception_runtime and exception_personality pass with the change. The forced-unwind coverage in exception_runtime confirms that active forced unwinds still use the custom path.
  • git diff --check and python3 tools/check_conventions.py --base upstream/main pass.

Checklist

  • Based on current main; no other open PR implements the same fix
  • 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: #3511 for remote CI checkout only; no code dependency
  • AI-assisted: yes (Codex)

Fixes #3459.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4818954201 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3520). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T12:11:53Z. --- ### What On current `main`, the Linux GCC 13.3 reproduction for issue #3459 aborts in `LibcUnwind::Step(context)` at `core/libs/prx/libc/src/exception/Unwind.cpp:519` while resuming a host C++ exception. The custom unwinder owns AnyPS5 exceptions, but this host exception must be resumed by the host unwinder. Delegate non-native exceptions to the next Linux `_Unwind_Resume` implementation. Keep AnyPS5-native exceptions and active forced unwinds on the existing custom path. ### Tested Ubuntu 24.04, GCC 13.3.0, glibc 2.39: - `guest_kernel_stack_protect` fails on the base commit with `Subprocess aborted`, then passes with this change. - `exception_runtime` and `exception_personality` pass with the change. The forced-unwind coverage in `exception_runtime` confirms that active forced unwinds still use the custom path. - `git diff --check` and `python3 tools/check_conventions.py --base upstream/main` pass. ### Checklist - [x] Based on current `main`; no other open PR implements the same fix - [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/CONVENTIONS.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: #3511 for remote CI checkout only; no code dependency - [x] AI-assisted: yes (Codex) Fixes #3459.
screamm commented 2026-10-11 12:23:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T12:23:36Z.


Windows validation of the current head 53c05aa5 merged onto main 1e8fff68 (Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including libs):

  • exception_runtime, exception_personality and guest_kernel_stack_protect pass 3/3.
  • ctest -j8 -E "^agc_driver_|^video_out_flip": 533/536. The three failures are all present on unchanged main 1e8fff68 on this host and unrelated to this change: windows_exceptions (#3411, since #1423), guest_kernel_sys (symlink: Function not implemented, since #3491 merged, reported there) and guest_filesystem (restoring the directory time at GuestFilesystem.cpp:286, which #3518 addresses).

So the Windows build is neutral to this change; it neither fixes nor worsens the Windows unwinder regression in #3411.

Validation run with Claude Code assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108981335 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3520#issuecomment-6108981335). Originally posted by [screamm](https://github.com/screamm) on 2026-10-11T12:23:36Z. --- Windows validation of the current head `53c05aa5` merged onto `main` `1e8fff68` (Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including `libs`): - `exception_runtime`, `exception_personality` and `guest_kernel_stack_protect` pass 3/3. - `ctest -j8 -E "^agc_driver_|^video_out_flip"`: 533/536. The three failures are all present on unchanged `main` `1e8fff68` on this host and unrelated to this change: `windows_exceptions` (#3411, since #1423), `guest_kernel_sys` (`symlink: Function not implemented`, since #3491 merged, reported there) and `guest_filesystem` (restoring the directory time at `GuestFilesystem.cpp:286`, which #3518 addresses). So the Windows build is neutral to this change; it neither fixes nor worsens the Windows unwinder regression in #3411. Validation run with Claude Code assistance.
MarcZX10 commented 2026-10-11 12:33:09 +00:00 (Migrated from github.com)

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


Thanks for running the Windows build and regression checks. This confirms the patch is neutral on that host and keeps the Windows unwinder regression tracked separately under #3411.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109060131 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3520#issuecomment-6109060131). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T12:33:09Z. --- Thanks for running the Windows build and regression checks. This confirms the patch is neutral on that host and keeps the Windows unwinder regression tracked separately under #3411.
milescoviello commented 2026-10-11 17:25:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-11T17:25:48Z.


Checked on CI's toolchain: Ubuntu 24.04, GCC 13.3, Release with CI's configure flags, RTX 4070 Ti. guest_kernel_stack_protect aborts 3/3 on main a11c8f7f (as in #3459) and passes 3/3 with this PR (b316c988). In the full ctest, no test fails with this PR that doesn't also fail on main on this machine. The others that fail there are agc_driver_emulated_color_compare (#3526) and the BDA read tests that hang this machine's older NVIDIA driver (#3291).

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111683455 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3520#issuecomment-6111683455). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-11T17:25:48Z. --- Checked on CI's toolchain: Ubuntu 24.04, GCC 13.3, Release with CI's configure flags, RTX 4070 Ti. `guest_kernel_stack_protect` aborts 3/3 on `main` a11c8f7f (as in #3459) and passes 3/3 with this PR (b316c988). In the full `ctest`, no test fails with this PR that doesn't also fail on `main` on this machine. The others that fail there are `agc_driver_emulated_color_compare` (#3526) and the BDA read tests that hang this machine's older NVIDIA driver (#3291). AI-assisted: yes
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!3520
No description provided.