feat(libc): export std::__sce_v2::_Locinfo #11450
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11450"
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 edubox on 2026-10-26T14:06:51Z.
What
Exports the versioned C-locale
std::__sce_v2::_Locinfoconstructor and destructor.The console
libc.prxin PPSA02530 (0xcfe10/0xcfe50) and PPSA28416 (0xd10c0/0xd1100) stores the current C-locale pointer at offsets 8 and0x10; the constructor writes offset 8 before validating the name. It accepts an empty or"C"name and throwsstd::__sce_v2::runtime_error("bad locale name")for a null or any other name, leaving offset0x10untouched on rejection. The destructor passes the stored offset-8 pointer tosetlocale. Offset 0 is caller-owned and preserved.The console exports the pair with NIDs
K+YIrBadUlc(constructor) andtaOj6NIm7DM(destructor); firmware 13.42'slibSceLibcInternal.sprxexports both with sizes0x3aand0x19, the same as PPSA02530'slibc.prx.Tested
Linux x86-64, GCC 16.2.1, Release,
BUILD_TESTING=ON.guest_sce_v2_exceptionspasses: both fields point to"C"for empty and"C"names; a null or non-C name writes offset 8 with"C", leaves offset0x10untouched and throws the versionedruntime_errorwithbad locale name; offset 0 keeps the caller value.python3 tools/check_conventions.py --base origin/mainandgit diff --checkpass.sceNpGetSandboxInfobefore these imports are reached.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-10-26T14:13:56Z.
Review: CHANGES_REQUESTED
The implementation and Linux test report are clear, and the current hosted Linux/Windows relinker and Ubuntu register-context checks pass. The branch and tested base are
99b8446cbc, while currentmainis51f5c57dd9; CONTRIBUTING requires keeping PRs based on currentmain. Please sync the branch and rerun the focused locale/exception test and conventions on the rebased head. The macOS relinker/register-context/write-watch jobs are still queued, so I will revisit after they complete.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T16:21:18Z.
Review: DISMISSED
Re-reviewed exact head
571af22666a8, now based on livemain518d36eaec0a. The author reports rebuildingguest_sce_v2_exceptionsandguest_localeon this head with both passing; current-main conventions and whitespace checks also pass. The requested independent ABI evidence remains unanswered:GuestLocale::SceV2Locinfoand its 24-byte size/offset assertions are newly defined here, while the test constructs that same definition, so those assertions do not independently verify the guest layout. The PR describes offsets 8 and 0x10 observed in two console libc.prx images, but does not provide a reproducible call-site, object-byte observation, or other supporting artifact, and the reason offset 0 is intentionally preserved is still unclear. Please add that evidence and clarify the constructor's treatment of offset 0. I am not asserting the layout is incorrect; without that evidence I cannot complete ABI review.Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-10-29T04:10:58Z.
Review: APPROVED
Approving this head (an automatic rebase of
adc7b5a70e; the PR's changes to its four files are identical). I read the whole diff against my firmware 13.42 run above (the decrypted systemlibSceLibcInternal.sprx's two exports, natively on a PC, not a console):setlocale(0x3f, NULL)at +8 before it checks the name, rejects a null name and every name other than""and"C"through_Xruntime_error("bad locale name")with +0x10 left alone, and otherwise stores the same pointer at +0x10. That is what the module did for every name I ran (NULL,"","C","POSIX","c","C.UTF-8","CX").setlocale(0x3f, <+8>)when +8 is not null, as the module's disassembly does."en_US.UTF-8"), including the +8 write and the untouched +0x10 on rejection, and that offset 0 is kept, as the module kept it in the cases that return.Not covered by my run: what
setlocaleitself returns outside the C locale, and the null-object throws, which the module doesn't have (per its disassembly it would fault).