Deterministic crash at frame ~800 entering the intro mission (fbk_stry000 prestream): null-pointer write in title code #404
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by wz11wz on 2026-11-27T16:57:59Z.
Environment
M1 Max (64 GB), macOS 26 (Darwin 27.2), console=series-x, commit
5e986bb(the #375 branch;VICTORY_METALFX=1was set, but the FidelityFX interception never ran in these sessions - zeroffx*calls logged - so this crash is independent of that experiment).Reproduction
Windowed interactive runs, advancing past the menus with Enter. Two runs crash deterministically: frame 807 and 799 (~2m25s / ~2m15s in). By contrast, two headless runs with auto-Enter (240 s and 600 s, frames 6784 and 17792) never crash.
Signature
~4 s before the first fault, one warning:
work held for a wait that does not hold: ["fence 0x6000021e1e00: ..."].Both crashes sit at the same script state
fbk_stry000_FBK_STRY000_INTRO<1833.103394, 139.042648, 15.986642>The intro mission is pre-streaming its assets when the null write happens - same camera, same barrier count, ~10 frames apart in two independent sessions.
crash log 1 (frame 807)
crash log 2 (frame 799)
Asked in #381 alongside this: what run setup and input sequence reaches the prologue world. Happy to test any recipe and report back.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by alexballvideos-netizen on 2026-11-27T20:21:39Z.
image+0x55e56f8looks like a side effect, not the cause. I've hit the same address 4 times on an M3 Max, 36 GB (Series X,86786a72anda3b26747), and in each log the order is the same:work held for a wait that does not hold(fences 4 to 5 signals behind the GPU), thenmetal: N command buffers were never reported on by the GPU ... (the first unreported for 22.1s). The warning repeats every 5 s, and audio peak drops to 0.0.first-chance exception code=0xc0000005 at=0x1423cf683 info=[1, 0] rax=0x0. At that address the title deliberately writes a constant to address 0, which is how it stops itself (a watchdog or fatal-error path), not a stray null pointer.BacktraceBreakpad ... http_upload.cc:488parameter lines).0x1455e56f8, inside the report path: a read through a null member of an object the reporter is writing into. That is the one VIctory prints asunhandled exception ... at image+0x55e56f8.Our host logs
GetProcAddress: not implemented dll="dbghelp.dll" symbol=MiniDumpWriteDumpin the same runs, so the reporter may be running on a partly set-up path. That's a guess, not proven.So all of these crashes probably come down to "the title's watchdog fired, then its crash reporter faulted". The thing to chase is step 1, the GPU stall or out-of-memory (#79 on my Mac, the OutOfMemory errors in #430), and maybe the unsignalled cross-queue barrier in this issue's crash logs. To the reporter: if your log still has the lines before the first
0x1455e56f8, could you grep for0x1423cf683,does not holdandnever reported on? That would show whether your frame-800 crash has the same first step.For comparison, the latest main (
b998bb65) ran 300 s headless to frame 2748 on the same Mac with no stall and no crash. Counts and addresses only.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by maaalrey on 2026-11-27T20:52:03Z.
To help separate the causes: the twelve freezes I reported in #456 (M4 Max,
c1b9587and86786a7; six in a new game, six loading a save) have none ofwork held for a wait that does not hold,never reported on by the GPUorcommand buffer failedanywhere in their logs. The six new-game ones end with a fault at image+0x2215c35 and then image+0x55e56f8. In all of them the main thread waits for a job thread that spins in title code.So image+0x55e56f8 has at least two ways in: the GPU going quiet, as in the logs above, and that one.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by alexballvideos-netizen on 2026-11-27T21:08:16Z.
Agreed, thanks. That matches a run I had an hour ago on the M3 Max (main
b998bb65, Series X,VICTORY_DEPTH_TWINS=0): first fault atimage+0x2215c35, thenimage+0x55e56f8, with nodoes not holdornever reported online in the log. So that's your #456 path, not the GPU one. That makes at least two triggers for the same final address: the watchdog write at0x23cf683after a GPU stall, and the0x2215c35fault with a job thread spinning.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by wz11wz on 2026-11-27T23:06:13Z.
Confirming path (a) from an M1 Max 64 GB (macOS 26, console=series-x, commit
5e986bbvia #381): two windowed interactive sessions died exactly your way. Both logs carrynever reported on by the GPU(1x each) plus the repeatingwork held for a wait that does not holdfences (9x and 11x), then the0x23cf683write fault and the0x55e56f8landing, at frames 807 and 799. Both crash logs are attached in #404's description.One extra data point worth knowing: both our stalls were windowed interactive runs, while our two headless runs (auto-Enter, 240 s and 600 s, frames 6784 / 17792) never stalled - so either headless suppresses the trigger or the stall needs more runtime than those windows. Logs live in
runs/20261128-004010-Fk95ib/andruns/20261128-004502-pstqdR/if the command-buffer timeline is useful.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by wz11wz on 2026-11-27T23:18:47Z.
Since path (a) reproduces for us deterministically (M1 Max 64 GB, windowed interactive, the transition into the intro mission, frame ~800 - two sessions, frames 799/807), here is how we plan to localize which submission the GPU never completes, with tooling that already exists in the tree. Corrections welcome before we start.
The gap.
never reported on by the GPUsays a committed command buffer never completed, but not which one: a world frame is thousands of submissions, and D3DMetal answers timestamp queries with zeros, so GPU-side timing probes are out.What the tree already has.
gpu_pass.rs(VICTORY_GPU_PASS_TIMING, VICTORY_GPU_PASS_CUTS) already re-submits a frame's host lists one by one and waits on each - exactly the shape needed for hang attribution, minus the timing:Two notes from the gpu_pass doc we will respect: each cut ends a Metal render pass, so loads/stores are re-paid (fine for localization, not for time); and the pass-timing path disables Wait-Before-Prep overlap, which is fine for the same reason.
If this lands on a pipeline, the follow-up questions (translated MSL loop? mesh pipeline on TBDR? submission dependency?) become ordinary bisection. We can send the per-list bisect as a small PR behind a diagnostics switch, or a tester-report follow-up with the bisected frame attached - say which you prefer.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by wz11wz on 2026-11-27T23:34:11Z.
The per-submit attribution landed -
VICTORY_TRACE_GPU_FAILS=1already names the hung command buffers (labels + encoder trace, no code needed), and one boot-crash run caught the stall mid-flight. Findings from the 21 in-flight warnings (runs/20261128-072239-seoRGT/victory.log, M1 Max, 8 minutes into the run):Every hung buffer has waits=0 (21/21), 11 of them signals=0: the GPU was handed work with no dependencies and never finished executing it.
The hung buffers are compute-heavy. The dispatches inside them, by frequency:
(
1e84848falso dispatched at 8x8x1 / 4x4x1 / 2x2x1 - a mip/tile pyramid pattern.)Timeline matches the 25-30 s pattern: first in-flight warnings at 23:29:54, crash at 23:30:33.
So the GPU-stall path starts with translated compute shaders hanging the GPU - dozens of tiny 1x1x1 dispatches look like per-item or spin-style kernels, and a translated MSL that polls memory nothing ever writes (or an MSL loop that never exits on Apple GPUs) would produce exactly this: buffers with no waits that never complete, fences falling behind, then the title's null write.
Anyone can check their own stall logs the same way:
grep -E "command buffer in flight for" <log>then collect thecompute <hash> <dims>lines. If the same hashes show up on other machines, that pins the four shaders above as the first suspects - and the shader cache can dump their translated MSL for a read-through. We can dig into the MSL of the top hashes next.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by wz11wz on 2026-11-28T02:31:37Z.
Root cause found and reproduced: a macOS GPU watchdog kill cascades into the
waits=0stalls, and the title crashes on the fence that never advances.We ran the frame~800 repro headless for 240s with
VICTORY_TRACE_GPU_FAILS=1and can now name the whole chain with logs.1. The stalled kernels are exonerated. The six compute containers the attribution blamed were dispatched on this stack alone (translated by MSC, game dims, fence timeout) plus two controls of our own — all finish, including 64 back-to-back lists.
spincheckover their IR shows none of them contains a single loop, so a data-dependent spin inside a kernel is impossible. Test added asvictory-gpu/src/native/suspect_tests.rs(containers undervictory-metal/tests/suspects/).2. The
waits=0signature is the residency-order cascade, not N separate deadlocks. With residency sets ordered on the queue (the default on ≥32 GB machines), every command buffer encodes a wait on the queue's order event — a wait the trace label does not count (waitsis only the title's cross-queue waits). One command buffer that never reports holds every later one on that queue, all showingwaits=0. Reproduced with a deliberately spinning kernel: root hangs, a trivial follower hangs too,order_state() == (0, 2). A spinning compute kernel is not killed by the macOS watchdog within 8s, so the cascade persists.3. The root in the real run:
kIOGPUCommandBufferCallbackErrorTimeout. At t=136.8 — the deterministic crash point — the watchdog killed the frame's command buffer:Then the cascade: six followers
in flight 6.5sallwaits=0, four other queues held on one fence (0x18437ff38 cmp 7 ref 0x99a now Some(2457)— the value stalls exactly there), and two command buffers recovered by the host timer 10.9s later. ~25s later the title dies:— the same landing address as the original report.
4.
VICTORY_PASSES_PER_BUFFER=8does not avoid it. The timeouts still fire at the same point (a 10-pass piece and a 0-pass, signal-only buffer were killed together — the kill seems to sweep the queue's in-flight work), the same cascade follows, and the crash reproduces at the same address.So #404's two paths collapse into one: the GPU-timeout kill starves the fence chain, and the title walks into an unsignaled fence. The stall is not a Metal bug we can fix; it is this title's Prestream-zone submission exceeding the ~5s watchdog budget on Apple Silicon.
Fix directions, cheapest first:
Queue::order_state()); warning at the next submission on that queue (patched locally) names it immediately, since the label'swaitsnever will.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sheffy007 on 2026-11-28T02:47:51Z.
/claim
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T02:48:01Z.
Claimed by @Sheffy007. Open a draft pull request with
Refs #404in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by wz11wz on 2026-11-28T04:28:07Z.
Follow-up: the stall lives in the residency-ordered submission path —
VICTORY_METAL_RESIDENCY_SETS=0avoids the crash (2/2 clean runs).After the analysis above we bisected by residency mode. Same 240s headless runs, same build (plus an unrelated order-counter atomicity fix):
VICTORY_METAL_RESIDENCY_SETS=0(unordered)This matches the status evidence: with ordering on, the stalled command buffers sit at
MTLCommandBufferStatusCommitted/Scheduled forever (never Scheduled/Started), i.e. the queue's order-event chain starves; with ordering off there is no order-event chain, and the same frames run clean.Two additional fixes found on the way (in our tree, can be split into PRs):
Queue's order counter was aCell<u64>read-modify-write, and the tail re-read it for the signal and forOwed— under concurrentExecuteCommandListson one queue (legal in D3D12) two command buffers could share an order slot and the tail could signal a slot another submission was waiting on. Now an atomicfetch_add, with each submission signalling its own slot.victory-shader --example dump_dxil— dumps the DXILtranslate_withproduces per container, which is how we extracted and audited the freeze-window kernels (all bounded loops; no kernel spin).What we cannot yet explain: why an ordered queue's command buffer never gets Scheduled. Candidates: the order wait interleaved with cross-queue fence waits forming a cycle, residency-set allocation ordering, or Metal scheduler behaviour with many queues waiting on shared events. With ordering off there is a real hazard-tracking regression (heap accesses are invisible to Metal), so this is a workaround for this title, not the final fix — but it unblocks reaching the world for M2-style work while the ordered path is investigated.
Immediate workaround for anyone hitting the deterministic frame~800 crash on ≥32 GB machines:
VICTORY_METAL_RESIDENCY_SETS=0.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by wz11wz on 2026-11-28T04:39:05Z.
Correction to the workaround above:
VICTORY_METAL_RESIDENCY_SETS=0is not reliable. A third run with it crashed the same way —unhandled exception 0xc0000005 at image+0x55e56f8at t=168 — with zero GPU Timeout kills in the log. So the ordered-queue starvation (Committed/Scheduled stalls) is one stall shape, but the title crash also happens without any timeout sweep and without ordering; the two earlier clean runs were variance, not the fix. The status-probe and kernel-exoneration findings stand; the root cause is still open. Sorry for the premature workaround claim.What the crash run added: the FidelityFX loader binds (
amd_fidelityfx_loader_xbox.dll: 4 hle, 15 host, 3 title), and the freeze window is unchanged (t≈168). Also found while verifying the MetalFX serving seam (issue #375):fidelityfx::use_host_diris currently only reached from a test — the app's startup never calls it on any platform, so the "host serves the title's upscaler" path (M1.6's flip) can never log or engage outside tests. Wiring it into startup looks like a missing piece of #375 independent of this crash.