feat(libSceLibcInternal): raise wide basic_string _Xlen/_Xran and ios_base::failure::_Doraise #19359
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19359"
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 B-Howell on 2026-11-13T05:54:03Z.
What
Implements three exports that threw:
std::wstring::_Xlenandstd::wstring::_Xran(_ZNKSbIwSt11char_traitsIwESaIwEE5_XlenEv,..._XranEv) forward to the existing narrow_ZNKSs5_XlenEvand_ZNKSs5_XranEv, so they throwlength_error("string too long")andout_of_range("invalid string position"). The widebasic_stringmembers inBasicString.cppnow call the wide reporters instead of the narrow ones. The two declarations move fromInventoryExports2to typed prototypes inlibSceLibcInternal/include/Api.hpp.ios_base::failure::_Doraise(_ZNKSt8ios_base7failure8_DoraiseEv) throws a copy of the failure, with its message and error code, through the existingios_base::failuretable, next to the versionedios_base::_Throwinlibc/src/exception/StandardExceptions.cpp. A null object throwsstd::invalid_argument. TheExport.cppstub and its pending declaration are removed.docs/dev/debt/libSceLibcInternal.md.Tested
Ubuntu WSL2, GCC 11, Release, Ninja, on
18ff848e1bf(main04202b49a5f)._DoraisethrowingNotImplemented_nid_no_patch,guest_libc_internal_basic_stringfails:Subprocess aborted,_ZNKSbIwSt11char_traitsIwESaIwEE5_XranEv_nid_postfix not implemented._Doraisethrowing, it fails:Subprocess aborted,_ZNKSt8ios_base7failure8_DoraiseEv_nid_postfix not implemented.guest_libc_internal_basic_stringpasses 3/3. It checks that the wide_Xranand_Xlenare caught asout_of_rangeandlength_errorwith the narrow messages, and that_Doraiseon asystem_errorbuilt withgeneric_categorycode 5 is caught asios_base::failureand assystem_errorwith the samewhat(), shares the message, copies the error code, and that a null object throwsstd::invalid_argument.public_headerspasses 65/65.tools/progress.py: libraries done goes from 15580 on main to 15583 (+3) out of 39251.42ffb8dc8a: merged mainc3d38470e0cand moved this PR's debt edits intodocs/dev/debt/changes/claude-libcinternal-wide-xlen-doraise.md; the debt files match main, and the fragment applied to main gives the same debt lines as the previous head.debt_fold.py --checkandcheck_conventions.py --base origin/mainpass. Documentation only, no build.8f97dd00249: merged main7e6f3f82838, which implementedmessages<char>get,openandclosenext to the removed_Doraisestub inExport.cppandPendingExports.hpp; kept main's code and this PR's removal of the stub and its declaration. On Ubuntu WSL2, GCC 11, Release, Ninja,guest_libc_internal_basic_stringandguest_libc_internal_messagespass 2/2. The debt files match main,debt_fold.py --checkandcheck_conventions.py --base origin/mainpass.13fada000c9: merged maina2beb603f1e, which implemented the Dinkum thread errors (#20059) and removed their stubs next to this PR's removed_Xlenand_Xranstubs inInventoryExports2.cpp; removed both sets. The diff against main is unchanged from the previous head (the_Xlen,_Xranand_Doraisestubs and declarations removed). The debt files match main andcheck_conventions.py --base origin/mainpasses;debt_fold.py --checkreports only main's owndocs-nkwebkit-drop-readded-count-lines.mdfragment, which also fails on main. Merge only, no build.46ad40647db: merged main648ba19b3ed. heditrigui's #22431 changed the_Unlock_spin_lockdeclaration tovoid (volatile char* lock, int mode = 0)on the line next to this PR's removed_Xlendeclaration ininclude/InventoryExports2.hpp; kept main's declaration and this PR's removal. On Windows, WinLibs GCC 15.2.0,guest_libc_internal_basic_stringand #22431'sguest_libc_internal_time_lockpass 2/2. The debt files match main,debt_fold.py --checkandcheck_conventions.py --base origin/mainpass.5ff14bbefc2: merged maine481b135558. PostMalloy's #24043 implementedbad_exception::_Doraiseand removed its stub, which sat directly above this PR's removed wide_Xlenand_Xranstubs inInventoryExports2.cpp, so the two removals conflicted; removed all three stubs. The diff against main is unchanged from the previous head. On Ubuntu WSL2, GCC 11, Release, Ninja,guest_libc_internal_basic_stringand #24043'sguest_libc_internal_exception_virtualsandguest_libc_internal_libc_forwardspass 3/3. The debt files match main,debt_fold.py --checkandcheck_conventions.py --base origin/mainpass.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 PrivacyOnion on 2026-11-16T16:54:59Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
8f97dd0024:tools/check_conventions.pypassed;git diff --checkclean.guest_libc_internal_basic_string_testsbuilt cleanly.guest_libc_internal_basic_string):core/libs/prx/libSceLibcInternal/BasicString.cpp,core/libs/prx/libSceLibcInternal/Export.cpp,core/libs/prx/libSceLibcInternal/InventoryExports2.cpp,core/libs/prx/libSceLibcInternal/include/Api.hpp,core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp,core/libs/prx/libSceLibcInternal/include/PendingExports.hpp,core/libs/prx/libc/include/Api.hpp,core/libs/prx/libc/src/exception/StandardExceptions.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass._ZNKSbIwSt11char_traitsIwESaIwEE5_XranEv_nid_postfixand_ZNKSbIwSt11char_traitsIwESaIwEE5_XlenEv_nid_postfixincore/libs/prx/libSceLibcInternal/BasicString.cppforward to_ZNKSs5_XranEv_nid_postfixand_ZNKSs5_XlenEv_nid_postfix([[noreturn]]throwingout_of_range("invalid string position")andlength_error("string too long")).core/libs/prx/libSceLibcInternal/BasicString.cpp(WideCapacityFor,WideAllocationBytes,ReserveWide,ClampWide,AssignWide,append,insert) route length and range errors through the wide reporters._ZNKSt8ios_base7failure8_DoraiseEv_nid_postfixincore/libs/prx/libc/src/exception/StandardExceptions.cppchecksselffor null (std::invalid_argument) and callsLibcException::SceV2::ThrowSystemCopy(self, _ZTVNSt8ios_base7failureE_nid_postfix).Export.cpp,InventoryExports2.cpp,InventoryExports2.hpp,PendingExports.hpp,libSceLibcInternal/include/Api.hpp, andlibc/include/Api.hpp, as well as debt fragmentdocs/dev/debt/changes/claude-libcinternal-wide-xlen-doraise.md.core/libs/tests/GuestLibcInternalBasicString.cppexercises the wide reporters andios_base::failure::_Doraise(including null argument handling and exception catching) with both Linux CTest and Windows contributor test runs passing.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T17:01:16Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and added tests support merging.
What I ran
Reviewed head
8f97dd0024944466020820b59d1b04aa90836bda. I read all 10 changed files listed as reviewed inmanifest.json, including the implementation, API declarations, tests, and debt fragment. I did not run commands or tests; reported test results below come from the PR description.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests or builds were run in this review. I excluded no changed files; all 10 files marked
reviewedin the manifest were read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T05:36:33Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
13fada000c:tools/check_conventions.pypassed.guest_libc_internal_basic_string_testsbuilt cleanly.guest_libc_internal_basic_string):core/libs/prx/libSceLibcInternal/BasicString.cpp,core/libs/prx/libSceLibcInternal/Export.cpp,core/libs/prx/libSceLibcInternal/InventoryExports2.cpp,core/libs/prx/libSceLibcInternal/include/Api.hpp,core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp,core/libs/prx/libSceLibcInternal/include/PendingExports.hpp,core/libs/prx/libc/include/Api.hpp,core/libs/prx/libc/src/exception/StandardExceptions.cppreverted 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-18T06:55:38Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the exact-head implementation and tests support merging.
What I ran
Reviewed head
13fada000c97dfd10c0624f958950f7fad012e21. Read the prepared diff and changed source context usingrepo_read.py; no test commands were run. The description reports tests on earlier revisions, not this exact head.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The description’s reported test results were not independently reproduced on this head. No build or runtime checks were run. Read:
BasicString.cpp,Export.cpp,InventoryExports2.cpp,include/Api.hppin both changed libraries,include/InventoryExports2.hpp,include/PendingExports.hpp,StandardExceptions.cpp,GuestLibcInternalBasicString.cpp, and the debt fragment. Excluded by rule: none.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T09:55:06Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
46ad40647d:tools/check_conventions.pypassed.guest_libc_internal_basic_string_testsbuilt cleanly.guest_libc_internal_basic_string):core/libs/prx/libSceLibcInternal/BasicString.cpp,core/libs/prx/libSceLibcInternal/Export.cpp,core/libs/prx/libSceLibcInternal/InventoryExports2.cpp,core/libs/prx/libSceLibcInternal/include/Api.hpp,core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp,core/libs/prx/libSceLibcInternal/include/PendingExports.hpp,core/libs/prx/libc/include/Api.hpp,core/libs/prx/libc/src/exception/StandardExceptions.cppreverted 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-18T10:05:24Z.
Review: APPROVED
Reviewed — looks good
Nothing in the reviewed change blocks merging; the inspected implementation and reported checks support approval.
What I ran
Reviewed head
46ad40647dbf2d0e9bd794fc60a7a49ccdf35999. No commands or tests were run in this review; reported test results below are from the PR description.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No build or test was performed. The test outcomes and environment in the description were not independently verified. The review folder did not contain
files.json;manifest.jsonlisted all 10 changed files as included, and all 10 changed files were read. The full text ofreview/README.mdwas not read. No other operating systems or console behavior were checked.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T18:50:49Z.
Review: APPROVED
Reviewed — looks good
The change implements the three reported exports, and the reviewed source plus the author-reported checks support merging at head
5ff14bbefc21ecad6482a686c45388cc6c3e897d.What I ran
Read the prepared diff and targeted source ranges with
repo_read.pyat the exact head. No build or tests were run during this review; the checks in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Did not read every line of the changed files or run tests. Read the diff and targeted ranges in
BasicString.cpp,StandardExceptions.cpp, the relevant API headers,Export.cpp, andGuestLibcInternalBasicString.cpp. The manifest lists nine changed files, all included in the prepared bundle; I did not inspect the remaining changed-file bodies in full.files.jsonwas not available through the reader. Build and test claims in the description were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T18:58:41Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
5ff14bbefc:tools/check_conventions.pypassed.guest_libc_internal_basic_string_testsbuilt cleanly.guest_libc_internal_basic_string):core/libs/prx/libSceLibcInternal/BasicString.cpp,core/libs/prx/libSceLibcInternal/Export.cpp,core/libs/prx/libSceLibcInternal/InventoryExports2.cpp,core/libs/prx/libSceLibcInternal/include/Api.hpp,core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp,core/libs/prx/libSceLibcInternal/include/PendingExports.hpp,core/libs/prx/libc/include/Api.hpp,core/libs/prx/libc/src/exception/StandardExceptions.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me