feat(libSceLibcInternal): run the ios_base deleting destructor #14836

Merged
miguelcoxcaballero merged 3 commits from upstream-pr/14836 into main 2026-11-07 11:50:51 +00:00
miguelcoxcaballero commented 2026-11-01 19:18:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by miguelcoxcaballero on 2026-11-01T19:18:13Z.


What

Implements I5jcbATyIWo (_ZNSt8ios_baseD0Ev) in libSceLibcInternal, which threw NotImplemented.

It is the deleting destructor of ios_base. Under the Itanium C++ ABI that is the complete-object destructor followed by the class's operator delete, and ios_base declares none of its own. So the export runs the existing libc export _ZNSt8ios_baseD2Ev (the same work as D1, with its limits: it throws for stream storage, callbacks or a locale other than the classic one) and then _ZdlPv, which frees on the application heap that operator new allocates from. The stub, its declaration and its table row 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.

This builds on #14664, which adds the complete-object destructor in the same file.

Tested

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

  • tools/check_conventions.py --base origin/main passes.
  • guest_libc_internal_ios_base is extended with a recording application heap: the deleting destructor frees a heap-allocated stream once through operator delete and throws for a null stream. It passes, together with guest_libc_internal_aligned_new, guest_libc_internal_mtx, guest_init_once, guest_locale and guest_libc_threads.
  • The patched libSceLibcInternal.prx exports I5jcbATyIWo and the D1 NID X9D8WWSG3As once each.
  • This branch merges cleanly with my other open libSceLibcInternal branches (#14659, #14660, #14664, #14666) and the merged tree builds and passes their tests.

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: #14664 (this PR shows its commits until it is merged)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5110689056 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14836). Originally posted by [miguelcoxcaballero](https://github.com/miguelcoxcaballero) on 2026-11-01T19:18:13Z. --- ### What Implements `I5jcbATyIWo` (`_ZNSt8ios_baseD0Ev`) in `libSceLibcInternal`, which threw `NotImplemented`. It is the deleting destructor of `ios_base`. Under the [Itanium C++ ABI](https://itanium-cxx-abi.github.io/cxx-abi/abi.html#definitions) that is the complete-object destructor followed by the class's `operator delete`, and `ios_base` declares none of its own. So the export runs the existing `libc` export `_ZNSt8ios_baseD2Ev` (the same work as `D1`, with its limits: it throws for stream storage, callbacks or a locale other than the classic one) and then `_ZdlPv`, which frees on the application heap that `operator new` allocates from. The stub, its declaration and its table row 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. This builds on #14664, which adds the complete-object destructor in the same file. ### Tested Ubuntu 24.04, GCC 13.3, Release, `BUILD_TESTING=ON`, full build: - `tools/check_conventions.py --base origin/main` passes. - `guest_libc_internal_ios_base` is extended with a recording application heap: the deleting destructor frees a heap-allocated stream once through `operator delete` and throws for a null stream. It passes, together with `guest_libc_internal_aligned_new`, `guest_libc_internal_mtx`, `guest_init_once`, `guest_locale` and `guest_libc_threads`. - The patched `libSceLibcInternal.prx` exports `I5jcbATyIWo` and the `D1` NID `X9D8WWSG3As` once each. - This branch merges cleanly with my other open `libSceLibcInternal` branches (#14659, #14660, #14664, #14666) and the merged tree builds and passes their tests. 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: #14664 (this PR shows its commits until it is merged) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-01 19:25:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T19:25:42Z.

Review: COMMENTED


Reviewed — no blocking findings

I reviewed all eight changed files at head 9f6eaa2597c3f2ee43d9008b245ca15e35d13dd8 and found no source-level blocker; approval is withheld while the hosted Windows job is pending.

What I ran

The PR is based on f2d874c1fdccf781c0fa5d86619bb5dd8894b958 and declares dependency #14664. The stack check confirms #14664’s exact head is included and both preview cleanly against current main (e0caf1360035286bd22b9f2a3030e97b880ffb28). Environment: Linux x86_64, Debian 12, Python 3.11.2, Git 2.39.5. I did not build or compile.

git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...9f6eaa2597c3f2ee43d9008b245ca15e35d13dd8
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14836
python3 tools/pr_stack_check.py 14836 --repo boykopovar/AnyPS5
gh pr checks 14836 --repo boykopovar/AnyPS5
# Read all eight changed files and inspect the current PR head, description, reviews and checks.

Results

Check Result Note
Diff whitespace passed No whitespace errors
Conventions and template passed Local and hosted checks passed
Dependency and merge previews passed #14664 included; both clean
Hosted Windows build not run Pending at review time
Hosted Linux and specialized jobs not run Skipped by workflow
C++ test not run No local build
ABI and test-quality helpers not run Helper scripts absent from isolated PR snapshot
Unedited output excerpts
# PR precheck report
diff_check | passed
conventions_and_pr_template | passed
live_dependency_and_mergeability_check | passed
changed_export_abi_audit | failed
build_dependent_cpp_tests | not_applicable
test_quality_heuristics | failed
# PR stack report
Dependency order: #14664 → #14836
PR #14664: clean against current base
PR #14836: clean against current base
#14664 → #14836: head_included
windows pending
linux skipping
register-context skipping
relinker skipping
relinker-asan skipping
write-watch skipping
conventions pass
eligibility pass
intake pass
labels pass
library-portability pass
report pass

Negative control

Not run. I did not mutate the destructor or allocator call to test whether the new C++ test detects an incorrect destruction/free sequence.

Findings

Blocking

None found in the eight changed files. The implementation dispatches the complete-object destructor through the existing ios_base destructor and then the application-heap delete export; the new test is registered in CMake and checks the freed pointer and null-stream paths.

Non-blocking

The PR reports a full Ubuntu 24.04/GCC 13.3 build and focused tests passing; I did not independently rerun them. The hosted Windows job is still pending, so this review does not approve the change yet.

Sources

Not verified

No local build, C++ test, Windows/macOS run, PS5 run or title compatibility test was performed. Hosted Windows remained pending; Linux and specialized jobs were skipped. The author-reported build and tests were read from the PR description only.

To get this to a good state

No source change is requested. Once the hosted Windows job completes, I will recheck the exact head and required checks before deciding whether approval is appropriate.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729841717 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14836#pullrequestreview-5729841717). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T19:25:42Z. **Review:** COMMENTED --- # Reviewed — no blocking findings I reviewed all eight changed files at head `9f6eaa2597c3f2ee43d9008b245ca15e35d13dd8` and found no source-level blocker; approval is withheld while the hosted Windows job is pending. ## What I ran The PR is based on `f2d874c1fdccf781c0fa5d86619bb5dd8894b958` and declares dependency #14664. The stack check confirms #14664’s exact head is included and both preview cleanly against current `main` (`e0caf1360035286bd22b9f2a3030e97b880ffb28`). Environment: Linux x86_64, Debian 12, Python 3.11.2, Git 2.39.5. I did not build or compile. ```sh git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...9f6eaa2597c3f2ee43d9008b245ca15e35d13dd8 python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14836 python3 tools/pr_stack_check.py 14836 --repo boykopovar/AnyPS5 gh pr checks 14836 --repo boykopovar/AnyPS5 # Read all eight changed files and inspect the current PR head, description, reviews and checks. ``` ## Results | Check | Result | Note | |---|---|---| | Diff whitespace | passed | No whitespace errors | | Conventions and template | passed | Local and hosted checks passed | | Dependency and merge previews | passed | #14664 included; both clean | | Hosted Windows build | not run | Pending at review time | | Hosted Linux and specialized jobs | not run | Skipped by workflow | | C++ test | not run | No local build | | ABI and test-quality helpers | not run | Helper scripts absent from isolated PR snapshot | <details><summary>Unedited output excerpts</summary> ```text # PR precheck report diff_check | passed conventions_and_pr_template | passed live_dependency_and_mergeability_check | passed changed_export_abi_audit | failed build_dependent_cpp_tests | not_applicable test_quality_heuristics | failed ``` ```text # PR stack report Dependency order: #14664 → #14836 PR #14664: clean against current base PR #14836: clean against current base #14664 → #14836: head_included ``` ```text windows pending linux skipping register-context skipping relinker skipping relinker-asan skipping write-watch skipping conventions pass eligibility pass intake pass labels pass library-portability pass report pass ``` </details> ## Negative control Not run. I did not mutate the destructor or allocator call to test whether the new C++ test detects an incorrect destruction/free sequence. ## Findings ### Blocking None found in the eight changed files. The implementation dispatches the complete-object destructor through the existing `ios_base` destructor and then the application-heap delete export; the new test is registered in CMake and checks the freed pointer and null-stream paths. ### Non-blocking The PR reports a full Ubuntu 24.04/GCC 13.3 build and focused tests passing; I did not independently rerun them. The hosted Windows job is still pending, so this review does not approve the change yet. ## Sources - [Deleting and complete-object destructor implementations at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/9f6eaa2597c3f2ee43d9008b245ca15e35d13dd8/core/libs/prx/libSceLibcInternal/IosBase.cpp) - [CMake test registration at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/9f6eaa2597c3f2ee43d9008b245ca15e35d13dd8/core/libs/prx/libSceLibcInternal/CMakeLists.txt) ## Not verified No local build, C++ test, Windows/macOS run, PS5 run or title compatibility test was performed. Hosted Windows remained pending; Linux and specialized jobs were skipped. The author-reported build and tests were read from the PR description only. ## To get this to a good state No source change is requested. Once the hosted Windows job completes, I will recheck the exact head and required checks before deciding whether approval is appropriate.
MarcZX10 commented 2026-11-01 19:38:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T19:38:56Z.

Review: APPROVED


Re-checked — Windows CI passed, approved

The exact head is unchanged, its hosted Windows build and test job passed, and my earlier full source review found no blocker.

What I ran

Rechecked head 9f6eaa2597c3f2ee43d9008b245ca15e35d13dd8 against base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 using GitHub’s live PR and check state. Environment: Debian 12 x86_64; no local build or compiler run.

gh api repos/boykopovar/AnyPS5/pulls/14836 --jq '{state:.state,head:.head.sha,base:.base.sha}'
gh pr checks 14836 --repo boykopovar/AnyPS5

Results

Check Result Note
Hosted Windows build and tests passed Completed on the reviewed head.
Conventions, labels, report and portability passed Hosted checks completed successfully.
Linux and specialized jobs not applicable Skipped by workflow.
Local build or C++ tests not run No local compilation in this follow-up.
Captured hosted-check output
windows	pass	9m23s	https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950969379
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950970116
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950970562
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950970877
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950970385
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950970135
conventions	pass	14s	https://github.com/boykopovar/AnyPS5/actions/runs/41341050528/job/124950936458
eligibility	pass	4s	https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950942922
intake	pass	21s	https://github.com/boykopovar/AnyPS5/actions/runs/41341050547/job/124950936726
labels	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/41341050542/job/124950937228
library-portability	pass	1m22s	https://github.com/boykopovar/AnyPS5/actions/runs/41341052627/job/124950942379
report	pass	48s	https://github.com/boykopovar/AnyPS5/actions/runs/41341052604/job/124950942555

Findings

Blocking

None found in the previously reviewed source.

Non-blocking

The author-reported Linux build and focused tests were not independently rerun here.

Sources

Not verified

No local build, C++ test execution, Linux/macOS test, PS5 run or title compatibility test was performed in this follow-up. Linux and specialized hosted jobs were skipped.

To get this to a good state

No further action is needed for the reviewed head. If it changes, I will review the new head and its checks.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729884857 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14836#pullrequestreview-5729884857). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T19:38:56Z. **Review:** APPROVED --- # Re-checked — Windows CI passed, approved The exact head is unchanged, its hosted Windows build and test job passed, and my earlier full source review found no blocker. ## What I ran Rechecked head `9f6eaa2597c3f2ee43d9008b245ca15e35d13dd8` against base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958` using GitHub’s live PR and check state. Environment: Debian 12 x86_64; no local build or compiler run. ```sh gh api repos/boykopovar/AnyPS5/pulls/14836 --jq '{state:.state,head:.head.sha,base:.base.sha}' gh pr checks 14836 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Hosted Windows build and tests | passed | Completed on the reviewed head. | | Conventions, labels, report and portability | passed | Hosted checks completed successfully. | | Linux and specialized jobs | not applicable | Skipped by workflow. | | Local build or C++ tests | not run | No local compilation in this follow-up. | <details><summary>Captured hosted-check output</summary> ```text windows pass 9m23s https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950969379 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950970116 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950970562 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950970877 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950970385 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950970135 conventions pass 14s https://github.com/boykopovar/AnyPS5/actions/runs/41341050528/job/124950936458 eligibility pass 4s https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950942922 intake pass 21s https://github.com/boykopovar/AnyPS5/actions/runs/41341050547/job/124950936726 labels pass 6s https://github.com/boykopovar/AnyPS5/actions/runs/41341050542/job/124950937228 library-portability pass 1m22s https://github.com/boykopovar/AnyPS5/actions/runs/41341052627/job/124950942379 report pass 48s https://github.com/boykopovar/AnyPS5/actions/runs/41341052604/job/124950942555 ``` </details> ## Findings ### Blocking None found in the previously reviewed source. ### Non-blocking The author-reported Linux build and focused tests were not independently rerun here. ## Sources - [Reviewed implementation and test registration at this exact head](https://github.com/boykopovar/AnyPS5/tree/9f6eaa2597c3f2ee43d9008b245ca15e35d13dd8/core/libs/prx/libSceLibcInternal) - [Hosted Windows job for this head](https://github.com/boykopovar/AnyPS5/actions/runs/41341052632/job/124950969379) ## Not verified No local build, C++ test execution, Linux/macOS test, PS5 run or title compatibility test was performed in this follow-up. Linux and specialized hosted jobs were skipped. ## To get this to a good state No further action is needed for the reviewed head. If it changes, I will review the new head and its checks.
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!14836
No description provided.