feat(libSceLibcInternal): implement Dinkum thread errors #20059
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20059"
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 fogydes on 2026-11-14T14:17:23Z.
What
Implement the six Dinkumware thread error destructors and throw helpers that currently stop at NotImplemented.
lock_errorandthread_resource_errorretain their distinct guest RTTI, runtime_error base, messages, and 48-byte SDK string layout. Complete destructors release inline/heap/aligned message storage correctly; deleting destructors additionally use guest operator delete. Allocation failure frees exception storage before propagating.Behavior source: SDK 10.00
libc.prx,_Throw_lock_error0xc6d60,_Throw_resource_error0xc6e50, constructors 0xc6db0/0xc6ea0, D1 0xc6e40/0xc6f30, D0 0xc6fd0/0xc7090; RTTI relocations 0x18f7e0/0x18f7f8 and vtables 0x18f810/0x18f840. Read from disassembly, not measured on a console. The existing generic runtime_error exports use a different message layout; this PR keeps that separate gap documented.Tested
Latest merge verification (2026-11-15): preserved remote head 8af400b2db and its maintainer debt correction, then merged main
4c0998e1a8. Resolved only the shared CMake tail and inventory-header removals, retaining the merged collation registrations and current wide-ctype declarations. Dinkum implementation/header/test blobs remain unchanged. Fresh WinLibs Release build and all seven selected Dinkum, exception-neighbor and collation tests passed. Public-header and conventions audits passed. Earlier source/negative-control evidence below remains for the unchanged implementation.Based on main
3ffcba66e0. Windows 11 x64, WinLibs GCC 15.2.0 Release full-runtime configuration: guest_dinkum_thread_errors_tests built; all three Dinkum tests and three neighboring exception tests passed (6/6). Tests cover direct and vtable destruction of inline, heap and aligned strings, allocation ownership and guards, distinct-type and base-class catches, what(), no-op _Doraise, and allocation failure followed by recovery. Replacing all six bodies with main-equivalent throwing stubs rebuilt successfully and made all three new tests fail with the expected NotImplemented symbol messages; restoring the exact source and rebuilding returned 6/6 passing.tools/progress.py --module libSceLibcInternal: 435/1130 implemented before, 441/1130 after; TODO 695 -> 689. Export presence is unchanged: export_gap reports all six NIDs already provided as stubs on main. All six names match the pinned database and all six NIDs were verified in the patched PE export table. The full database audit reports four existing unrelated Bgft name/hash mismatches; none involve this slice. Public-header audit: 413 libraries, 34556 unique exports. Conventions and diff whitespace checks passed. No console, real-title, Linux or performance claim.Committed-branch overlap audit checked 1519 PRs and returned exit 2 for shared insertion points/adjacent stubs plus seven unmergeable PRs. Manually inspected the actual diffs and reverified heads for #19359, #19434, #19602, #19609, #13778, #13782, #14834, #15822, #17300, #17836 and #18135: no changed Dinkum thread-error callable or NID, no semantic dependency. The earlier name audit checked all 1543 then-open PRs and found none implementing these six exports. Future merges must retain independent registrations and neighboring implementations.
The current update stores the same source limitation in a debt fragment and preserves the canonical debt file from main, following the current contribution rules.
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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T14:45:38Z.
Review: COMMENTED
Reviewed — no blocking findings
The implementation and its changed test coverage are sound based on the inspected source; author-reported checks were not run independently in this review.
What I ran
Reviewed head
aae1a958cdd12305b07b35402f56833fda5913df. No commands or tests were run in this review. Readdescription.md,commits.md,manifest.json,diff.patch, and all changed repository files listed as reviewed in the manifest. No changed files were excluded.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports Windows 11 x64 / WinLibs GCC 15.2.0 tests, a negative control, export checks, and whitespace checks; these results were not reproduced in this review. Console behavior and SDK versions newer than 10.00 remain unverified as documented in the changed debt note.
To get this to a good state
Nothing is required.
Continued review (pass 2)
The two added documentation lines accurately record the stated SDK 10.00 basis and the limitation around generic
runtime_erroroperations; this continuation pass covers only those lines.What I ran
Read
docs/dev/debt/libSceLibcInternal.mdlines 295–325, the changed Dinkum thread error implementation, and the relevant diff context. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
This pass did not review the rest of the pull request or independently verify the SDK disassembly facts documented in these lines. The implementation source was read for context; no other repository files were read.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T20:03:35Z.
Review: APPROVED
Reviewed — looks good
The reviewed change is sound at head
8af400b2db922c99212d94cb83228148dd6aea21; inspected code and the author’s reported checks support merging, with console and later SDK behavior explicitly unverified.What I ran
No commands or tests were run in this review environment. The author reports a Windows 11 x64, WinLibs GCC 15.2.0 Release build and six passing tests; those results were not independently run here.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Console behavior, SDK versions newer than 10.00, and the author-reported build and test results were not independently verified.
files.jsonwas not available in the prepared review folder; the manifest and README identify eight changed files, all included, and all added lines were read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T20:49:21Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
8af400b2db:tools/check_conventions.pypassed;git diff --checkclean.guest_dinkum_thread_errors_testsbuilt cleanly.guest_dinkum_thread_errors_destructors,guest_dinkum_thread_errors_throws,guest_dinkum_thread_errors_allocation_failure):core/libs/prx/libSceLibcInternal/InventoryExports2.cpp,core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp,core/libs/prx/libSceLibcInternal/libSceLibcInternal.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-15T08:16:15Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected implementation and tests show no verified blocking defect; checks were not run for this review, so a formal approval is not justified.
What I ran
Read the prepared diff and targeted files at head
05bd4f864e9fcf437734133e9aa31dd000acb12d; no commands or tests were run. The description reports Windows build and test results, which I did not independently verify.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Console behavior, SDK versions newer than 10.00, and the reported build, tests, audits, and negative control were not independently verified. Read all eight changed files listed in the manifest; no changed files were excluded.
To get this to a good state
Nothing is required.