Guest module conversion collapses 1872 SDK libc exports (snprintf, atexit, abs, ...) into one shared return-0 stub, so homebrew titles silently no-op #2652
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 StarMrGamer on 2026-10-10T10:01:36Z.
What
When the relinker converts a ps5-payload-dev SDK
libc.prxmodule from a catalog homebrew title, most of its exports end up bound to a single stub that just returns 0. Calls likesnprintfsucceed silently but do nothing. The title then runs on uninitialized memory instead of failing loudly.This is the root cause of the garbage
open()calls in the DOOM Native Port run reported in #2010, and it likely affects every catalog homebrew title, since they all ship this module.The evidence chain (DOOM Native Port 1.1.1, PPSA99666, Linux)
open()55 times with a garbage path (raw stack bytes) and a garbagemode. Logging the return addresses insceKernelOpenpins the calls to one probe loop in the game binary (file offset 0x3866a).snprintf(buf, 0x200, "%s/%s", ...)through a runtime-bound function-pointer slot. The buffer is never written, so%s/%soutput cannot appear — the calls print raw stack contents.app0/sce_module/libc.prx.guest.prx. The code there is seven bytes:pxor xmm0,xmm0; xor eax,eax; ret— return 0, write nothing.0x50(the bytes at 0x50 in the original file are zeros). They includesnprintf(eLdDw6l0-bU),atexit(8G2LB+A3rzg),abs(Ye20uNnlglA),__cxa_finalizeand_malloc_init. Names resolved withtools/nid_names.py.return 0stub for all of them. Everything else in the module converts normally (2566 exports parse, dependencies resolve, the title starts and reaches file I/O).Why it matters
libc.prx, so all of them inherit silent no-op libc calls. This is probably why only one title in #2010 "ran" — and even it was broken.snprintfthat returns 0 without writing is the kind of silent failure that sends investigations (like this one) down long wrong paths.Notes for whoever picks this up
0x50placeholder means in SCE modules on hardware and how conversion should treat it: resolve the export against the system library's implementation of the same NID, generate a per-NID throwing stub, or something else. That choice is above my pay grade here.provider.prxtests call into a converted module and get real results), so the trigger is the placeholder-value export style, not the container format.Tested
Linux, main
256b8ed4plus #2206. Chain verified end to end with logging insceKernelOpen, a runtime memory dump of the function-pointer slots, and a parse of the module's symbol table. Could not verify: real-hardware meaning of the0x50placeholder, Windows.Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-10T10:36:10Z.
This looks closely related to #1497 and its fix in #1529. That investigation found that DOOM declares these imports from
libSceLibcInternal, but Linux binds them to the bundled libc shim because the NIDs match. #1529 changes binding to respect the declared module; the thread includes an A/B run where the same title starts finding its WAD.Could you repeat the failing case with #1529 applied and check the import’s declared module and resolved provider? That would distinguish the known binding bug from a separate conversion bug. A shared export address alone doesn’t establish that the relinker generated the placeholder code.
Made with AI Assistance.
Imported from boykopovar/AnyPS5. Originally posted by DavidSamir on 2026-10-10T11:31:30Z.
The A/B asked for above, on macOS, where
--macostakes the same non-Windows binding path as Linux.DOOM PPSA99666 v1.1.1, same libraries, only the relinker differing:
libc.prx(#guest). Two empty notifications,/app0/test.cfgopened with a garbage mode,doom1.wadnever opened, exit after 7 s.GuestModuleBuilder.cppchange: 0 of 171. Debug text is printed,doom1.wadopens and the demo loop runs.For Linux output the same count goes from 70 of 170 to 0 (converted on macOS, not run).
So for this title the placeholder exports are reached through the binding in #1497, not through the conversion of the module itself. This does not answer what the
0x50placeholder exports should become for an import that does declare the bundled module.Run details: https://github.com/boykopovar/AnyPS5/issues/1#issuecomment-6096952968. #1529 rebased onto
mainb5f5362dwith a macOS test:DavidSamir:fix/relinker-declared-host-imports.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-10T11:42:17Z.
@DavidSamir Thanks, this answers the binding A/B I requested. Your macOS runtime result and the Linux-output import counts support #1497 as the cause for this DOOM case. I checked #1529 at
abb5c46d: itsdeclaresHostguard applies on the non-Windows path, and the added fixtures check that an import declaringlibSceLibcInternalstays host-bound even when a bundled module exports the same symbol.The remaining placeholder question needs a separate reproducer: an import that actually declares the bundled module, with its NID, declared module, resolved provider, and observed call behavior. That would let this issue track the residual case without treating the DOOM binding failure as evidence of faulty module conversion. The Linux conversion counts are useful, but a Linux runtime result remains unverified.
AI-assisted review of the linked code and your reported results; I have not independently reproduced the macOS or Linux runs.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T05:06:11Z.
Closing: the DOOM case here was the binding from #1497, fixed by #1529 (DavidSamir's A/B above: 70 of 171 imports bound to the bundled libc before, 0 after, and
doom1.wadopens). Please reopen with an import that declares the bundled module and still lands on the0x50stub on current main.