Ratchet & Clank: Rift Apart: stack overflow in RegisterShader on a 48 KiB guest thread since #1988 #2603
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 EdouardSence on 2026-10-10T08:20:51Z.
What
Since #1988, Ratchet & Clank: Rift Apart (PPSA01474) dies about 12 s after start on Linux with a
SIGSEGVand no log line. The stack overflows insidesceAgcCreateShader:si_codeisSEGV_MAPERRand the fault address isrsp - 8, at the firstcallafter the prologue.sub $0xc478,%rsp, soRegisterShaderreserves 50,296 bytes of stack before calling anything. On the probe build I used earlier it reserved0x18608bytes. It depends on what gets inlined into it.scePthreadCreate(logged locally):Job Hi 0..7,Job Lo 0..7Render Thread,File Video Stream,Archive Loose IOUser Trophy Thread,User UDS ThreadBefore #1988, every guest thread on Linux ran on the host's default 8 MiB stack, so this never showed. Now the thread gets exactly what the title asked for, which is correct for the title's own code. But AnyPS5's HLE code runs on that same stack, and a call that is a light system call on the console runs the shader recompiler here.
Measured
Linux (CachyOS, GCC, Release), RX 9070 XT, RADV / Mesa 26.2.4, headless gamescope, scripted input.
main3539d1ceSIGSEGVat about 12 s, 3 of 3 runs (one withAPS5_NO_WRITE_WATCH=1)main3539d1cewith #1988 revertedAGC driver: prepared shader artifact is missing for the requested static ABI ... stage=5, which is a separate issueOptions I can see (not tested)
RegisterShader's frame. That only moves the limit; Windows already has the same exact-size stacks.I can't open a PR at the moment (
pr-intake), so I'm leaving the choice and the fix to whoever picks this up. I can rerun the title on any candidate. cc @NevesHenryTested and written by Claude (AI assistant) on a contributor's machine.
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-10T16:08:46Z.
Another title with the same cause, where it shows up as memory corruption instead of a clean
SIGSEGV: Hollow Knight: Silksong (PPSA12544) on Linux (RX 9070 XT, GCC 16.2, Release).The title creates most of its threads with 131,072-byte stacks (49 threads; one asks for 256 KiB and one for 1 MiB). About 0.25 s after start, the thread that submits command buffers (
sceAgcDriverSubmitDcb→Driver::Submit→copySegment→readRegisterLists→validate→Pm4::ReadIndirectRegisters→GuestMemory::Read→FlushForAccess) faults on a null pointer. TheHostThreadLocalvectorQueuedLabelRangesin that thread's TLS has begin0and a non-null end. So the TLS had been overwritten before the fault, not merely overflowed into a guard page.On
main425421276+ #846 + #861 + #1431 (conflicts resolved locally), with onlypthread_attr_setstacksizein the LinuxscePthreadCreatechanged:main)So a fixed host reserve on top of the requested size, your second option, is enough here. It also suggests that what a smaller overflow does is not always a fault on the stack itself.