feat(libSceLibcInternal): run the _Pad complete-object destructor #14666
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14666"
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 miguelcoxcaballero on 2026-11-01T16:59:01Z.
What
Implements
XyJPhPqpzMw(_ZNSt4_PadD1Ev) inlibSceLibcInternal, which threwNotImplemented._Padhas 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 existinglibcexport_ZNSt4_PadD2Ev, which unlocks and destroys the pad's mutex and condition and throws from a thread that does not hold the mutex. The stub and its stub entry are removed, and a debt entry records what is unverified: the console'slibSceLibcInternal.sprxwas not read and no title was seen calling it.The old stub name
sceLibcInternalUnknown6_081_XyJPhPqpzMw_nid_no_patchis retired intentionally. The replacement keeps the same NIDXyJPhPqpzMw; the ABI audit'sexport-removedwarning 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/mainpasses.guest_libc_internal_pad: after thelibcC2constructor, the destructor releases the mutex and condition and leaves the other members alone; a destroyed pad can be constructed again; destroying it twice and a null pad throw. It passes, together withguest_libc_threads,guest_libc_internal_aligned_new,guest_libc_internal_mtx,guest_init_onceandguest_locale.libSceLibcInternal.prxexports the NID once.Not tested on Windows, macOS or a PS5, nor with any title.
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)libSceLibcInternalbase-object PRs; the four branches merge together cleanly and build)Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:48:50Z.
Review: COMMENTED
Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (
Unblocks: noneis allowed), and it contained no code review.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T20:53:45Z.
Review: COMMENTED
Reviewed — no blocking findings
The change implements the complete-object destructor
_ZNSt4_PadD1Ev(NIDXyJPhPqpzMw) by calling the existing base-object destructor export. The NID matches the mangled name under the repo's own NID tool, and the new guest test passed in the hosted Windows CTest run at this head. 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
73c844be0bd73ec5580ef3b9558010804e98ff6a; basef2d874c1fdccf781c0fa5d86619bb5dd8894b958. 6 files, +76/-7:libSceLibcInternal/Pad.cpp(new),CMakeLists.txt,InventoryExports6.cpp(stub removed),include/Api.hpp,tests/GuestLibcInternalPad.cpp(new), anddocs/dev/debt/libSceLibcInternal.md.python3 -cwithtools/nid_names.pycompute_nid('_ZNSt4_PadD1Ev')returnsXyJPhPqpzMw, and_ZNSt4_PadD2EvreturnsgjLRZgfb3i0. The inventory cited in the debt entry lists_ZNSt4_PadD1Ev(6 matches in the fetched file)._ZNSt4_PadD2Ev_nid_postfixexists (core/libs/prx/libc/src/Threads.cppline 497) and is declared inlibc/include/Api.hppline 1116.Pad.cpp, the test'smain, the removed stub, and the debt diff.passed_with_warnings, 240 symbols; one finding,export-removed, forsceLibcInternalUnknown6_081_XyJPhPqpzMw_nid_no_patch. That is the stub replaced in this PR, and its NID is kept by the new export.guest_libc_internal_pad.Results
_ZNSt4_PadD1Evtools/nid_names.py:XyJPhPqpzMw_ZNSt4_PadD2Ev_nid_postfixexists inlibcguest_libc_internal_padpassed in the windows CTest runD2(unlock, destroy, throw)Threads.cppCommands and unedited precheck output
Commands:
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14666 --output-dir <scratch>/precheck/14666p(report.md in that directory).git fetch https://github.com/boykopovar/AnyPS5.git pull/14666/head.python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 73c844be0bd73ec5580ef3b9558010804e98ff6a --json.tools/nid_names.pycompute_nidon_ZNSt4_PadD1Evand_ZNSt4_PadD2Ev.gh api repos/boykopovar/AnyPS5/commits/73c844be0bd73ec5580ef3b9558010804e98ff6a/check-runs; the windows job's CTest summary shows100% tests passed, 0 tests failed out of 2595.Precheck table (unedited):
The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...73c844be0bd73ec5580ef3b9558010804e98ff6a/marc/DeusMachina_0x1914/.venv/bin/python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 73c844be0bd73ec5580ef3b9558010804e98ff6a --title feat(libSceLibcInternal): run the _Pad complete-object destructor --body /dev/shm/reviewer-run/precheck/14666p/pr-body.md/marc/DeusMachina_0x1914/.venv/bin/python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 73c844be0bd73ec5580ef3b9558010804e98ff6a --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./marc/DeusMachina_0x1914/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14666 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14666p/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./marc/DeusMachina_0x1914/.venv/bin/python3 /dev/shm/reviewer-run/precheck/14666p/head-73c844be0bd7-85c2e16f/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14666p/head-73c844be0bd7-85c2e16f --json core/libs/prx/libSceLibcInternal/CMakeLists.txt core/libs/prx/libSceLibcInternal/InventoryExports6.cpp core/libs/prx/libSceLibcInternal/Pad.cpp core/libs/prx/libSceLibcInternal/include/Api.hpp core/libs/tests/GuestLibcInternalPad.cpp docs/dev/debt/libSceLibcInternal.mdNo 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
export-removedwarning forsceLibcInternalUnknown6_081_XyJPhPqpzMw_nid_no_patchis expected for this change, since the NID is kept. Please say in the PR body that the stub name is retired on purpose.Sources
github.com/boykopovar/AnyPS5@73c844be0b/core/libs/prx/libSceLibcInternal/Pad.cppgithub.com/boykopovar/AnyPS5@73c844be0b/core/libs/tests/GuestLibcInternalPad.cppgithub.com/boykopovar/AnyPS5@73c844be0b/core/libs/prx/libc/src/Threads.cpp (L497)github.com/boykopovar/AnyPS5@73c844be0b/docs/dev/debt/libSceLibcInternal.mdNot verified
D2behaviour (unlock, destroy, throw) was not traced inThreads.cpp.libSceLibcInternalwas not read, as the debt entry itself says.To get this to a good state