feat(libc): export std::overflow_error type info, vtable and destructor #4426

Merged
babyhuey merged 1 commit from upstream-pr/4426 into main 2026-10-12 18:25:43 +00:00
babyhuey commented 2026-10-12 10:51:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-12T10:51:08Z.


What

Exports std::overflow_error's type info (_ZTISt14overflow_error, base runtime_error), vtable (_ZTVSt14overflow_error) and destructor (_ZNSt14overflow_errorD1Ev) from libc. They are built like std::range_error next to them, sharing the message destroy/delete/what slots. These are the three exports the titles import. The other constructors, D0/D2 and the thrower are not added.

PS5NES (PPSA99204) and PS5N64 (PPSA99206) are missing nothing else.

  • Both are built with the ps5-payload-dev SDK, so they relink only with the opt-in --trap-sdk-syscall-stubs (#3804, see #2136), which the runs below use.
  • On main 9aa5fd29 they stop here:
    • Linux: undefined symbol: lt0mLhNwjs0 (_ZTISt14overflow_error)
    • Windows: FAIL: unresolved ELF import XilOsTdCZuM (_ZNSt14overflow_errorD1Ev) from libSceLibcInternal.prx
  • With this PR, both load every import:
    • Linux: they run until the headless DisplayWindow.
    • Windows: they open their 1920x1080 Vulkan window and show the first loading frame (~1.1 s). Then the GPU rejects a DRAW_INDEX_AUTO/SET_SH_REG submission, a graphics stop that is not an import.
  • PS5SX2 (PPSA99203) imports the same three, but stops first at 0vTn5IDMU9A in libkernel.

Tested

Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs), Release. The new guest_overflow_error passes 5/5 (--repeat until-fail:5) on both, with no warnings in StandardExceptions.cpp or GuestOverflowError.cpp. It checks:

  • the type info's name, base and type-info vtable against runtime_error's
  • the vtable's type and its destroy/delete/what slots
  • that the destructor releases a message built by runtime_error's const char* constructor, and is safe to call twice

check_conventions.py and check_test_registration.py pass.

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 (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4828342514 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4426). Originally posted by [babyhuey](https://github.com/babyhuey) on 2026-10-12T10:51:08Z. --- ### What Exports `std::overflow_error`'s type info (`_ZTISt14overflow_error`, base `runtime_error`), vtable (`_ZTVSt14overflow_error`) and destructor (`_ZNSt14overflow_errorD1Ev`) from libc. They are built like `std::range_error` next to them, sharing the message destroy/delete/`what` slots. These are the three exports the titles import. The other constructors, `D0`/`D2` and the thrower are not added. PS5NES (PPSA99204) and PS5N64 (PPSA99206) are missing nothing else. - Both are built with the ps5-payload-dev SDK, so they relink only with the opt-in `--trap-sdk-syscall-stubs` (#3804, see #2136), which the runs below use. - On `main` 9aa5fd29 they stop here: - Linux: `undefined symbol: lt0mLhNwjs0 (_ZTISt14overflow_error)` - Windows: `FAIL: unresolved ELF import XilOsTdCZuM (_ZNSt14overflow_errorD1Ev) from libSceLibcInternal.prx` - With this PR, both load every import: - Linux: they run until the headless `DisplayWindow`. - Windows: they open their 1920x1080 Vulkan window and show the first loading frame (~1.1 s). Then the GPU rejects a `DRAW_INDEX_AUTO`/`SET_SH_REG` submission, a graphics stop that is not an import. - PS5SX2 (PPSA99203) imports the same three, but stops first at `0vTn5IDMU9A` in libkernel. ### Tested Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs), Release. The new `guest_overflow_error` passes 5/5 (`--repeat until-fail:5`) on both, with no warnings in `StandardExceptions.cpp` or `GuestOverflowError.cpp`. It checks: - the type info's name, base and type-info vtable against `runtime_error`'s - the vtable's type and its destroy/delete/`what` slots - that the destructor releases a message built by `runtime_error`'s `const char*` constructor, and is safe to call twice `check_conventions.py` and `check_test_registration.py` pass. ### 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/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 (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-12 10:53:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T10:53:38Z.


Progress report (c390d81 → d316fcd)

➖ System libraries: 86.26% (+0.0%, +1 implemented functions)

✅ 1 implemented
Library Name
libc _ZNSt14overflow_errorD1Ev_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6122828931 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4426#issuecomment-6122828931). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T10:53:38Z. --- <!-- progress-report --> ### Progress report (c390d81 → d316fcd) ➖ **System libraries**: 86.26% (+0.0%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libc | `_ZNSt14overflow_errorD1Ev_nid_postfix` | </details>
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!4426
No description provided.