libc: implement localeconv (PPSA99600, PPSA17641); branch and PR #3245 ready #3249

Closed
opened 2026-10-11 03:25:43 +00:00 by pushkarreddyy · 9 comments
pushkarreddyy commented 2026-10-11 03:25:43 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-11T03:25:43Z.


Problem & Runtime Title Stop

Cloud Play (PPSA99600) and PPSA17641 (along with homebrew titles cataloged in #1578 including PPSA99808, PPSA99810, PPSA99010, PPSA99728) fail to start on main because localeconv (0hlfW1O4Aa4) is missing:

./app.elf: symbol lookup error: ./app.elf: undefined symbol: 0hlfW1O4Aa4

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:

Implementation Details

  • Defined FreeBSD 11.4 struct GuestLconv matching 64-bit ABI layout and member offsets in GuestLocale.hpp.
  • Implemented localeconv_nid_postfix() in LocaleSupport.cpp returning the standard classic C locale configuration (. decimal point, "" string fields, CHAR_MAX 127 integer formatting values).
  • Preserves guest *__error_nid_postfix().
  • Extended GuestLocale.cpp unit tests verifying struct contents, pointer stability, and guest errno sentinel preservation.
  • Passed python tools/check_conventions.py --base origin/main with 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5797589240 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3249). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-11T03:25:43Z. --- ### Problem & Runtime Title Stop Cloud Play (`PPSA99600`) and `PPSA17641` (along with homebrew titles cataloged in #1578 including `PPSA99808`, `PPSA99810`, `PPSA99010`, `PPSA99728`) fail to start on `main` because `localeconv` (`0hlfW1O4Aa4`) is missing: ``` ./app.elf: symbol lookup error: ./app.elf: undefined symbol: 0hlfW1O4Aa4 ``` ### 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: - Branch: [`pushkarreddyy:feat/libc-localeconv`](https://github.com/pushkarreddyy/AnyPS5/tree/feat/libc-localeconv) - Commit: `80fb6ab27` - PR: #3245 ### Implementation Details - Defined FreeBSD 11.4 `struct GuestLconv` matching 64-bit ABI layout and member offsets in `GuestLocale.hpp`. - Implemented `localeconv_nid_postfix()` in `LocaleSupport.cpp` returning the standard classic C locale configuration (`.` decimal point, `""` string fields, `CHAR_MAX` 127 integer formatting values). - Preserves guest `*__error_nid_postfix()`. - Extended `GuestLocale.cpp` unit tests verifying struct contents, pointer stability, and guest errno sentinel preservation. - Passed `python tools/check_conventions.py --base origin/main` with 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.
pushkarreddyy commented 2026-10-11 03:43:46 +00:00 (Migrated from github.com)
Author
Contributor

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.

  • Confirmed FreeBSD 11.4 struct GuestLconv layout with static assertions and classic C locale return values.
  • Passed check_conventions.py with 0 errors, full GuestLocale tests passing, and positive bot progress report (+1 implemented).
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6105128021 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3249#issuecomment-6105128021). Originally posted by [pushkarreddyy](https://github.com/pushkarreddyy) on 2026-10-11T03:43:46Z. --- cc @MarcZX100 @adriadam10: Branch [`pushkarreddyy:feat/libc-localeconv`](https://github.com/pushkarreddyy/AnyPS5/tree/feat/libc-localeconv) (`80fb6ab27`) on PR #3245 is verified and ready for review/carry. - Confirmed FreeBSD 11.4 `struct GuestLconv` layout with static assertions and classic C locale return values. - Passed `check_conventions.py` with 0 errors, full `GuestLocale` tests passing, and positive bot progress report (`+1 implemented`).
orishamir commented 2026-10-11 08:42:29 +00:00 (Migrated from github.com)
Author
Contributor

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, sha256 fa47dd13... as in the catalog record; eboot.bin and sce_module/libc.prx unwrapped from their fake-SELF containers) on main ccf9ff90, names from tools/nid_names.py: 9 absent imports, localeconv is one of them:

  • 0hlfW1O4Aa4 localeconv (this issue)
  • 7Psx1DlAyE4 getprogname (#3347)
  • 04AjkP0jO9U _umtx_op (#1482)
  • dar03AOn+nM getcontext, 2VRU7xiqLO8 setcontext, GipcbdDM5cI makecontext (#1841, closed on Oct 9 until a title stops there; three do now, see its thread)
  • 60q1rziOzzQ fnmatch, H1bArJPagV0 getservbyname, UISQ-dQzw28 arc4random (no PR or issue found)
    Stubs that throw when reached: sceSystemServiceLoadExec, madvise, select.

So Cloud Play is nine imports away from starting, not one; localeconv is just the first NID the loader reports.

AI-assisted: yes (Claude Code Fable 5.1 xhigh)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107237599 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3249#issuecomment-6107237599). Originally posted by [orishamir](https://github.com/orishamir) on 2026-10-11T08:42:29Z. --- Import audit of the catalog build of Cloud Play (PPSA99600 v1.0.0, `CloudPlay-PS5.zip`, sha256 `fa47dd13...` as in the catalog record; `eboot.bin` and `sce_module/libc.prx` unwrapped from their fake-SELF containers) on `main` ccf9ff90, names from `tools/nid_names.py`: 9 absent imports, `localeconv` is one of them: - `0hlfW1O4Aa4` `localeconv` (this issue) - `7Psx1DlAyE4` `getprogname` (#3347) - `04AjkP0jO9U` `_umtx_op` (#1482) - `dar03AOn+nM` `getcontext`, `2VRU7xiqLO8` `setcontext`, `GipcbdDM5cI` `makecontext` (#1841, closed on Oct 9 until a title stops there; three do now, see its thread) - `60q1rziOzzQ` `fnmatch`, `H1bArJPagV0` `getservbyname`, `UISQ-dQzw28` `arc4random` (no PR or issue found) Stubs that throw when reached: `sceSystemServiceLoadExec`, `madvise`, `select`. So Cloud Play is nine imports away from starting, not one; `localeconv` is just the first NID the loader reports. AI-assisted: yes (Claude Code Fable 5.1 xhigh)
Amoenus commented 2026-10-11 08:56:53 +00:00 (Migrated from github.com)
Author
Contributor

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:

FAIL: unresolved ELF import qiL4fFObAxM from libkernel.prx

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 preserved f60923bf conversion and additional kernel/CRT/graphics prerequisites. Its locale production implementation is identical to b42 in LocaleSupport.cpp and SonyCrt.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:

  • Original ELF call VA 0x33f5fea; return VA 0x33f5ff0 maps to executable RVA 0x3405ff0.
  • Mapping checked from ELF PT_LOAD and PE .elf0 headers, with the entire bounded caller function byte-identical between original and converted files, independently matching the earlier caller hash.
  • Returned struct is nonnull; the pointer at offset 0 points to an empty string (first byte 00), while the pointer at offset 0x48 points to . (first byte 2e).
  • The game continues and reaches SONIC UNLEASHED / PRESS START in privately inspected GPU frames. No fatal/unsupported stop recorded before the harness ends the timed run (123.258 s including termination).

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 e22af772 advanced to a missing fminf import under its stated prerequisites. That override was omitted from the refreshed integration d8fd7c7, 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107346747 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3249#issuecomment-6107346747). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-11T08:56:53Z. --- ### PPSA99902 localeconv retest (2026-10-12) In response to [the requested current-main retest](https://github.com/boykopovar/AnyPS5/issues/3249#issuecomment-6115108315): **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: ``` FAIL: unresolved ELF import qiL4fFObAxM from libkernel.prx ``` 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`](https://github.com/Amoenus/AnyPS5/commit/08891d938125d28cd2bcb45bfe2b320e18ad99b8), using the preserved `f60923bf` conversion and additional kernel/CRT/graphics prerequisites. Its locale production implementation is identical to b42 in `LocaleSupport.cpp` and `SonyCrt.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: - Original ELF call VA `0x33f5fea`; return VA `0x33f5ff0` maps to executable RVA `0x3405ff0`. - Mapping checked from ELF PT_LOAD and PE `.elf0` headers, with the entire bounded caller function byte-identical between original and converted files, independently matching the earlier caller hash. - Returned struct is nonnull; the pointer at offset 0 points to an empty string (first byte `00`), while the pointer at offset `0x48` points to `.` (first byte `2e`). - The game continues and reaches **SONIC UNLEASHED / PRESS START** in privately inspected GPU frames. No fatal/unsupported stop recorded before the harness ends the timed run (123.258 s including termination). 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. <details> <summary>Historical scope, superseded by the retest above</summary> 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 `e22af772`](https://github.com/Amoenus/AnyPS5/commit/e22af7723dc132d205c0eb0599da8634449d6251) advanced to a missing fminf import under its stated prerequisites. That override was omitted from the [refreshed integration `d8fd7c7`](https://github.com/Amoenus/AnyPS5/commit/d8fd7c703558d3ded7dc0a42a5c484ba3acf0be5), retaining merged Sony localeconv. The original callers' offset-0 accesses and one 96-byte prefix copy remain [documented on #545](https://github.com/boykopovar/AnyPS5/pull/545#issuecomment-6107700083); static accesses alone do not establish a general PS5 ABI. </details>
pushkarreddyy commented 2026-10-11 09:06:52 +00:00 (Migrated from github.com)
Author
Contributor

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-localeconv is ready and fully verified:

  • Implements localeconv conforming to FreeBSD 11.4 struct GuestLconv layout and classic C locale parameters.
  • Rebased cleanly onto latest main, passes check_conventions.py with 0 errors, and all unit tests in GuestLocale pass.

cc @MarcZX100 @adriadam10: When convenient, this branch is tested and ready to carry to unblock all three titles!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107423339 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3249#issuecomment-6107423339). Originally posted by [pushkarreddyy](https://github.com/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-localeconv`](https://github.com/pushkarreddyy/AnyPS5/tree/feat/libc-localeconv) is ready and fully verified: - Implements `localeconv` conforming to FreeBSD 11.4 `struct GuestLconv` layout and classic C locale parameters. - Rebased cleanly onto latest `main`, passes `check_conventions.py` with 0 errors, and all unit tests in `GuestLocale` pass. cc @MarcZX100 @adriadam10: When convenient, this branch is tested and ready to carry to unblock all three titles!
pushkarreddyy commented 2026-10-11 11:55:52 +00:00 (Migrated from github.com)
Author
Contributor

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

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108758760 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3249#issuecomment-6108758760). Originally posted by [pushkarreddyy](https://github.com/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
oneandonlydean commented 2026-10-11 23:28:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:28:26Z.


localeconv is on main since #545 (a4d5d3ce), with that PR's layout: decimal_point at 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?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115108315 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3249#issuecomment-6115108315). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T23:28:26Z. --- `localeconv` is on main since #545 (`a4d5d3ce`), with that PR's layout: `decimal_point` at 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?
Amoenus commented 2026-10-12 06:38:52 +00:00 (Migrated from github.com)
Author
Contributor

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 at qiL4fFObAxM / 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119111803 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3249#issuecomment-6119111803). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-12T06:38:52Z. --- Requested localeconv runtime retest completed for PPSA99902: unchanged main `b42ef24e` (fresh default and strict conversions) stops earlier at `qiL4fFObAxM` / 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](https://github.com/boykopovar/AnyPS5/issues/3249#issuecomment-6107346747), keeping the full findings there. AI-assisted: Codex.
LeandroLP23 commented 2026-10-13 13:23:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T13:23:44Z.


localeconv (0hlfW1O4Aa4) is exported by libc.prx on main (core/libs/prx/libc/src/LocaleSupport.cpp). Build of main 0f2683cb7 (Windows, WinLibs GCC 15.2.0, Release), checked with objdump -p on 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?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6146559802 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3249#issuecomment-6146559802). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-13T13:23:44Z. --- `localeconv` (`0hlfW1O4Aa4`) is exported by `libc.prx` on `main` (`core/libs/prx/libc/src/LocaleSupport.cpp`). Build of `main` `0f2683cb7` (Windows, WinLibs GCC 15.2.0, Release), checked with `objdump -p` on 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?
pushkarreddyy commented 2026-10-13 13:39:06 +00:00 (Migrated from github.com)
Author
Contributor

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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6146855612 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3249#issuecomment-6146855612). Originally posted by [pushkarreddyy](https://github.com/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.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#3249
No description provided.