Linux: since #1156, a bundled sce_module/libc.prx is never initialised, but titles still call its malloc, which returns NULL #1500
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 awake-devel on 2026-10-08T10:02:49Z.
Symptom
Hollow Knight: Silksong (PPSA12544), Linux,
main296d68a3+ #846 (--module-dir Media/Plugins). The process dies with SIGSEGV while the dynamic loader runs module initialisers, before AnyPS5 prints anything:The faulting code is in
Media/Modules/Il2cppUserAssemblies.prx.guest.prx(file offset 0x292608):PLT slot 0x34 is a
R_X86_64_JUMP_SLOTforgQX+4GDQjpM#guest(malloc). The only module that defines it is the title's bundledapp0/sce_module/libc.prx.guest.prx(symbol 357, address 0x5eb0). Thatmalloccalls through a function pointer whose default target allocates from a global mspace in the bundled libc's.bss. That mspace is only set up by the bundled libc's own initialiser.Cause
#1156 (
9517cc33) stops writingDT_INIT/DT_INIT_ARRAY/DT_FINI/DT_FINI_ARRAYfor a guest module that has an AnyPS5 replacement (libc.prx). But the bundled module is still the export provider for the title's own imports: guest modules are listed ahead of host prx, and the imports are#guestsymbols. So the title calls a libc whose initialiser never ran.readelf -don the relinked bundled libc: no INIT entry with #1156, andINIT 0x210c90/FINI 0x210c9bwithout it.Evidence
9517cc33undone (two lines inLinuxGuestModuleWriter.cpp, relinker rebuilt, all else unchanged), the same build gets past module loading, opens/app0/Media/boot.configand stops later at an unrelated, known missing feature (sceKernelLoadStartModule with start arguments not implemented, handled by #1102). That is also where builds from before #1156 stopped.Possible directions (for the maintainers to choose)
Our local workaround is option 1 (Linux only).
Related: #1497 is the other side of the same binding question on Linux. There, a bundled
libc.prxshim captures a title's libc imports with placeholder exports, and the fix direction is to bind to AnyPS5's libc instead, as #684 did on Windows. Here the bundled module is Sony's real libc, which the title's code expects to be initialised. A fix for one should keep the other working.This was investigated and written by Claude Code (AI), and posted by me after review.