Assassin's Creed Shadows (PPSA20397): early-boot segfault in a dead-handle clear on a task worker, after the launch packs mount #8514
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 akkadbakkad89 on 2026-10-20T14:28:27Z.
Title: Assassin's Creed Shadows (PPSA20397), Linux build under WSL2, host i7-10700, flexible memory 344 MiB.
Setup:
app.elfproduced by the relinker (--skip-syscall-check) from the title's owneboot.binplus the bundledsce_modulePRXs; the scenefakelibSPRXs are excluded (duplicate export NIDs after#-suffix stripping).app0/carries only the launch-chunk files named bystreaminginstall.ini(DataPS5_boot*.forge,shared_00*,WhiteRoom*,AnimusRoom, fonts, localization) — about 43 GB, not the full 316 GB image.What happens: the title boots through
sceNpAppLauncherInitialize(requires #8355 — withmain's stub the run aborts there), readsstreaminginstall.iniandlocalization.lang, opensDataPS5_shared_00,DataPS5_boot.forge(32.7 GB),boot_agc,boot_sound— all cleanly — then spawns ~30 worker threads and segfaults deterministically at ~1.1 s. ZeroNotImplementedcalls in the log; no failed opens except/app0/savecontent/save_data.png(ENOENT — the file does not exist in the package at all, so that is the intended path).Crash forensics (ptrace catcher; no gdb on this host):
rip= relinked eboot file offset0x4a12b:movl $0,(%rax)withrax = 0xdead000000000005.0xdead000000000000|slotis Anvil's own dead-handle sentinel — it appears 10+ times as an immediate in the original eboot, so this is a guest-side poisoned table entry, not an unbound import (all 5,927 registry imports resolved).0x4bf50(reads u32 entries via a cursor atrdi+0x20, end at+0x28) calls a handle-table helper at0x49a50which decodes the index (&0x3fff, 16K slots), loads the slot's object pointer and clears its first field — the slot held the sentinel instead of a live object.0x5246840:scePthreadMutexTrylockon the queue object →scePthreadAttrGetstackwrites stack bounds into the task → task state = 3 →scePthreadCondBroadcast→scePthreadMutexUnlock).Reading: the engine executes a job that walks a handle table and touches a slot that was never populated (or already torn down) — i.e. an engine-side ordering/initialisation assumption breaks under us, rather than a missing API surface.
scePthreadAttrGet/Getstacksucceed and fill real values, so the worker's own housekeeping is sound.Files the log shows opened before the crash (order, all OK):
streaminginstall.ini,localization/PS5-EU/localization.lang×2,DataPS5_shared_00.forge,DataPS5_shared_00_agc.forge,DataPS5_boot.forge,savecontent/save_data.png(ENOENT),DataPS5_boot_agc.forge,DataPS5_boot_sound.forge.Build:
mainplus #8355 (sceNpAppLauncherInitialize/Terminatelifecycle); the earlier audit-fed PRs (#8352 libc, #8290 psml) are not strictly needed to reach this crash but are in the image.Next step (not done): identify which subsystem's init was expected to fill that handle slot — the dispatcher's
rdiobject is a fixed global in the image's RW segment, so its writer should name the owning subsystem. The Japan world packs (DataPS5_Japan*.forge, ~25 GB) are intentionally absent and only load after this point, so they cannot be the trigger.Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-20T15:41:30Z.
Full call chain (relinker preserves file offsets 1:1, so these are guest file offsets):
0x5246840— confirmed generic task-queue worker:scePthreadMutexTrylockon the queue →scePthreadAttrGetstackwrites the thread's stack bounds into the task (+0x20) → task state = 3 →scePthreadCondBroadcast→scePthreadMutexUnlock→ executes*(task+0x38)->vtable. All calls are plain libkernel pthread ops.0x64e08c0(vtable'd job class; vtable is runtime-built so no RTTI available) calls0x16e5740.0x16e5740— a large table-driven decoder:bextrbitfield extraction →*(table+idx*8)lookups →0xffsentinel compares → bounded-array asserts ("Too many elements for %sArray. Size: %u, Max Size: %u").0x4bf50— walks a u32 stream (cursor atobj+0x20, end at+0x28), calls the handler per element.0x49a50— schema-driven attribute deserializer: loads a const descriptor blob at0x9e22000, performs virtual calls (*0x20(rax),*0x90(rax)), logs via a telemetry error call passing tokenON_ATTRIBUTEVALUE_COULD_NOT_BE_PARSEDplus an event-schema JSON fragment ("type":"CONTEXT_STOP","typeAttributes":[...]), decodes the slot index with&0x3fff(16K slots), and writes*slot = 0at0x4a12b— the slot held0xdead000000000005.Code-region identification: the surrounding
.rodatais Havok serialization + Anvil (scimitar::) internals —hkSerialize::Note::Import,Patches::V201620r1::Collide/V201820r1::Physics/V201920r1::Constraint,Patches::Current:Common,<Invalid PatchInfo>,hkcdDynamicTree,hknpConstraintData,hknpRagdollMotorConstraintAtom,enableDynamicBodyCollisions,OODLE ERROR : LZ corruption, plus PSR-SDK BVH paths (psr_cpu_interface_bottom_level_bvh_refit.cpp). So the crash sits inside the engine's serialized-data / attribute patch layer, on a worker, ~1.1 s after the launch packs mount.The dead-slot object (
rdi= guest vaddr0x881f09c) is a static const descriptor table in the image's R segment. No direct rip-relative references to it exist in the exec segment — it is reached through a container pointer, so the owning subsystem is still unnamed. Its entries are pointer-pairs into LOAD3 (0xb3a5ec-range) — consistent with a compiled schema/attribute registry.Read: during world/boot deserialization a worker job iterates an attribute table whose slot was never populated (or was released by a job that ran too early). That is an engine-side ordering/empty-state assumption, not an API gap — matches the zero-
NotImplemented, zero-failed-open log.In progress: will rerun and compare fault RIP/registers. If the crash moves, the newly loaded content narrows the owning subsystem.
Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-20T17:56:03Z.
Setup delta: complete
app0/extracted (all 10 forge packs verifiedscimitarmagic + sizes), relinked with--to-intel(see below), title-deferred modules (libaegir_f,libmemorywrapper_f) emitted toapp0/root via--module-dir .instead ofsce_module/.1. The dead-handle crash does not reproduce. With the full image the run went ~38 s with zero segfaults and zero
NotImplemented— Vulkan device up (llvmpipe), swapchain 1152x648, 73 trophies parsed, UDS/savedata activity,/download0/aegir/networkcache.dbcreated,/temp0/cache/online/*populated. The schema-deserializer dead slot was populated by pack content absent from the 43 GB launch set. It was never an engine bug or an API gap — a content-enumeration artifact of the minimal set.2. Next failure: SIGILL at file offset
0x3965190, instructionf2 0f 78 c8 20 18=insertq $0x18,$0x20,%xmm0,%xmm1(AMD SSE4a). Legal on PS5 Zen-2, illegal on the host i7-10700 (lacks SHA, CLWB, RDPID, SSE4A, CLZERO). The eboot contains 13 SSE4a sites (11insertqimm + 1insertqreg-form + 1extrq);libaegir_f.prxcarries 20 more (4insertq, 16extrq). The relinker existing--to-intelflag converts them — this run simply had not used it. Rebuilt with--to-intel: all immediate forms converted; the one register-forminsertqis already handled by the lowering path.3. Module-layout requirement found the hard way:
libaegir_f/libmemorywrapper_fassce_modulemembers becomeDT_NEEDEDand init eagerly — before the guest heap exists — so the aegir ctor allocator returns NULL (mov %rax,(%rax), rax=0, aegir file0x7d600). With--module-dir .they stay title-deferred (dlopen) and init correctly. Repro note for anyone rebuilding:--to-intel --module-dir .with system PRXs insce_module/.4. With correct relink: ~14 min of live execution (llvmpipe, software rasterisation — extremely slow; >10 GB RSS) through mass shader registration. No
NotImplemented, no segfault. Repeatedshader library prebuild skipped: image table snapshot disagrees with the static tablesis benign (caught, continues).5. Terminal failure is a clean throw, not a crash (SIGABRT via a recompiler
Require):shader 0x40731f5200 stage 7: ShaderRecompiler::Recompile: barycentric emulation on the mesh path needs 36864 bytes of mesh output memory, the device allows 32768.The guest pixel shader needs emulated barycentrics (llvmpipe has no
VK_KHR_fragment_shader_barycentric), and on the mesh path the emulation inflates mesh output to 36 KB vs the Vulkan spec-minimum 32 KB. Checkedvulkaninfoon every host GPU — llvmpipe, RTX 3070, Intel UHD 630 all reportmaxMeshOutputMemorySize = 32768, so this wall is not llvmpipe-specific and a discrete-GPU run would hit the same bound. This matches the documented gap indocs/dev/debt/shader.md(barycentric emulation throws on mesh pipelines / interfaces beyond device limits).Net: PPSA20397 now boots to in-engine shader compilation on the full image. No new AnyPS5 export gap was found along the way — the blockers were (a) launch-subset content, (b) host ISA missing SSE4a (solved by existing
--to-intel), (c) deferred-vs-eager module layout, and (d) the documented mesh-path barycentric-emulation budget. Closing the loop on the original crash: it needs no fix; it is a repro-setup artifact.Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-20T18:57:10Z.
Setup:
relinker.exe --windows --to-intel --skip-syscall-check --module-dir ., samerelink_src(eboot.bin.elf + 5 sce_module PRXs + aegir/memorywrapper deferred at app0 root). Windows libs rebuilt from the same worktree (feat/psml-mfsr-queries+ pending NpGameIntent changes); MinGW runtime DLLs copied besidelibs/. Driver 617.42 — the version flagged stable against thenvgpucomp64.dllcrash.Two environment findings first:
build-winlibraries were stale:libkernel.prxpredated the pipe-read/stdin kevent support, so the first run aborted atkevent: EVFILT_READ on a non-socket descriptor not implemented. Rebuilding libkernel fixed it — on Windows the guest registers EVFILT_READ on a pipe, which current source supports.libkernel.prxagainst older sibling libs then failed module load with error 127 (ordinal-shifted NID imports). Full-vintage rebuild of all libs resolved it. Lesson for repro: Windows libs must come from a single build — mixing vintages breaks ordinal binding.Run timeline (all timestamps guest log):
NVIDIA GeForce RTX 3070(driver 617.42), wave32 subgroups, mesh=1NotImplementedACQUIRE_MEM,SET_UCONFIG_REG,WAIT_REG_MEM_64— one 1000ms fence timeout, non-fatal, recorder recovered), texture streaming (mip detilingtiled->linearat +795s/+958s), storage-image writes, VRAM in use (~950 MiB of 7249 MiB budget),SaveStorageJournalwritten to/download0/save/shader 0x407335e400 stage 5: ShaderRecompiler::Recompile: stencil reference export emulation requires a proven set of at most 16 values-> abort.Correction to my previous comment: I wrote the 3070 would hit the same mesh-output bound because
maxMeshOutputMemorySizeis also 32768. It did not — the 3070 supportsVK_KHR_fragment_shader_barycentricnatively (fragmentShaderBarycentric=true), so the pixel shader took the native path and the mesh-output emulation never engaged. All 9,251 shaders recompiled without a single barycentric throw.New wall — also documented debt: NVIDIA lacks
VK_EXT_shader_stencil_export, solibSceAgcDrivertakes the stencil-reference export replay/emulation path, whichdocs/dev/debt/libSceAgcDriver.md(Stencil reference export replay) caps at 16 proven values from constant/select/phi exports. Shader0x407335e400(stage 5, fragment) exports a stencil reference the prover cannot bound to <=16 values ->Requirethrows -> abort. Same wall is expected on any NVIDIA device; AMD/Intel/lavapipe expose the extension natively.Net for PPSA20397: on capable hardware the title boots, renders the welcome screen, streams textures and writes save journals — the frontier is the stencil-export prover's 16-value cap in the AGC driver, not missing APIs. The run needed (a) current-vintage Windows libs, (b)
--to-intel, (c) deferred aegir/memorywrapper layout — all reproducible from this issue.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T19:15:30Z.
I checked the current
upstream/mainstencil replay path (StencilReplay.cpp):Values()stops proving a set once it exceeds 16 values, butStencilReferenceValues()then returns all 256 byte values, andDraw.cppexplicitly supports that replay path. I could not find the reported “requires a proven set of at most 16 values” error in currentmain; the related current-main failure for an unsupported device is the replay-safety check. This makes the reported 16-value wall look tied to the extra, unsubmitted replay-proof change mentioned in the issue. Could you record the exact commit used for the Windows run (and whether it includes that change), plus the shader/export expression that fails? That will distinguish a current-main gap from a limitation in the local experiment before anyone starts a patch.Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-20T19:44:47Z.
Windows-run details, answering the request above.
Commit / provenance. The run was built from worktree HEAD
127e8ad06(branchfeat/psml-mfsr-queries); thelibSceAgcDriversources in it sit on the Oct-16 based9b696ddb(merge of #6902). That base predates7563b4a48(#6762, op-val export) andf4a4b8aea(#7006, 256-value replay), so it still had the old unbounded-set -> empty -> "at most 16 values" path. No extra unsubmitted replay change — just an older checkout plus throwaway debug instrumentation.Shader / export expression. Decoded the
RecompileRequest: stage 5 fragment, 624 code words at0x407335e400. TheMrtZstencil export resolves toSelectU32(kept_lane_mask, ImageRead(...).y, const)— a texture-derived per-pixel stencil ID (material/decal mask). Statically unbounded, so on current main it becomes the 256-value replay.Draw state at the throw (instrumented
materializeDrawStage):samples=4(4xMSAA)REPLACE, compareALWAYS,cmpMask = wMask = 0xff,ref = 0ALWAYSSemantically an unconditional stencil-ID splat:
stencil[pixel] = imageRead.y & 0xff; the compare never gates.Where it stops on current main (ran the request through the pipeline locally with the safety check instrumented):
StencilReferenceValues-> unbounded -> all 256 (the old gate is gone)StencilReplaySafe-> fails insideMaskReplaySafety::CheckatmaskStable()on an own-mask writer — the shader'sBallot/WqmU64helper-lane bookkeeping → throws "stencil replay refuses stages with side effects, clocks, subgroup dependencies or primitive ID inputs"samples=4trips "stencil replay requires single-sample rendering"So the title's true frontier on main is the replay-safety analysis plus the MSAA gate — not the prover. The draw writes stencil unconditionally per pixel from a texture fetch; a 256-pass replay would also cost 256x4 MSAA fragments per triangle.
Full run log: ~16 min, 9,251 shaders recompiled, zero
NotImplemented, welcome screen rendered, save journals written — abort only at this stencil draw.Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-20T20:37:59Z.
Verified on hardware — rebased the same worktree onto current
main(picks up7563b4a48+f4a4b8aea), rebuilt all Windows libs one vintage, reran.The title now dies at the replay-safety gate, not the prover:
Same class of presentation draw as before (fragment, texture-derived stencil export, VideoOut worker), ~728s in this time — the cold shader recompile ate the difference (new recompiler hash invalidated the disk cache: ~8,900 shaders rebuilt). So confirmed: the unbounded-export path reaches 256-value replay, and the next barrier is
stencilReplaySafe/maskStableon the shader'sBallot/WqmU64helper-lane bookkeeping, with the 4xMSAAsamples == 1gate behind it.Unrelated build note while I was here:
maincurrently does not build Windows tests under MinGW —tests/execution/ImageArrayWindowPastLayerLimit.cpp(fromed599f525b) usesalignas(65536)which exceeds the COFF object-file max of 8192. Libs are unaffected; only that test target fails.Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-20T20:45:00Z.
Closing as resolved — the reported crash was a launch-subset content artifact, not a runtime bug.
The dead-handle clear never reproduces once
app0/carries the complete image: the slot the task worker cleared is populated by a forge pack absent from the ~43 GB launch set this report was captured on. With all packs mounted, the title runs minutes past the 1.1 s crash point — on Windows/RTX 3070 it presents real boot cinematics (~25 FPS, 9,000+ shaders, save journaling) before stopping at an unrelated stencil-replay emulation gate.Two genuine gaps this report did surface are fixed upstream or in flight:
sceNpAppLauncherInitializelifecycle — #8355insertq/extrq) — the relinker's existing--to-intelcovers it; usage recorded in the thread belowBring-up continues in the game thread: https://github.com/boykopovar/AnyPS5/discussions/8674 — current frontier is the stencil replay-safety/MSAA emulation described in the comments above.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T20:45:19Z.
Thanks for the full-image and current-main reruns. This confirms the original dead-handle crash was caused by the incomplete launch content and does not reproduce with the full image. The later current-main stop is a separate stencil-export replay-safety/MSAA limitation in documented debt. It may be clearer to close this crash report and track that renderer limitation in its own issue, preserving the exact current-main reproduction and draw state there.
Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-21T14:47:10Z.
Runtime datapoint on the stencil-replay gate (Windows, RTX 3070 — no VK_EXT_shader_stencil_export):
Tested a stack of current main (
27bcd6a2) + #9017 (a7f50e9d) + #9030 (393a8e8c). Those two changes do help — the title now gets much further than before: Vulkan device and swapchain come up, trophy UDS parsing runs, save mounts succeed, and ~2,300 shaders compile to the disk cache.But it still aborts on the same class of gate, on a different shader:
(The earlier reported shader was
0x407335e400— that one now gets through; the next stencil-ref writer trips the check instead.)So #9017+#9030 are necessary progress but not sufficient for this title —
0x407325e400failsStencilReplaySafein a way those two don't cover yet. I can dig into that shader's ref provenance next if useful.Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-21T16:58:07Z.
Root-cause update on shader
0x407325e400(the stencil-exporting pixel shader that still aborts after #9017 + #9030): I captured its liveRecompileRequestand replayed it deterministically withagc_shader_replay --materialize, instrumentingMaskReplaySafetyto log each gate. The shader fails four distinct verifier checks in sequence — each peeled only reveals the next:pairedidentity check (maskStable,helpers): the mask composesextract(wqmA, 0)(low) withextract(wqmB, 1)(high) where wqmA/wqmB are two distinctWqmU64IR nodes — the GCN has twos_wqm_b64ops over duplicateBallot(exec)sources (values #2573/#2587, same block, nothing between them butWqmU64itself). The verifier paired words by object identity (==) →paired=0. Fixed by #9266 (structural equivalence, with a no-exec-mask-mutation-between check); instrumented replay confirmspaired=1on all six mask sites.Provenance of
wqm(ballot(true)): the construct's predicate isConstantBool(true)→onHelper= 1 → the old*low==0 && *high==0test yieldsUncertain. Already covered by #9017 — itsBoolean(pred, true) → QuadStableline handles exactly this; my independent implementation of the same relaxation was dropped as a duplicate.optionalBodyregion shape: the shader's exec guards are a nesteds_cbranch_execzcascade (block_0's body is block_1, itself anexeczbranch — CFG dumped via--cfg). The single-block shape check fails with "terminator shape". Covered by #9030's region walk; with it stacked, verification reaches gate 4.quadObservedon a merged phi feeding a nested exec condition (the remaining blocker, no open PR covers this): merge block 10's phi #14620 merges twoSelectU32s (skipped/taken), andLogicalNot(phi)(#9194) is theExecZerocondition of nested block 7.inactiveEqualsproves the phi inactive-consistent, butquadObservedrejects any phi used by a lane-coupled (execz/vccz) condition. This rejection is arguably correct — the phi merges per-lane selects, and a lane-varying predicate driving exec is genuinely unsafe under quad-broadcast replay — unless the verifier can prove the merged values quad-uniform (e.g. if both sides are themselves whole-quad mask words). That needs quad-uniformity provenance through selects/phis, which is new analyzer machinery rather than another local relaxation.Current stack for the title:
main+ #9017 + #9030 + #9266 clears gates 1-3; gate 4 remains and is the next real blocker for PPSA20397's stencil path. The.reqfixture (11 KB) is retained locally and can be attached if useful fortests/ShaderReplayRequests.cpp.Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-21T18:16:39Z.
Follow-up on the
0x407325e400stencil-replay chain — the fourth gate is now implemented and the shader clears the verifier end-to-end.Rebased on current
main(6b6c7016), stacked: #9017 + #9030 + #9266 + #9317.The remaining
quadObservedrejections turned out to be three over-counts of lane-local consumers, matching gap 2 of the Onimusha follow-up on #7006:-> LogicalNot ->nesteds_cbranch_execz) was rejected even thoughcontrol()proved that branch safe.controlProven()(memoized, with a visiting set for nested cascades) now exempts condition uses whose consuming branch is proven; unproven ones still reject.Ballot -> extract words -> & wqm halves -> SelectU32(lane<32) -> shr(lane&31) -> &1, i.e. each lane reads only its own ballot bit. ABallotis exempted only when every use completes that exact funnel; the isolated per-lane bools keep being walked, and any other ballot use still rejects.ImageSampleRawwithLevelZeroflags; explicit-LOD ops compute no implicit quad derivatives, so per-lane args are lane-local (same ruleMaskedSelectEliminatoralready applies).Also needed:
optionalBody()'s region set had to become per-invocation — nestedcontrol()proofs were unioning inner and outer regions.Validation:
agc_shader_replay --prepareon the captured request now printsprepared: 96161 SPIR-V words—StencilReplaySafeaccepts the shader. It then stops inSrtWalker::EvaluateRuntimeSources(descriptor source 0 dword 0unresolved from the captured memory) — a separate runtime-materialization limitation, not the verifier. Five newagc_masked_selectcases cover each exemption and the conservative rejections; the positive cases fail when the change is reverted.Full flow for this shader: mask pairing #9266 -> EXEC-copy provenance #9017 -> multi-block optional bodies #9030 -> quad-observation accounting #9317 -> remaining: SRT descriptor evaluation at capture.
Generated with Devin