feat(libSceLibcInternal): run the ios_base complete-object destructor #14664

Merged
miguelcoxcaballero merged 3 commits from upstream-pr/14664 into main 2026-11-06 23:53:24 +00:00
miguelcoxcaballero commented 2026-11-01 16:58:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by miguelcoxcaballero on 2026-11-01T16:58:40Z.


What

Implements X9D8WWSG3As (_ZNSt8ios_baseD1Ev) in libSceLibcInternal, which threw NotImplemented.

ios_base has no virtual bases, so under the Itanium C++ ABI its complete-object destructor (D1) does the same work as the base-object one (D2). The export runs the existing libc export _ZNSt8ios_baseD2Ev and keeps its limits: it throws for stream storage, callbacks or a locale other than the classic one. The stub and its stub entry are removed, and a debt entry records what is unverified: the console's libSceLibcInternal.sprx was not read and no title was seen calling it.

The old stub name sceLibcInternalUnknown6_084_X9D8WWSG3As_nid_no_patch is retired intentionally. The replacement keeps the same NID X9D8WWSG3As; the ABI audit's export-removed warning refers to the old C symbol, not a removed guest export.

Tested

Ubuntu 24.04, GCC, Release, BUILD_TESTING=ON, full build:

  • tools/check_conventions.py --base origin/main passes.
  • New guest_libc_internal_ios_base: the destructor releases the classic locale without writing outside the stream, leaves the stream as the libc D2 does, and throws for a null stream. It passes, together with guest_locale, guest_libc_internal_aligned_new, guest_libc_internal_mtx, guest_init_once and guest_libc_threads.
  • The patched libSceLibcInternal.prx exports the NID once.

Not tested on Windows, macOS or a PS5, nor with any title.

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 under Silent stubs in their library's technical debt file
  • 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 (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none (neighbouring lines of the same files as my three other libSceLibcInternal base-object PRs; the four branches merge together cleanly and build)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5109538895 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14664). Originally posted by [miguelcoxcaballero](https://github.com/miguelcoxcaballero) on 2026-11-01T16:58:40Z. --- ### What Implements `X9D8WWSG3As` (`_ZNSt8ios_baseD1Ev`) in `libSceLibcInternal`, which threw `NotImplemented`. `ios_base` has no virtual bases, so under the [Itanium C++ ABI](https://itanium-cxx-abi.github.io/cxx-abi/abi.html#definitions) its complete-object destructor (`D1`) does the same work as the base-object one (`D2`). The export runs the existing `libc` export `_ZNSt8ios_baseD2Ev` and keeps its limits: it throws for stream storage, callbacks or a locale other than the classic one. The stub and its stub entry are removed, and a debt entry records what is unverified: the console's `libSceLibcInternal.sprx` was not read and no title was seen calling it. The old stub name `sceLibcInternalUnknown6_084_X9D8WWSG3As_nid_no_patch` is retired intentionally. The replacement keeps the same NID `X9D8WWSG3As`; the ABI audit's `export-removed` warning refers to the old C symbol, not a removed guest export. ### Tested Ubuntu 24.04, GCC, Release, `BUILD_TESTING=ON`, full build: - `tools/check_conventions.py --base origin/main` passes. - New `guest_libc_internal_ios_base`: the destructor releases the classic locale without writing outside the stream, leaves the stream as the `libc` `D2` does, and throws for a null stream. It passes, together with `guest_locale`, `guest_libc_internal_aligned_new`, `guest_libc_internal_mtx`, `guest_init_once` and `guest_libc_threads`. - The patched `libSceLibcInternal.prx` exports the NID once. Not tested on Windows, macOS or a PS5, nor with any title. ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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 (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none (neighbouring lines of the same files as my three other `libSceLibcInternal` base-object PRs; the four branches merge together cleanly and build) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
CnRJay commented 2026-11-01 19:48:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:48:49Z.

Review: COMMENTED


Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (Unblocks: none is allowed), and it contained no code review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729920276 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14664#pullrequestreview-5729920276). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:48:49Z. **Review:** COMMENTED --- Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (`Unblocks: none` is allowed), and it contained no code review.
MarcZX10 commented 2026-11-01 21:19:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T21:19:59Z.

Review: COMMENTED


Reviewed — no blocking findings

The change implements _ZNSt8ios_baseD1Ev (NID X9D8WWSG3As) by calling the existing base-object destructor export, the same pattern as the _Pad destructor in the libc work. The NID matches under the repo's tool, the base-object export exists, and its checks match the limits in the debt entry. The new guest test passed in the hosted Windows CTest run at this head (2595 of 2595 cases, including guest_libc_internal_ios_base). The ABI audit reports one removed export, the old stub name, which keeps the same NID. Approval waits for the macOS relinker jobs, which were queued at review time.

What I ran

  • Head 09abe24e53efd61ef8438b996ec302da69889dbf; base f2d874c1fdccf781c0fa5d86619bb5dd8894b958. 6 files, +90/-7: IosBase.cpp (new), CMakeLists.txt, InventoryExports6.cpp (stub removed), include/Api.hpp, tests/GuestLibcInternalIosBase.cpp (new) and docs/dev/debt/libSceLibcInternal.md.
  • NID: tools/nid_names.py compute_nid('_ZNSt8ios_baseD1Ev') returns X9D8WWSG3As, the NID in the new export and the one the removed stub used.
  • Base-object export: _ZNSt8ios_baseD2Ev_nid_postfix exists in core/libs/prx/libc/src/LocaleSupport.cpp (line 648). Its body throws for a null object, for stream storage or callbacks, and for a locale other than the classic one, which matches the debt entry. It clears locale and touches nothing else.
  • Type check: IosBase::locale is Implementation** (libc/include/GuestLocale.hpp line 112), so the comparison with &_ZSt21_sceLibcClassicLocale_nid_postfix is between compatible types.
  • Test: the guest test checks that the classic locale is released, that only the stream is written, that copies match, and that a null stream is rejected (lines 43-57).
  • Manual ABI audit: passed_with_warnings, 240 symbols; one export-removed finding for sceLibcInternalUnknown6_084_X9D8WWSG3As_nid_no_patch, the stub replaced here with the same NID.
  • Precheck: diff check, conventions and PR template, and the live stack check passed; the ABI audit row failed on a missing helper (the manual run above replaces it).
  • Hosted: the windows CTest run passed 2595 of 2595 cases, including guest_libc_internal_ios_base (Test #2288).
  • No MarcZX10 review at this head.

Results

Check Result Note
Diff check passed
Conventions and PR template passed precheck and hosted conventions passed
Mergeability and dependencies passed depends on none; the live stack check passed
NID X9D8WWSG3As for _ZNSt8ios_baseD1Ev passed computed with tools/nid_names.py
Base-object export it calls passed LocaleSupport.cpp line 648
Behaviour and limits of the D2 body passed matches the debt entry's limits
locale pointer type passed Implementation** matches the comparison
New guest test (hosted) passed guest_libc_internal_ios_base in the windows CTest run
Removed stub and NID passed same NID; ABI audit warning expected
Console behaviour not verified the debt entry says the console library was not read
Build and runtime tests (Linux) not run the hosted windows run covers the test; no local build
Negative controls not run no local build
Hosted CI not complete windows passed; macOS relinker jobs queued; linux, register-context and write-watch skipped
Commands and unedited precheck output

Commands:

  • Precheck: python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14664 --output-dir <scratch>/precheck/14664p (report.md in that directory).
  • Head fetched by URL (objects only): git fetch https://github.com/boykopovar/AnyPS5.git pull/14664/head.
  • Manual ABI run: python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 09abe24e53efd61ef8438b996ec302da69889dbf --json.
  • NID check: tools/nid_names.py compute_nid on _ZNSt8ios_baseD1Ev and _ZNSt8ios_baseD2Ev.
  • Hosted checks: gh api repos/boykopovar/AnyPS5/commits/09abe24e53efd61ef8438b996ec302da69889dbf/check-runs; Windows CTest: 100% tests passed, 0 tests failed out of 2595.

Precheck table (unedited):

Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...09abe24e53efd61ef8438b996ec302da69889dbf
conventions_and_pr_template passed /marc/DeusMachina_0x1914/.venv/bin/python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 09abe24e53efd61ef8438b996ec302da69889dbf --title feat(libSceLibcInternal): run the ios_base complete-object destructor --body /dev/shm/reviewer-run/precheck/14664p/pr-body.md
changed_export_abi_audit failed /marc/DeusMachina_0x1914/.venv/bin/python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 09abe24e53efd61ef8438b996ec302da69889dbf --json
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration not_applicable No changed test_*.py files.
live_dependency_and_mergeability_check passed /marc/DeusMachina_0x1914/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14664 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14664p/stack
build_dependent_cpp_tests not_applicable Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.
test_quality_heuristics failed /marc/DeusMachina_0x1914/.venv/bin/python3 /dev/shm/reviewer-run/precheck/14664p/head-09abe24e53ef-483f7f99/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14664p/head-09abe24e53ef-483f7f99 --json core/libs/prx/libSceLibcInternal/CMakeLists.txt core/libs/prx/libSceLibcInternal/InventoryExports6.cpp core/libs/prx/libSceLibcInternal/IosBase.cpp core/libs/prx/libSceLibcInternal/include/Api.hpp core/libs/tests/GuestLibcInternalIosBase.cpp docs/dev/debt/libSceLibcInternal.md
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build base-source control.

Negative control

Not run here. The test needs a build of the Linux host.

Findings

Blocking

None.

Non-blocking

  • The ABI audit's export-removed warning for sceLibcInternalUnknown6_084_X9D8WWSG3As_nid_no_patch is expected, since the NID is kept. Please say in the PR body that the stub name is retired on purpose.

Sources

Not verified

  • The console's libSceLibcInternal was not read, as the debt entry itself says.
  • The macOS relinker jobs had not finished at review time.

To get this to a good state

  • Nothing blocking. Approval waits for the macOS relinker jobs on this head. The optional note in the PR body is above.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5730324283 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14664#pullrequestreview-5730324283). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T21:19:59Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The change implements `_ZNSt8ios_baseD1Ev` (NID `X9D8WWSG3As`) by calling the existing base-object destructor export, the same pattern as the `_Pad` destructor in the libc work. The NID matches under the repo's tool, the base-object export exists, and its checks match the limits in the debt entry. The new guest test passed in the hosted Windows CTest run at this head (2595 of 2595 cases, including `guest_libc_internal_ios_base`). The ABI audit reports one removed export, the old stub name, which keeps the same NID. Approval waits for the macOS relinker jobs, which were queued at review time. ## What I ran - Head `09abe24e53efd61ef8438b996ec302da69889dbf`; base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`. 6 files, +90/-7: `IosBase.cpp` (new), `CMakeLists.txt`, `InventoryExports6.cpp` (stub removed), `include/Api.hpp`, `tests/GuestLibcInternalIosBase.cpp` (new) and `docs/dev/debt/libSceLibcInternal.md`. - NID: `tools/nid_names.py` `compute_nid('_ZNSt8ios_baseD1Ev')` returns `X9D8WWSG3As`, the NID in the new export and the one the removed stub used. - Base-object export: `_ZNSt8ios_baseD2Ev_nid_postfix` exists in `core/libs/prx/libc/src/LocaleSupport.cpp` (line 648). Its body throws for a null object, for stream storage or callbacks, and for a locale other than the classic one, which matches the debt entry. It clears `locale` and touches nothing else. - Type check: `IosBase::locale` is `Implementation**` (`libc/include/GuestLocale.hpp` line 112), so the comparison with `&_ZSt21_sceLibcClassicLocale_nid_postfix` is between compatible types. - Test: the guest test checks that the classic locale is released, that only the stream is written, that copies match, and that a null stream is rejected (lines 43-57). - Manual ABI audit: `passed_with_warnings`, 240 symbols; one `export-removed` finding for `sceLibcInternalUnknown6_084_X9D8WWSG3As_nid_no_patch`, the stub replaced here with the same NID. - Precheck: diff check, conventions and PR template, and the live stack check passed; the ABI audit row failed on a missing helper (the manual run above replaces it). - Hosted: the windows CTest run passed 2595 of 2595 cases, including `guest_libc_internal_ios_base` (Test #2288). - No MarcZX10 review at this head. ## Results | Check | Result | Note | | --- | --- | --- | | Diff check | passed | | | Conventions and PR template | passed | precheck and hosted conventions passed | | Mergeability and dependencies | passed | depends on none; the live stack check passed | | NID `X9D8WWSG3As` for `_ZNSt8ios_baseD1Ev` | passed | computed with `tools/nid_names.py` | | Base-object export it calls | passed | `LocaleSupport.cpp` line 648 | | Behaviour and limits of the D2 body | passed | matches the debt entry's limits | | `locale` pointer type | passed | `Implementation**` matches the comparison | | New guest test (hosted) | passed | `guest_libc_internal_ios_base` in the windows CTest run | | Removed stub and NID | passed | same NID; ABI audit warning expected | | Console behaviour | not verified | the debt entry says the console library was not read | | Build and runtime tests (Linux) | not run | the hosted windows run covers the test; no local build | | Negative controls | not run | no local build | | Hosted CI | not complete | windows passed; macOS relinker jobs queued; linux, register-context and write-watch skipped | <details><summary>Commands and unedited precheck output</summary> Commands: - Precheck: `python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14664 --output-dir <scratch>/precheck/14664p` (report.md in that directory). - Head fetched by URL (objects only): `git fetch https://github.com/boykopovar/AnyPS5.git pull/14664/head`. - Manual ABI run: `python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 09abe24e53efd61ef8438b996ec302da69889dbf --json`. - NID check: `tools/nid_names.py` `compute_nid` on `_ZNSt8ios_baseD1Ev` and `_ZNSt8ios_baseD2Ev`. - Hosted checks: `gh api repos/boykopovar/AnyPS5/commits/09abe24e53efd61ef8438b996ec302da69889dbf/check-runs`; Windows CTest: `100% tests passed, 0 tests failed out of 2595`. Precheck table (unedited): | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...09abe24e53efd61ef8438b996ec302da69889dbf` | | conventions_and_pr_template | passed | `/marc/DeusMachina_0x1914/.venv/bin/python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 09abe24e53efd61ef8438b996ec302da69889dbf --title feat(libSceLibcInternal): run the ios_base complete-object destructor --body /dev/shm/reviewer-run/precheck/14664p/pr-body.md` | | changed_export_abi_audit | failed | `/marc/DeusMachina_0x1914/.venv/bin/python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 09abe24e53efd61ef8438b996ec302da69889dbf --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/marc/DeusMachina_0x1914/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14664 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14664p/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/marc/DeusMachina_0x1914/.venv/bin/python3 /dev/shm/reviewer-run/precheck/14664p/head-09abe24e53ef-483f7f99/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14664p/head-09abe24e53ef-483f7f99 --json core/libs/prx/libSceLibcInternal/CMakeLists.txt core/libs/prx/libSceLibcInternal/InventoryExports6.cpp core/libs/prx/libSceLibcInternal/IosBase.cpp core/libs/prx/libSceLibcInternal/include/Api.hpp core/libs/tests/GuestLibcInternalIosBase.cpp docs/dev/debt/libSceLibcInternal.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | </details> ## Negative control Not run here. The test needs a build of the Linux host. ## Findings **Blocking** None. **Non-blocking** - The ABI audit's `export-removed` warning for `sceLibcInternalUnknown6_084_X9D8WWSG3As_nid_no_patch` is expected, since the NID is kept. Please say in the PR body that the stub name is retired on purpose. ## Sources - New export: https://github.com/boykopovar/AnyPS5/blob/09abe24e53efd61ef8438b996ec302da69889dbf/core/libs/prx/libSceLibcInternal/IosBase.cpp - New test: https://github.com/boykopovar/AnyPS5/blob/09abe24e53efd61ef8438b996ec302da69889dbf/core/libs/tests/GuestLibcInternalIosBase.cpp - Base-object export: https://github.com/boykopovar/AnyPS5/blob/09abe24e53efd61ef8438b996ec302da69889dbf/core/libs/prx/libc/src/LocaleSupport.cpp#L648-L658 - Debt entry: https://github.com/boykopovar/AnyPS5/blob/09abe24e53efd61ef8438b996ec302da69889dbf/docs/dev/debt/libSceLibcInternal.md ## Not verified - The console's `libSceLibcInternal` was not read, as the debt entry itself says. - The macOS relinker jobs had not finished at review time. ## To get this to a good state - Nothing blocking. Approval waits for the macOS relinker jobs on this head. The optional note in the PR body is above.
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!14664
No description provided.