feat(libSceLibcInternal): implement eight facet deleting destructors #24526
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24526"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by PostMalloy on 2026-11-20T18:50:59Z.
What
Eight deleting destructors (
D0) oflibSceLibcInternalfacets were inventory stubs inInventoryExports.cppthat threw throughNotImplemented_nid_no_patch:_ZNSt7collateIwED0Evig4VDIRc21QlibSceLibcInternalInventory_110_ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEED0Ev-1G1iE3KyGIlibSceLibcInternalInventory_116_ZNSt7num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEED0EvaHDdLa7jA1UlibSceLibcInternalInventory_124_ZNSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEED0EvaOK5ucXO-5glibSceLibcInternalInventory_131_ZNSt7num_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0EvjyXTVnmlJD4libSceLibcInternalInventory_136_ZNSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEED0Evb9QSruV4nnclibSceLibcInternalInventory_208_ZNSt9money_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEED0EvRB3ratfpZDclibSceLibcInternalInventory_212_ZNSt9money_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEED0Evs2zG12AYKTglibSceLibcInternalInventory_223The
D1andD2destructors of each of these facets are already empty exports: the debt entry "Empty facet and exception members" records them as the singleretof firmware 13.42'slibSceLibcInternal.sprx. Under the Itanium C++ ABI the deleting destructor is the complete-object destructor followed byoperator delete. So each stub now takesvoid* selfand only calls_ZdlPv, as the existingmoney_put<wchar_t>,messages<wchar_t>andcodecvt<wchar_t, char>D0exports inInventoryExports6.cppand thebad_exceptionD0from #24043 already do. The stubs keep their inventory names, so the change stays within their bodies and declarations.The debt fragment
feat-libcinternal-empty-facet-deleting-destructors.mdadds an entry for the eight exports under Additional callable exports. It is not named after the branch because #25556 already merged a fragment with that name for the other facetD0exports. The pending fragmentfeat-libc-internal-filebuf-lock.mdalready changes that section's "Additional callable exports" entry, andtools/debt_fold.pyrefuses a second change to it, so this PR edits that fragment instead: its list of implemented exports now reads "facet" in place of "empty facet", which keeps the entry under 1000 characters.The
time_put<char>D0(WQQlL0n2SpU), whoseD1is also empty, is left alone because #22528 removes that stub while constructing the time facets. The other stubbed facetD0exports (numpunct,moneypunct,_Mpunct,ctype<wchar_t>,basic_filebuf,time_get) are not included, because theirD1still throws and may free members; #25556 has since implemented themoneypunctand_Mpunctones. Of the 2280 open pull requests, nine changeInventoryExports.cpp,InventoryExports.hpp, the test file or the edited fragment; by their diffs (file patches from the GitHub API wheregh pr diffrefuses the size), none changes these eight stubs. #17300, which already conflicts withmain, edits neighbouring inventory stubs, so it shows them only as context.pr_overlap.py --namesdid not finish here: its fetch of 565 uncached heads stalled in git's connectivity check on this clone.Tested
Windows 11 x64 (10.0.26200), WinLibs MinGW-w64 GCC 15.2.0, Release.
guest_libc_internal_libc_forwards, newCheckFacetDeletingDestructors: for each of the eight exports, a 16-byteoperator newblock passed to the export is released exactly once, and it is that block, through the registered application heap.num_put<char>D0an empty body instead of_ZdlPvmakes the test fail at that export.guest_libc_internaltests pass after rebuilding them on currentmainwith this commit.tools/check_conventions.py --base origin/mainandtools/debt_fold.py --checkpass.tools/nid_names.pygives the NIDs in the table for the mangled names, and they are the NIDs these stubs export.No title was found calling these exports, and no PS5 hardware was used.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T19:03:34Z.
Review: COMMENTED
Reviewed — no blocking findings
The eight deleting destructor bodies consistently forward the object pointer to
_ZdlPv, and the added test checks that each releases the allocated object once; I could not run the reported checks in this review environment.What I ran
bf41ee3118a55bf9cf66f864f683b52a01499b03from the prepared diff; no repository diff was fetched.description.md,commits.md,manifest.json, anddiff.patch, plus the changed source around each destructor, the changed declarations, the test setup and assertions, and the new debt entry usingrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceLibcInternal/InventoryExports.cpp(changed destructor regions),core/libs/prx/libSceLibcInternal/include/InventoryExports.hpp(changed declarations),core/libs/tests/GuestLibcInternalLibcForwards.cpp(changed test and relevant setup), anddocs/dev/debt/changes/feat-libcinternal-facet-deleting-destructors.md.docs/dev/debt/changes/feat-libc-internal-filebuf-lock.md.To get this to a good state
Nothing is required. The author-reported checks are optional follow-up evidence; no repeat commands are required by this review.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T20:37:55Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
bf41ee3118:tools/check_conventions.pypassed.guest_libc_internal_libc_forwards_testsbuilt cleanly.guest_libc_internal_libc_forwards):core/libs/prx/libSceLibcInternal/InventoryExports.cpp,core/libs/prx/libSceLibcInternal/include/InventoryExports.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T23:18:36Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reported checks are author supplied, and the source inspection supports the destructor forwarding behavior.
What I ran
Reviewed head
85c74713af263a14228a6c8456d7756d59e746c2against the prepared diff. No commands or tests were run; source was read throughrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
selfpointer to_ZdlPv_nid_postfix; declarations use avoid(void*)signature, matching neighboring destructor exports.Not verified
core/libs/prx/libSceLibcInternal/InventoryExports.cpp,core/libs/prx/libSceLibcInternal/include/InventoryExports.hpp,core/libs/tests/GuestLibcInternalLibcForwards.cpp, anddocs/dev/debt/changes/feat-libcinternal-facet-deleting-destructors.md. No changed files were excluded.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T18:52:25Z.
Review: APPROVED
Reviewed — looks good
The reviewed change implements eight facet deleting destructors by forwarding each object to
operator delete; the inspected declarations and allocator-hook test are consistent with that behavior.What I ran
Reviewed head
28d79b215c7cdcd52a0dd2e59636a17d9b6bb23c. No commands or tests were run. The author reports Windows 11 x64 / MinGW GCC 15.2 Release test and convention checks; those results were not independently verified.Read
description.md,commits.md,manifest.json, and all ofdiff.patch. Read the changed filesInventoryExports.cpp(lines 390–435, 805–915),InventoryExports.hpp(85–125),GuestLibcInternalLibcForwards.cpp(1–35, 105–165, 300–322), and the new debt fragment (1–5). The excluded debt filedocs/dev/debt/changes/feat-libc-internal-filebuf-lock.mdwas not read.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author’s reported test and convention-check results were not independently run. Firmware destructor bodies and title use were not verified. The excluded debt file was not read.
To get this to a good state
Nothing is required.