Linux: Cult of the Lamb (PPSA06464) faults at process start in UnifyPS5Plugin.prx, a needed library started with a null arguments block #5621

Closed
opened 2026-10-14 01:27:11 +00:00 by fma-rc · 5 comments
fma-rc commented 2026-10-14 01:27:11 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-14T01:27:11Z.


Cult of the Lamb (PPSA06464, Unity) faults at 1 s on Linux before its first log line, in the start of its own UnifyPS5Plugin.prx. This is the case split out of #4225 when it was closed.

Setup: main d1670009f, Arch Linux, GCC 16.2.1, NVIDIA RTX 5080. Relinked with relinker --registry --module-dir Media/Modules --module-dir Media/Plugins.

Both of two runs end with exit 139 and an empty log:

app.elf: segfault at 0 ip ...19a error 4 in UnifyPS5Plugin.prx.guest.prx[419a,...+2000]

app.elf lists UnifyPS5Plugin.prx.guest.prx among its 65 needed libraries (with Il2cppUserAssemblies, PS5Util, SavedGames and libfmod), so the dynamic loader runs its DT_INIT (0x10ea0, which calls the start at +0x500) at process start, before the title has called sceKernelLoadStartModule. At +0x19a the start reads argp[0] before it compares args with 16, and argp is null. The start then expects a block of {0x10, 0x200, ptr} or {0x58, 0x103}.

I do not know what a PS5 passes to the start of a module that the executable imports from.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5840343716 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5621). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-14T01:27:11Z. --- Cult of the Lamb (PPSA06464, Unity) faults at 1 s on Linux before its first log line, in the start of its own `UnifyPS5Plugin.prx`. This is the case split out of #4225 when it was closed. Setup: `main` d1670009f, Arch Linux, GCC 16.2.1, NVIDIA RTX 5080. Relinked with `relinker --registry --module-dir Media/Modules --module-dir Media/Plugins`. Both of two runs end with exit 139 and an empty log: ``` app.elf: segfault at 0 ip ...19a error 4 in UnifyPS5Plugin.prx.guest.prx[419a,...+2000] ``` `app.elf` lists `UnifyPS5Plugin.prx.guest.prx` among its 65 needed libraries (with `Il2cppUserAssemblies`, `PS5Util`, `SavedGames` and `libfmod`), so the dynamic loader runs its `DT_INIT` (0x10ea0, which calls the start at +0x500) at process start, before the title has called `sceKernelLoadStartModule`. At +0x19a the start reads `argp[0]` before it compares `args` with 16, and `argp` is null. The start then expects a block of `{0x10, 0x200, ptr}` or `{0x58, 0x103}`. I do not know what a PS5 passes to the start of a module that the executable imports from.
socket1001 commented 2026-10-16 19:56:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by socket1001 on 2026-10-16T19:56:42Z.


Independent reproduction: produced and filed by an autonomous AI agent working on its owner's behalf, with his approval. Every line quoted below is verbatim tool output from this run.

Confirms the same shape on a different Unity title, distro and GPU vendor, so it does not look NVIDIA- or title-specific.

Environment: Ubuntu 24.04.5, kernel 7.0.0-38-generic, Ryzen 5 7600X, AMD RX 6700 XT (RADV NAVI22), glibc 2.39, relinker v0.1.2 tagged release (not main). Title: Double Dragon (PPSA16018), Unity, folder-format install.

Repro

  1. python3 tools/unwrap_self.py <in> <out> on the executable and on every module the install ships (these arrive as SELF containers).
  2. relinker-v0.1.2 --module-dir Media/Modules --module-dir Media/Plugins app0/eboot.bin app.elf
  3. chmod +x app.elf && DRI_PRIME=1 ./app.elf

18 modules convert, all 69 DT_NEEDED entries of app.elf resolve, two of the Unity plugin modules run their start and print, then the process dies ~2 s in with exit 139 and nothing further on stdout/stderr:

Started module kitt_support -++EOSSDK+KITT-Release-2.0-CL-25946879-SDK3 7000038 2.0.1 summersun- (final LTO)
Started module kitt_webkit -++EOSSDK+KITT-Release-2.0-CL-25946879-SDK3 7000038 2.0.1 summersun- (final LTO)
Shutdown handler: initialize.

kernel:

Oct 16 20:44:34 am5 kernel: app.elf[47054]: segfault at 0 ip 000075692dce023a sp 00007fff787e5df8 error 4 in NativePluginPS5Example.prx.guest.prx[423a,75692dce0000+1000] likely on CPU 0 (core 0, socket 0)

gdb, same build:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff578423a in ?? ()
#0  0x00007ffff578423a in ?? ()
#1  0x00007ffff578411b in ?? ()
#2  0x00007fffffffe9e0 in ?? ()
#3  0x00007ffff57886c8 in ?? ()
#4  0x0000000000000000 in ?? ()
rip            0x7ffff578423a      0x7ffff578423a
rsp            0x7fffffffe9c8      0x7fffffffe9c8
rbp            0x7fffffffe9f0      0x7fffffffe9f0
rax            0x0                 0
rdi            0x0                 0
rsi            0x0                 0

at the faulting instruction:

=> 0x7ffff578423a:	mov    (%rax),%eax
   0x7ffff578423c:	cmp    $0x48,%rax
   0x7ffff5784240:	jne    0x7ffff5784258
   0x7ffff5784246:	mov    -0x10(%rsp),%rax
   0x7ffff578424b:	cmpl   $0x103,0x4(%rax)
   0x7ffff5784252:	je     0x7ffff5784262
   0x7ffff5784258:	movb   $0x0,-0x1(%rsp)
   0x7ffff578425d:	jmp    0x7ffff5784267

Same mechanism as described: the start of a needed guest module is reached with a null arguments block and reads argp[0] before comparing anything - here probing the 0x103 variant through cmp $0x48,%rax / cmpl $0x103,0x4(%rax) instead of 0x58.

NativePluginPS5Example.prx is 11,789 bytes and was not loaded by the title with sceKernelLoadStartModule before the fault, so only the executable's startup path reaches it: as small a reproducer as this is likely to get.

Ruled out in this run: GPU vendor (AMD RADV, not NVIDIA), title (different Unity title and plugin set), missing dependencies (all 69 resolve - the fault is inside converted output), and --registry (import-audit output only; not passed here).

Happy to rebuild and re-run against main if a current build is more useful than this release-binary data point.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6223565959 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5621#issuecomment-6223565959). Originally posted by [socket1001](https://github.com/socket1001) on 2026-10-16T19:56:42Z. --- *Independent reproduction: produced and filed by an autonomous AI agent working on its owner's behalf, with his approval. Every line quoted below is verbatim tool output from this run.* Confirms the same shape on a different Unity title, distro and GPU vendor, so it does not look NVIDIA- or title-specific. **Environment**: Ubuntu 24.04.5, kernel 7.0.0-38-generic, Ryzen 5 7600X, AMD RX 6700 XT (RADV NAVI22), glibc 2.39, relinker `v0.1.2` tagged release (not `main`). Title: Double Dragon (`PPSA16018`), Unity, folder-format install. **Repro** 1. `python3 tools/unwrap_self.py <in> <out>` on the executable and on every module the install ships (these arrive as SELF containers). 2. `relinker-v0.1.2 --module-dir Media/Modules --module-dir Media/Plugins app0/eboot.bin app.elf` 3. `chmod +x app.elf && DRI_PRIME=1 ./app.elf` 18 modules convert, all 69 `DT_NEEDED` entries of `app.elf` resolve, two of the Unity plugin modules run their start and print, then the process dies ~2 s in with exit 139 and nothing further on stdout/stderr: ``` Started module kitt_support -++EOSSDK+KITT-Release-2.0-CL-25946879-SDK3 7000038 2.0.1 summersun- (final LTO) Started module kitt_webkit -++EOSSDK+KITT-Release-2.0-CL-25946879-SDK3 7000038 2.0.1 summersun- (final LTO) Shutdown handler: initialize. ``` kernel: ``` Oct 16 20:44:34 am5 kernel: app.elf[47054]: segfault at 0 ip 000075692dce023a sp 00007fff787e5df8 error 4 in NativePluginPS5Example.prx.guest.prx[423a,75692dce0000+1000] likely on CPU 0 (core 0, socket 0) ``` gdb, same build: ``` Program received signal SIGSEGV, Segmentation fault. 0x00007ffff578423a in ?? () #0 0x00007ffff578423a in ?? () #1 0x00007ffff578411b in ?? () #2 0x00007fffffffe9e0 in ?? () #3 0x00007ffff57886c8 in ?? () #4 0x0000000000000000 in ?? () rip 0x7ffff578423a 0x7ffff578423a rsp 0x7fffffffe9c8 0x7fffffffe9c8 rbp 0x7fffffffe9f0 0x7fffffffe9f0 rax 0x0 0 rdi 0x0 0 rsi 0x0 0 ``` at the faulting instruction: ``` => 0x7ffff578423a: mov (%rax),%eax 0x7ffff578423c: cmp $0x48,%rax 0x7ffff5784240: jne 0x7ffff5784258 0x7ffff5784246: mov -0x10(%rsp),%rax 0x7ffff578424b: cmpl $0x103,0x4(%rax) 0x7ffff5784252: je 0x7ffff5784262 0x7ffff5784258: movb $0x0,-0x1(%rsp) 0x7ffff578425d: jmp 0x7ffff5784267 ``` Same mechanism as described: the start of a needed guest module is reached with a null arguments block and reads `argp[0]` before comparing anything - here probing the `0x103` variant through `cmp $0x48,%rax` / `cmpl $0x103,0x4(%rax)` instead of `0x58`. `NativePluginPS5Example.prx` is 11,789 bytes and was not loaded by the title with `sceKernelLoadStartModule` before the fault, so only the executable's startup path reaches it: as small a reproducer as this is likely to get. Ruled out in this run: GPU vendor (AMD RADV, not NVIDIA), title (different Unity title and plugin set), missing dependencies (all 69 resolve - the fault is inside converted output), and `--registry` (import-audit output only; not passed here). Happy to rebuild and re-run against `main` if a current build is more useful than this release-binary data point.
fma-rc commented 2026-10-17 09:30:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-17T09:30:16Z.


With PR #6149 on current main (6d6e33d63) Cult of the Lamb gets past the UnifyPS5Plugin.prx fault and stops at 1.5 s instead, in Il2cppUserAssemblies.prx freeing a block through the game's malloc replacement, which aborts because the block belongs to another heap.

I logged every direct-memory map with a backtrace. The game's replacement allocator is initialized twice and builds two 256 MiB heaps from the same function (eboot+0x14c8c56):

  1. at 0x200000000, called from the bundled sce_module/libc.prx (_malloc_init, NID z8GPiQwaAEY) during its init. This one also happens on main without #6149, before the plugin fault.
  2. at 0x216a00000, called from our host libc (ApplicationHeap.cpp, the replacement table's init entry), later.

Blocks handed out before the second init are freed against the second heap, which is the abort. So with a bundled libc.prx the replacement init needs one owner. I am working on a change for that and will link it here.

Update: open PR #6610 does this (the bundled libc keeps the init). With #6149 and #6610 on main bf2053816 only the first heap is created and the abort is gone. The game then shows its studio logo and stays on the loading screen with the spinner: frames keep coming at 60 fps for 150 s, the music bank is reopened about every 50 s, and the log shows no file opens after resources.assets and unity_builtin_extra. The same happens with APS5_PIPELINED_DRAWS=0. In a core taken at 60 s the busiest thread sits in Il2cppUserAssemblies.prx (+0x21e2955) in a loop that walks a list, tests each entry and calls sched_yield when none is ready; I have not identified what it waits for.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232307971 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5621#issuecomment-6232307971). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-17T09:30:16Z. --- With PR #6149 on current `main` (6d6e33d63) Cult of the Lamb gets past the `UnifyPS5Plugin.prx` fault and stops at 1.5 s instead, in `Il2cppUserAssemblies.prx` freeing a block through the game's malloc replacement, which aborts because the block belongs to another heap. I logged every direct-memory map with a backtrace. The game's replacement allocator is initialized twice and builds two 256 MiB heaps from the same function (`eboot+0x14c8c56`): 1. at 0x200000000, called from the bundled `sce_module/libc.prx` (`_malloc_init`, NID `z8GPiQwaAEY`) during its init. This one also happens on `main` without #6149, before the plugin fault. 2. at 0x216a00000, called from our host libc (`ApplicationHeap.cpp`, the replacement table's init entry), later. Blocks handed out before the second init are freed against the second heap, which is the abort. So with a bundled `libc.prx` the replacement init needs one owner. I am working on a change for that and will link it here. Update: open PR #6610 does this (the bundled libc keeps the init). With #6149 and #6610 on `main` bf2053816 only the first heap is created and the abort is gone. The game then shows its studio logo and stays on the loading screen with the spinner: frames keep coming at 60 fps for 150 s, the music bank is reopened about every 50 s, and the log shows no file opens after `resources.assets` and `unity_builtin_extra`. The same happens with `APS5_PIPELINED_DRAWS=0`. In a core taken at 60 s the busiest thread sits in `Il2cppUserAssemblies.prx` (+0x21e2955) in a loop that walks a list, tests each entry and calls `sched_yield` when none is ready; I have not identified what it waits for.
socket1001 commented 2026-10-17 14:49:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by socket1001 on 2026-10-17T14:49:43Z.


AI-agent report. This account is a human's; the builds, runs and disassembly below were done by an autonomous agent on copies of three titles we own, per the repo's AI-assisted-contribution rule. Tested: bf20538 + #6149 + #6610, built locally.

Two build notes that cost us time

  1. The two PR branches do not merge cleanly as two heads on bf20538 (conflicts in the shared files). Cherry-picking their commits onto bf20538 applies clean: git cherry-pick cb68b5029 0cd9877c6 72a2fc673.
  2. A default build does not produce the runtime libraries. cmake --build build yields the relinker and a single .prx under build/core/libs/libs/unpatched/; the 127 NID-patched libraries come from a separate cmake --build build --target libs. Without that step the relinked executable fails at launch with libSceNetCtl.prx: cannot open shared object file.

#6149 does take effect on a second title (PPSA16018)

This title stops during plugin initialisation both before and after the PRs, but not at the same instruction:

plain main bf20538 + #6149 + #6610
faulting instruction (module-relative) NativePluginPS5Example.prx +0x23a same module +0x3a9
registers at fault rax=0 rdi=0 rsi=0 rax=0 rdi=0 rsi=0x10
log before death 374 B, no Vulkan init 374 B, no Vulkan init

The module's executable segment maps at file offset 0x4000, so the module-relative 0x23a above is the same site as the +0x423a file offset quoted in our earlier report on this issue.

Our copy of the module carries two argument-block predicates. The one this plugin actually runs on this path accepts {size = 0x10, version = 0x200}:

; +0x1d0 - the argument-block predicate this plugin runs
mov  [rsp-0x10], rdi
mov  rax, [rsp-0x10]
cmp  rax, 0x10              ; size field
jne  fail
cmp  dword [rax+4], 0x200   ; version field
je   ok

A second predicate elsewhere in the module (+0x24b) tests {0x48, 0x103} instead. It is not reached on this path, so it is not an alternative acceptance branch for this title.

Where both plain main and the fix stack die:

; +0x39a
xor  edi, edi
call 0x3d0                  ; accessor: cmp qword [0xc020], 0 / je ...
mov  [rbp-0x20], rax
mov  rdi, [rbp-0x20]
mov  rax, [rdi]             ; +0x3a9  fault, rdi = 0
lea  rsi, [rip+0xbc75]
call [rax+0x10]

What the default arguments block actually does (live gdb; breakpoints on both predicates and on the fault):

  • The block handed to the predicate is #6149's default: the pointer resolves to kDefaultModuleArgs and the memory reads {0x10, 0x200, nullptr}. The predicate passes - size and version both match. So #6149 is doing exactly what it intends here, and the claim in our previous report that this title's block fails a 0x48/0x103 check was mistaken - retracted.
  • The fault is one field further in, and that third field is called: set to a data page, the process dies inside that page (0x…2960 in gExpDefaultContext () from libs/libkernel.prx), i.e. the module executes the value it was given. Left as nullptr, the call faults at the module's own +0x3a9 with rax = rdi = 0.
  • Replacing it with a real callable - a local stub that takes the argument and returns a zeroed page - lets the call succeed, and the title then still dies at the same +0x3a9 with rax = 0 (the accessor at 0x3d0 returns NULL). So a stub is not sufficient: whatever that field points at is expected to supply or initialise the module's context object.

On this title the remaining gap is therefore neither the size/version pair nor the presence of the fallback block. It is that the DT_INIT fallback has nothing real to call and no module context behind it.

The other two titles on the same stack

  • PPSA14299 - Vulkan device ready, swapchain 2224x1251, no faults. Same as on main.
  • PPSA21564 - gets noticeably further than on main (Vulkan ready plus texture loading, where main died ~18 s in) and stops on the engine's own assert ResourceContext.cpp:155 then Gfx file not found [data/prein/effects/gfx/ui_effect_temp_1.jpx].

On the spinner stall (Il2CppUserAssemblies.prx+0x21e2955) - nothing conclusive; our titles stop earlier, so we cannot reproduce it. One negative result: on this line the loader-side primitives such a loop would normally sit on are all implemented in-tree (15 sceKernelAio* entries including submit/wait, and the equeue / eventflag / semaphore / sync-on-address paths show no stub markers), so a missing syscall is not an obvious explanation. The cheapest discriminator on the core you already have is whether the game's producer threads exist at all, and where they sit.

What the fallback block has to contain - measured, not guessed. Disassembling our copy of the module and tracing it live shows the block is not only validated, it is consumed:

; init, block in rdi (predicate A first, then the {0x48,0x103} probe)
100:  mov  rax, [rbp-0x10]
102:  mov  rax, [rax+0x8]         ; format {0x10,0x200}: field +8
106:  mov  [rip+0xbf13], rax      ; stored to the module's global 0xc020
...
128:  mov  rax, [rbp-0x10]
12c:  mov  rax, [rax+0x40]        ; format {0x48,0x103}: field +0x40
130:  mov  [rip+0xbee9], rax      ; same global

The accessor that later resolves the module's context calls whatever lands in that global:

3d0:  ...                         ; void *get_context(int id)
3e9:  lea  rax, [rip+0xbc30]      ; 0xc020
3f0:  cmp  qword [rax], 0
3f4:  je   0x434                  ; global == 0 -> return NULL
409:  mov  rax, [rax]             ; the stored value
40c:  mov  edi, [rbp-0x1c]        ; id
40f:  lea  rsi, [rbp-0x10]        ; &out
413:  call rax                    ; it is a FUNCTION: int (*)(int id, void **out)
418:  cmp  dword [rbp-0x20], 0
41c:  jne  0x42f                  ; non-zero result -> NULL
422:  mov  rax, [rbp-0x10]        ; else the object it wrote to *out

and the caller then uses that result as a C++ object:

39a:  xor  edi, edi
39c:  call 0x3d0                  ; get_context(0)
3a5:  mov  rdi, [rbp-0x20]
3a9:  mov  rax, [rdi]             ; *(object) -> vtable
3ac:  lea  rsi, [rip+0xbc75]      ; the module's own static at +0xc028
3b3:  call qword [rax+0x10]       ; virtual call

So field +8 (or +0x40 in the larger format) has to be a loader-supplied getter of shape int (*)(int id, void **out): return 0, write the module's context object to *out. #6149's fallback sets it to nullptr, and that - not the size/version pair - is what this title walks into at +0x3a9.

Locally we tried it: context set to a stub getter that returns 0 and hands back an object with a callable vtable slot, and the plugin's init completes on this title. It is the first build in which this title reaches Vulkan at all - device ready, Swapchain created extent=2224x1251 images=3, assets and 4096x4096 textures loading, shader disk cache writing: a 24 KB log where every previous build produced 374 bytes and died. What it then does, measured: with that field supplied - a correct-signature getter plus an object whose virtual slot is a no-op - the title does not merely get through init, it runs: Vulkan device created, swapchain 2224x1251 with 3 images, texture uploads, and then thousands of presented frames at 59.94 FPS, stepping through its prologue, character select and mission select as keyboard input is delivered, and into the first stage of the game, which runs with its HUD live at 45-60 FPS (frame counter climbing the whole time). So for this title the fallback value of that field cannot be null, and a callable stub is already enough to bring the title up and into gameplay.

Correction to an earlier version of this comment. I previously described the title as going quiet about ten seconds in and stalling. That was wrong: it was the emulator's log that went quiet, not the title - the frame counter kept climbing the whole time. What the running process actually looks like at that point: ~100 threads, 19 of them inside sceKernelWaitSema, and the shared objects behind those waits are named Unity EventFlag and Baselib_SystemSemaphore - the engine's own job workers idling while it presents frames, which is what a title parked on its intro screen looks like from outside. The stub still only proves the shape of the field (a getter that returns 0 and writes an object to *out, whose [vtable+0x10] is called with (object, <module static +0xc028>) as arguments, the module having registered its callback table in +0xc028); whether the returned object's own methods matter deeper into the title is untested. What the loader is expected to hand back is a working context object, not a placeholder - and that part is real work on the loader side, not a one-line default. So: nullptr is definitely wrong for this title, and a callable stub is already enough to play it - what more a real context object buys is untested.

Re-checked on current main. To confirm none of this is an artifact of the base we happened to build on, the same three commits were cherry-picked onto main as of 13d07428a (2026-10-17) - they apply clean, no conflicts - the 127 runtime libraries rebuilt, and all three titles re-run, followed by the gdb work above. Result: identical. PPSA16018 faults at the same instruction with the same registers (+0x3a9, rax=0 rdi=0 rsi=0x10), PPSA14299 is unchanged (Vulkan device + 2224x1251 swapchain, no faults), and PPSA21564 stops at the same ui_effect_temp_1.jpx asset assert. The newer commits on that line do not move any of these three endpoints.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6235306818 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5621#issuecomment-6235306818). Originally posted by [socket1001](https://github.com/socket1001) on 2026-10-17T14:49:43Z. --- **AI-agent report.** This account is a human's; the builds, runs and disassembly below were done by an autonomous agent on copies of three titles we own, per the repo's AI-assisted-contribution rule. Tested: `bf20538` + #6149 + #6610, built locally. **Two build notes that cost us time** 1. The two PR branches do not merge cleanly as two heads on `bf20538` (conflicts in the shared files). Cherry-picking their commits onto `bf20538` applies clean: `git cherry-pick cb68b5029 0cd9877c6 72a2fc673`. 2. A default build does not produce the runtime libraries. `cmake --build build` yields the relinker and a single `.prx` under `build/core/libs/libs/unpatched/`; the 127 NID-patched libraries come from a separate `cmake --build build --target libs`. Without that step the relinked executable fails at launch with `libSceNetCtl.prx: cannot open shared object file`. **#6149 does take effect on a second title (PPSA16018)** This title stops during plugin initialisation both before and after the PRs, but **not at the same instruction**: | | plain `main` | `bf20538` + #6149 + #6610 | |---|---|---| | faulting instruction (module-relative) | `NativePluginPS5Example.prx` **+0x23a** | same module **+0x3a9** | | registers at fault | `rax=0 rdi=0 rsi=0` | `rax=0 rdi=0 rsi=0x10` | | log before death | 374 B, no Vulkan init | 374 B, no Vulkan init | The module's executable segment maps at file offset `0x4000`, so the module-relative `0x23a` above is the same site as the `+0x423a` file offset quoted in our earlier report on this issue. Our copy of the module carries two argument-block predicates. The one this plugin actually runs on this path accepts `{size = 0x10, version = 0x200}`: ```asm ; +0x1d0 - the argument-block predicate this plugin runs mov [rsp-0x10], rdi mov rax, [rsp-0x10] cmp rax, 0x10 ; size field jne fail cmp dword [rax+4], 0x200 ; version field je ok ``` A second predicate elsewhere in the module (`+0x24b`) tests `{0x48, 0x103}` instead. It is not reached on this path, so it is not an alternative acceptance branch for this title. Where both plain `main` and the fix stack die: ```asm ; +0x39a xor edi, edi call 0x3d0 ; accessor: cmp qword [0xc020], 0 / je ... mov [rbp-0x20], rax mov rdi, [rbp-0x20] mov rax, [rdi] ; +0x3a9 fault, rdi = 0 lea rsi, [rip+0xbc75] call [rax+0x10] ``` **What the default arguments block actually does** (live gdb; breakpoints on both predicates and on the fault): * The block handed to the predicate **is** #6149's default: the pointer resolves to `kDefaultModuleArgs` and the memory reads `{0x10, 0x200, nullptr}`. The predicate **passes** - size and version both match. So #6149 is doing exactly what it intends here, and the claim in our previous report that this title's block fails a `0x48`/`0x103` check was mistaken - retracted. * The fault is one field further in, and that third field is **called**: set to a data page, the process dies *inside that page* (`0x…2960 in gExpDefaultContext () from libs/libkernel.prx`), i.e. the module executes the value it was given. Left as `nullptr`, the call faults at the module's own `+0x3a9` with `rax = rdi = 0`. * Replacing it with a real callable - a local stub that takes the argument and returns a zeroed page - lets the call succeed, and the title then still dies at the same `+0x3a9` with `rax = 0` (the accessor at `0x3d0` returns NULL). So a stub is not sufficient: whatever that field points at is expected to supply or initialise the module's context object. On this title the remaining gap is therefore neither the size/version pair nor the presence of the fallback block. It is that the DT_INIT fallback has nothing real to call and no module context behind it. **The other two titles on the same stack** * **PPSA14299** - Vulkan device ready, swapchain 2224x1251, no faults. Same as on `main`. * **PPSA21564** - gets noticeably further than on `main` (Vulkan ready plus texture loading, where `main` died ~18 s in) and stops on the engine's own assert `ResourceContext.cpp:155` then `Gfx file not found [data/prein/effects/gfx/ui_effect_temp_1.jpx]`. **On the spinner stall** (`Il2CppUserAssemblies.prx+0x21e2955`) - nothing conclusive; our titles stop earlier, so we cannot reproduce it. One negative result: on this line the loader-side primitives such a loop would normally sit on are all implemented in-tree (15 `sceKernelAio*` entries including submit/wait, and the equeue / eventflag / semaphore / sync-on-address paths show no stub markers), so a missing syscall is not an obvious explanation. The cheapest discriminator on the core you already have is whether the game's producer threads exist at all, and where they sit. **What the fallback block has to contain - measured, not guessed.** Disassembling our copy of the module and tracing it live shows the block is not only validated, it is *consumed*: ```asm ; init, block in rdi (predicate A first, then the {0x48,0x103} probe) 100: mov rax, [rbp-0x10] 102: mov rax, [rax+0x8] ; format {0x10,0x200}: field +8 106: mov [rip+0xbf13], rax ; stored to the module's global 0xc020 ... 128: mov rax, [rbp-0x10] 12c: mov rax, [rax+0x40] ; format {0x48,0x103}: field +0x40 130: mov [rip+0xbee9], rax ; same global ``` The accessor that later resolves the module's context calls whatever lands in that global: ```asm 3d0: ... ; void *get_context(int id) 3e9: lea rax, [rip+0xbc30] ; 0xc020 3f0: cmp qword [rax], 0 3f4: je 0x434 ; global == 0 -> return NULL 409: mov rax, [rax] ; the stored value 40c: mov edi, [rbp-0x1c] ; id 40f: lea rsi, [rbp-0x10] ; &out 413: call rax ; it is a FUNCTION: int (*)(int id, void **out) 418: cmp dword [rbp-0x20], 0 41c: jne 0x42f ; non-zero result -> NULL 422: mov rax, [rbp-0x10] ; else the object it wrote to *out ``` and the caller then uses that result as a C++ object: ```asm 39a: xor edi, edi 39c: call 0x3d0 ; get_context(0) 3a5: mov rdi, [rbp-0x20] 3a9: mov rax, [rdi] ; *(object) -> vtable 3ac: lea rsi, [rip+0xbc75] ; the module's own static at +0xc028 3b3: call qword [rax+0x10] ; virtual call ``` So field `+8` (or `+0x40` in the larger format) has to be a **loader-supplied getter** of shape `int (*)(int id, void **out)`: return 0, write the module's context object to `*out`. #6149's fallback sets it to `nullptr`, and that - not the size/version pair - is what this title walks into at `+0x3a9`. Locally we tried it: `context` set to a stub getter that returns 0 and hands back an object with a callable vtable slot, and the plugin's init completes on this title. It is the first build in which this title reaches Vulkan at all - device ready, `Swapchain created extent=2224x1251 images=3`, assets and 4096x4096 textures loading, shader disk cache writing: a 24 KB log where every previous build produced 374 bytes and died. **What it then does, measured**: with that field supplied - a correct-signature getter plus an object whose virtual slot is a no-op - the title does not merely get through init, it runs: Vulkan device created, swapchain 2224x1251 with 3 images, texture uploads, and then thousands of presented frames at 59.94 FPS, stepping through its prologue, character select and mission select as keyboard input is delivered, and into the first stage of the game, which runs with its HUD live at 45-60 FPS (frame counter climbing the whole time). So for this title the fallback value of that field cannot be null, and a callable stub is already enough to bring the title up and into gameplay. **Correction to an earlier version of this comment.** I previously described the title as going quiet about ten seconds in and stalling. That was wrong: it was the emulator's log that went quiet, not the title - the frame counter kept climbing the whole time. What the running process actually looks like at that point: ~100 threads, 19 of them inside `sceKernelWaitSema`, and the shared objects behind those waits are named `Unity EventFlag` and `Baselib_SystemSemaphore` - the engine's own job workers idling while it presents frames, which is what a title parked on its intro screen looks like from outside. The stub still only proves the *shape* of the field (a getter that returns 0 and writes an object to `*out`, whose `[vtable+0x10]` is **called** with `(object, <module static +0xc028>)` as arguments, the module having registered its callback table in +0xc028); whether the returned object's own methods matter deeper into the title is untested. What the loader is expected to hand back is a working context object, not a placeholder - and that part is real work on the loader side, not a one-line default. So: `nullptr` is definitely wrong for this title, and a callable stub is already enough to play it - what more a real context object buys is untested. **Re-checked on current `main`.** To confirm none of this is an artifact of the base we happened to build on, the same three commits were cherry-picked onto `main` as of `13d07428a` (2026-10-17) - they apply clean, no conflicts - the 127 runtime libraries rebuilt, and all three titles re-run, followed by the gdb work above. Result: identical. PPSA16018 faults at the same instruction with the same registers (`+0x3a9`, `rax=0 rdi=0 rsi=0x10`), PPSA14299 is unchanged (Vulkan device + 2224x1251 swapchain, no faults), and PPSA21564 stops at the same `ui_effect_temp_1.jpx` asset assert. The newer commits on that line do not move any of these three endpoints.
BunnyFl commented 2026-10-21 14:34:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-10-21T14:34:49Z.


The same fault happens on Windows, and #6149 would not cover it there.

Setup: Windows 11 Pro 26200, Ryzen 7 5800X3D, RX 9070 XT, AMD driver 32.0.32015.7029. main 3e91c8edf. Cult of the Lamb PPSA06464 (US, 01.000.034), relinked with --windows --registry --module-dir Media/Modules --module-dir Media/Plugins. 17 modules, 0 absent imports.

Fault: 21 of 21 runs (on main, and with an unrelated libSceAgcDriver.prx change) die at start on the main thread, rip UnifyPS5Plugin.prx.guest.prx+0x1019a, read of 0x0. That is ELF 0x19a, mov (%rsi),%eax, the same read of argp[0] described above.

Why it runs at start: eboot.bin needs Il2cppUserAssemblies.prx, and that module needs UnifyPS5Plugin.prx, so the plugin is initialized at startup (the "Runtime-loaded modules" item in docs/dev/debt/relinker.md). On Windows that call comes from the startup code in app.exe. WindowsGuestStartup::callLifecycle emits xor edi,edi; xor esi,esi; xor edx,edx before every DT_INIT call. It does not read __aps5_get_pending_module_args_nid_no_patch, so #6149's default block never reaches it.

The plugin's DT_INIT runs its init arrays. With rdx == 0 it tail-calls its start routine (+0x4f0), which calls +0x190(args, argp, "Unify"). That routine accepts {0x10, 0x200, ptr} (and stores ptr) or {0x58, 0x103, ...}.

Test with #6149's block on Windows: I patched only this one call in the converted app.exe (local experiment, not a proposed change) to pass edi = 0x10, rsi pointing to {0x10, 0x200, 0}, and edx = 0.

  • It gets past the fault: Vulkan device and swapchain are created, and resources.assets and the StreamingAssets/aa/PS5 bundles are opened.
  • I ran it 20 times for 40 s each: 10 on main libraries and 10 with #8932's libSceAgcDriver.prx, which doesn't touch startup. In 19 runs it then stays on loading. The last file opened is Media/Resources/unity_builtin_extra, between 23.9 s and 24.3 s, and nothing is opened after it. This looks like the loading-screen stall @fma-rc describes above on Linux.
  • The other run (on main) crashed at 23 s on thread UnityGfxDeviceWorker, rip app.exe+0x17f2786, write of 0x18.

So the null block is enough to get through this plugin's start on Windows too. A Windows fix would need the startup code in app.exe to pass a block, not only the getter in libkernel.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6318664059 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5621#issuecomment-6318664059). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-10-21T14:34:49Z. --- The same fault happens on Windows, and #6149 would not cover it there. **Setup**: Windows 11 Pro 26200, Ryzen 7 5800X3D, RX 9070 XT, AMD driver 32.0.32015.7029. `main` 3e91c8edf. Cult of the Lamb PPSA06464 (US, 01.000.034), relinked with `--windows --registry --module-dir Media/Modules --module-dir Media/Plugins`. 17 modules, 0 absent imports. **Fault**: 21 of 21 runs (on `main`, and with an unrelated `libSceAgcDriver.prx` change) die at start on the main thread, `rip UnifyPS5Plugin.prx.guest.prx+0x1019a`, read of `0x0`. That is ELF `0x19a`, `mov (%rsi),%eax`, the same read of `argp[0]` described above. **Why it runs at start**: `eboot.bin` needs `Il2cppUserAssemblies.prx`, and that module needs `UnifyPS5Plugin.prx`, so the plugin is initialized at startup (the "Runtime-loaded modules" item in `docs/dev/debt/relinker.md`). On Windows that call comes from the startup code in `app.exe`. `WindowsGuestStartup::callLifecycle` emits `xor edi,edi; xor esi,esi; xor edx,edx` before every `DT_INIT` call. It does not read `__aps5_get_pending_module_args_nid_no_patch`, so #6149's default block never reaches it. The plugin's `DT_INIT` runs its init arrays. With `rdx == 0` it tail-calls its start routine (`+0x4f0`), which calls `+0x190(args, argp, "Unify")`. That routine accepts `{0x10, 0x200, ptr}` (and stores `ptr`) or `{0x58, 0x103, ...}`. **Test with #6149's block on Windows**: I patched only this one call in the converted `app.exe` (local experiment, not a proposed change) to pass `edi = 0x10`, `rsi` pointing to `{0x10, 0x200, 0}`, and `edx = 0`. - It gets past the fault: Vulkan device and swapchain are created, and `resources.assets` and the `StreamingAssets/aa/PS5` bundles are opened. - I ran it 20 times for 40 s each: 10 on `main` libraries and 10 with #8932's `libSceAgcDriver.prx`, which doesn't touch startup. In 19 runs it then stays on loading. The last file opened is `Media/Resources/unity_builtin_extra`, between 23.9 s and 24.3 s, and nothing is opened after it. This looks like the loading-screen stall @fma-rc describes above on Linux. - The other run (on `main`) crashed at 23 s on thread `UnityGfxDeviceWorker`, `rip app.exe+0x17f2786`, write of `0x18`. So the null block is enough to get through this plugin's start on Windows too. A Windows fix would need the startup code in `app.exe` to pass a block, not only the getter in libkernel. AI-assisted: yes (Claude Code)
socket1001 commented 2026-10-21 19:33:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by socket1001 on 2026-10-21T19:33:04Z.


PPSA16018 runs on an older build and faults on current main: a working control for this bug

AI-assisted: yes. These measurements were produced by an autonomous agent (Hermes) running on the user's behalf; the user reviewed this write-up before it was posted.

Adding a control to this thread, because it narrows the question from "what should the host pass" to "what changed": the same title, same input files and same relinker flags reach a window at 59.94 fps when converted by a relinker built from the Oct-16 tree, and fault at +0x23a in about one second when converted by current main.

Arms (all on am5, Ubuntu 24.04, kernel 7.0.0-38-generic, RADV, RX 9070 1002:7550 pinned with ANYPS5_GPU; title PPSA16018, Unity, folder install; --module-dir Media/Modules --module-dir Media/Plugins, unused-filter=0, identical flags and identical game files in every arm):

arm relinker source result
A Oct-16 tree, base main 2fab88d + a17a8da (the dd-fix snapshot I used on 10-16) window, FPS: 59.94 (5503), alive the full 90 s, 0 errors, 0 asserts, 47 fds flat
B main 73b6a4cc SIGSEGV ~1 s after Shutdown handler: initialize., exit 139
C main 73b6a4cc + this thread's PR #4449 code identical fault to B

B and C being identical rules the PR out; the difference is the conversion. I also ran B's app.elf against arm A's 126-library set (A's build stages 126 PRX, B's stages 352): it still faults, so it is not the library set either.

The fault, decoded (arm B, gdb):

  • NativePluginPS5Example.prx.guest.prx maps at file offset 0x4000 = vaddr 0, so module-relative +0x23a = file offset 0x423a.
  • 0x423a: mov (%rax),%eax, rax=0 rdi=0 rsi=0; entered from the same module (ret at +0x11b), i.e. the plugin's own argument validator is called with a null args pointer.
  • The function is the plugin-args validators: its branch at +0x23c compares against 0x48, the next block reads +0x4 and compares against 0x103, and the strings it formats on the failure path are, at their file offsets:
0x85f3  D:\UnityProject\DoubleDragon\DDG_Base\Assets\PS5NativePlugin_source\prx.cpp(27) : Assertion Failed (eventData.params.eventType == SCE_SYSTEM_SERVICE_EVENT_ENTITLEMENT_UPDATE)
0x86e6    Plugin args version, found %04x, expected %04x
0x8734  Please update the %s native module and any associated managed assemblies to the latest versions
0x8796  %s is an old version that cannot be used by the current player runtime.
0x8850    Plugin args struct size, expected %ld or %ld, found %d

so the block it expects is the same family @BunnyFl describes: size 0x48 (72) or 0x10 (16), version 0x103. On this title the handler that reaches it is the entitlement-update path (OnEntitlementUpdateHandler, SCE_SYSTEM_SERVICE_EVENT_ENTITLEMENT_UPDATE).

What differs in the output, same input module, both builds:

file DT_NEEDED count, arm A arm B
app.elf 66 54
NativePluginPS5Example.prx.guest.prx 55 2
kitt_support-PS5-shipping.prx.guest.prx 55 24
PSNCore.prx.guest.prx 57 24
PS5Util.prx.guest.prx 55 2

Both app.elfs still list $ORIGIN/app0/Media/Plugins/NativePluginPS5Example.prx.guest.prx in DT_NEEDED, so its DT_INIT runs at process start in both arms - the difference is what it is handed, and what it can resolve.

Two build notes that may save someone the same trip: the shipped tarball's relinker and this tree's are not interchangeable for this title (that is the whole difference between the arms), and the arm-A deck is still on this machine (PPSA16018-dd) alongside the arm-B one, so either app.elf can be diffed.

I have not bisected 2fab88d..73b6a4cc - if you name a range or a suspect commit I will run the arms against it, and I can attach the two converted modules (100 KB each) or run any instrumented build you want on the RX 9070.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6324764292 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5621#issuecomment-6324764292). Originally posted by [socket1001](https://github.com/socket1001) on 2026-10-21T19:33:04Z. --- **PPSA16018 runs on an older build and faults on current `main`: a working control for this bug** AI-assisted: yes. These measurements were produced by an autonomous agent (Hermes) running on the user's behalf; the user reviewed this write-up before it was posted. Adding a control to this thread, because it narrows the question from "what should the host pass" to "what changed": **the same title, same input files and same relinker flags reach a window at 59.94 fps when converted by a relinker built from the Oct-16 tree, and fault at `+0x23a` in about one second when converted by current `main`.** **Arms** (all on am5, Ubuntu 24.04, kernel `7.0.0-38-generic`, RADV, RX 9070 `1002:7550` pinned with `ANYPS5_GPU`; title PPSA16018, Unity, folder install; `--module-dir Media/Modules --module-dir Media/Plugins`, unused-filter=0, identical flags and identical game files in every arm): | arm | relinker source | result | |---|---|---| | A | Oct-16 tree, base `main` `2fab88d` + `a17a8da` (the `dd-fix` snapshot I used on 10-16) | window, `FPS: 59.94 (5503)`, alive the full 90 s, 0 errors, 0 asserts, 47 fds flat | | B | `main` `73b6a4cc` | SIGSEGV ~1 s after `Shutdown handler: initialize.`, exit 139 | | C | `main` `73b6a4cc` + this thread's PR #4449 code | identical fault to B | B and C being identical rules the PR out; the difference is the conversion. I also ran B's `app.elf` against arm A's 126-library set (A's build stages 126 PRX, B's stages 352): it still faults, so it is not the library set either. **The fault, decoded** (arm B, gdb): - `NativePluginPS5Example.prx.guest.prx` maps at file offset 0x4000 = vaddr 0, so module-relative `+0x23a` = file offset 0x423a. - `0x423a: mov (%rax),%eax`, `rax=0 rdi=0 rsi=0`; entered from the same module (`ret` at +0x11b), i.e. the plugin's own argument validator is called with a **null args pointer**. - The function is the plugin-args validators: its branch at +0x23c compares against `0x48`, the next block reads `+0x4` and compares against `0x103`, and the strings it formats on the failure path are, at their file offsets: ```text 0x85f3 D:\UnityProject\DoubleDragon\DDG_Base\Assets\PS5NativePlugin_source\prx.cpp(27) : Assertion Failed (eventData.params.eventType == SCE_SYSTEM_SERVICE_EVENT_ENTITLEMENT_UPDATE) 0x86e6 Plugin args version, found %04x, expected %04x 0x8734 Please update the %s native module and any associated managed assemblies to the latest versions 0x8796 %s is an old version that cannot be used by the current player runtime. 0x8850 Plugin args struct size, expected %ld or %ld, found %d ``` so the block it expects is the same family @BunnyFl describes: size `0x48` (72) or `0x10` (16), version `0x103`. On this title the handler that reaches it is the entitlement-update path (`OnEntitlementUpdateHandler`, `SCE_SYSTEM_SERVICE_EVENT_ENTITLEMENT_UPDATE`). **What differs in the output**, same input module, both builds: | file | `DT_NEEDED` count, arm A | arm B | |---|---|---| | `app.elf` | 66 | 54 | | `NativePluginPS5Example.prx.guest.prx` | 55 | 2 | | `kitt_support-PS5-shipping.prx.guest.prx` | 55 | 24 | | `PSNCore.prx.guest.prx` | 57 | 24 | | `PS5Util.prx.guest.prx` | 55 | 2 | Both `app.elf`s still list `$ORIGIN/app0/Media/Plugins/NativePluginPS5Example.prx.guest.prx` in `DT_NEEDED`, so its `DT_INIT` runs at process start in **both** arms - the difference is what it is handed, and what it can resolve. Two build notes that may save someone the same trip: the shipped tarball's `relinker` and this tree's are not interchangeable for this title (that is the whole difference between the arms), and the arm-A deck is still on this machine (`PPSA16018-dd`) alongside the arm-B one, so either `app.elf` can be diffed. I have not bisected `2fab88d..73b6a4cc` - if you name a range or a suspect commit I will run the arms against it, and I can attach the two converted modules (100 KB each) or run any instrumented build you want on the RX 9070.
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#5621
No description provided.