libc: implement localeconv (PPSA99600, PPSA17641); branch and PR #3245 ready #3249
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 pushkarreddyy on 2026-10-11T03:25:43Z.
Problem & Runtime Title Stop
Cloud Play (
PPSA99600) andPPSA17641(along with homebrew titles cataloged in #1578 includingPPSA99808,PPSA99810,PPSA99010,PPSA99728) fail to start onmainbecauselocaleconv(0hlfW1O4Aa4) is missing:Ready Fix & Branch
A clean, self-contained fix conforming 100% to repository conventions (0 comments, atomic commit, unit tests in
GuestLocale, TechnicalDebt entry) is implemented and ready:pushkarreddyy:feat/libc-localeconv80fb6ab27Implementation Details
struct GuestLconvmatching 64-bit ABI layout and member offsets inGuestLocale.hpp.localeconv_nid_postfix()inLocaleSupport.cppreturning the standard classic C locale configuration (.decimal point,""string fields,CHAR_MAX127 integer formatting values).*__error_nid_postfix().GuestLocale.cppunit tests verifying struct contents, pointer stability, and guest errno sentinel preservation.python tools/check_conventions.py --base origin/mainwith 0 errors.Opening this tracking issue while PR #3245 is intake-paused so maintainers can review, carry, or cherry-pick into an active merge train.
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-11T03:43:46Z.
cc @MarcZX100 @adriadam10: Branch
pushkarreddyy:feat/libc-localeconv(80fb6ab27) on PR #3245 is verified and ready for review/carry.struct GuestLconvlayout with static assertions and classic C locale return values.check_conventions.pywith 0 errors, fullGuestLocaletests passing, and positive bot progress report (+1 implemented).Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-11T08:42:29Z.
Import audit of the catalog build of Cloud Play (PPSA99600 v1.0.0,
CloudPlay-PS5.zip, sha256fa47dd13...as in the catalog record;eboot.binandsce_module/libc.prxunwrapped from their fake-SELF containers) onmainccf9ff90, names fromtools/nid_names.py: 9 absent imports,localeconvis one of them:0hlfW1O4Aa4localeconv(this issue)7Psx1DlAyE4getprogname(#3347)04AjkP0jO9U_umtx_op(#1482)dar03AOn+nMgetcontext,2VRU7xiqLO8setcontext,GipcbdDM5cImakecontext(#1841, closed on Oct 9 until a title stops there; three do now, see its thread)60q1rziOzzQfnmatch,H1bArJPagV0getservbyname,UISQ-dQzw28arc4random(no PR or issue found)Stubs that throw when reached:
sceSystemServiceLoadExec,madvise,select.So Cloud Play is nine imports away from starting, not one;
localeconvis just the first NID the loader reports.AI-assisted: yes (Claude Code Fable 5.1 xhigh)
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-11T08:56:53Z.
PPSA99902 localeconv retest (2026-10-12)
In response to the requested current-main retest: the import is implemented, but an unchanged-main launch stops earlier; an instrumented experimental integration observes the call and continues to the title screen. These are separate validation scopes.
Target: Sonic Unleashed Recompiled 01.003.000, PPSA99902; original ELF SHA-256
c34f5b0848ef49e96a855076d8254254047e966e4fe56589d0e504fe13828479. Windows 11, Ryzen 9950X3D / RTX 5080, NVIDIA 610.62, WinLibs GCC 15.2 r7. Vulkan required; AnyPS5 shader cache disabled; no controller input.Unchanged main
b42ef24e07725ba1166420073817d80a60ec9149: full build/system libraries and fresh conversions from the preserved original dump, both default and strict (unused-filter=2), stop with:Both exit
0xC0000139, in 1.983 s and 2.000 s respectively, without timeout. This provides no observation of what follows localeconv on unchanged main. No main-side locale logger was installed, so absence of a log line is not a zero-call measurement.Conditional call observation: experimental fork
08891d93, using the preservedf60923bfconversion and additional kernel/CRT/graphics prerequisites. Its locale production implementation is identical to b42 inLocaleSupport.cppandSonyCrt.hpp; no FreeBSD layout substitution. A temporary libc diagnostic records the caller and returned fields, retaining guest errno, host errno and Windows last error; controller/frame observers are also present. This is not an unchanged-main runtime.One call was observed in the 120-second observation window:
0x33f5fea; return VA0x33f5ff0maps to executable RVA0x3405ff0..elf0headers, with the entire bounded caller function byte-identical between original and converted files, independently matching the earlier caller hash.00), while the pointer at offset0x48points to.(first byte2e).Static assembly loads the pointer at result+0 and tests its first byte; with the observed returned fields it is consistent with taking the empty-string branch. That branch was not dynamically single-stepped. Only one of the five known direct callers was observed; the other four, later formatting and gameplay remain unverified. Reaching the title screen does not establish that the layout is correct for every caller, or justify a universal ABI change.
After removing the diagnostic, full build/libraries and locale/rune-locale/pad tests pass five repeats each; source is restored byte for byte and Git is clean. Original dump files, exact 123-file runtime baseline, guest libc, saves/config/marker were restored and hash-verified after every launch and again after analysis. Game files, generated images and logs remain private. AI-assisted investigation/report: Codex.
Historical scope, superseded by the retest above
The earlier experimental stacks stopped at a missing localeconv import before guest entry; they established an import gap, not execution or locale behavior. The earlier local FreeBSD-shaped carry
e22af772advanced to a missing fminf import under its stated prerequisites. That override was omitted from the refreshed integrationd8fd7c7, retaining merged Sony localeconv. The original callers' offset-0 accesses and one 96-byte prefix copy remain documented on #545; static accesses alone do not establish a general PS5 ABI.Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-11T09:06:52Z.
Huge thanks @Amoenus and @orishamir for the rigorous controlled validation and import audits!
Having empirical confirmation that
localeconv(0hlfW1O4Aa4) is the immediate runtime stop for Sonic Unleashed Recompiled (PPSA99902, 5/5 runs), Cloud Play (PPSA99600), and vkQuake (PPSA99010) provides multi-title evidence for this export.Branch
pushkarreddyy:feat/libc-localeconvis ready and fully verified:localeconvconforming to FreeBSD 11.4struct GuestLconvlayout and classic C locale parameters.main, passescheck_conventions.pywith 0 errors, and all unit tests inGuestLocalepass.cc @MarcZX100 @adriadam10: When convenient, this branch is tested and ready to carry to unblock all three titles!
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-11T11:55:52Z.
Update: @Amoenus has independently verified 5/5 runs on Sonic Unleashed Recompiled (PPSA99902) in #3245, confirming that callers read decimal_point directly at offset
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:28:26Z.
localeconvis on main since #545 (a4d5d3ce), with that PR's layout:decimal_pointat 0x48 of a 0x90-byte struct. The callers found in PPSA99902 read it at offset 0. Could you rerun PPSA99600 or PPSA99902 on current main and post what happens after the call?Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-12T06:38:52Z.
Requested localeconv runtime retest completed for PPSA99902: unchanged main
b42ef24e(fresh default and strict conversions) stops earlier atqiL4fFObAxM/ libkernel,0xC0000139. Consequently that run cannot show what follows the call.Separately, our conditional experimental integration retains the identical main locale implementation. A diagnostic records the actual original caller
0x33f5fea: returned offset-0 pointer is an empty string, offset-0x48 pointer is.. The game continues to PRESS START before the timed observation ends. This is one observed caller, not proof of formatting correctness or a general ABI conclusion. I updated our existing report with mapping checks, prerequisites and limits, keeping the full findings there. AI-assisted: Codex.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T13:23:44Z.
localeconv(0hlfW1O4Aa4) is exported bylibc.prxonmain(core/libs/prx/libc/src/LocaleSupport.cpp). Build ofmain0f2683cb7(Windows, WinLibs GCC 15.2.0, Release), checked withobjdump -pon the built modules. #3245 was closed, but the function landed through other work, so this issue only stayed open by accident. Could a maintainer close it?Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-13T13:39:06Z.
Confirmed @LeandroLP23. localeconv (�hlfW1O4Aa4) is already exported on origin/main via core/libs/prx/libc/src/LocaleSupport.cpp. Closing this issue as resolved.