Recurring CRASH 0xc0000005 (0x4fffffffb / -1 link) in global 0x14908f020 allocator (+0xad533c, +0x2626911) #142
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem#142
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?
@Lightje on GitHub · 2026-12-02 00:37 UTC · original
Title
Crash (
0xc0000005) atvictory-image+0xad533cnear end of boat mission (int_chase_mcs1_plane_land)Environment
lobomfz/VIctory-xmem@f7f03606.18.6411.22(patched wineserver), patched Mesa26.3.1(RADV), vkd3d-proton71cae091./run.sh play(defaults: Series X profile,2560x1440, RT on)930.048.020-vb_sub_story(v1.0.2.1)Description
Game ran smoothly for ~40 minutes (64,050 frames), then hit an unhandled write access violation (
0xc0000005) right near the end of the boat mission (Current Vehicle: Dodo,Current SRL Name: int_chase_int_chase_mcs1_plane_land), ~2s afterinput context changed menu=true.Not an OOM or GPU hang:
memory.load_percentwas75%(~7.9 GiB free),TileHeapwas2890/6236 MB, systemd scope peak was8.9G, andjournalctlshowed noamdgpureset/hang.Notice in the registers that
rax = 0x361eb4690andr11 = 0x4fffffffb(0x361eb4690 + 4 * 0x4fffffffb + 2 = 0x1761eb467e), which looks like an integer underflow / out-of-bounds write offset.Crash Log
Breakpad Context
@Lightje on GitHub · 2026-12-02 01:27 UTC · original
Title
Recurring
0xc0000005(0x4fffffffb/-1sentinel index) in 20-byte intrusive doubly-linked pool (+0xad533cand+0x2626911)Environment
lobomfz/VIctory-xmem@f7f03606.18.6411.22(patched wineserver), patched Mesa26.3.1(RADV), vkd3d-proton71cae091930.048.020-vb_sub_story(v1.0.2.1), Series X profile,2560x1440, RT onSummary
Hit two crashes (~40 min and ~22 min into play) that never occurred on Windows (
victory-data/crashes.loghad 0 occurrences), both in different functions operating on the same 20-byte-stride intrusive doubly-linked list/pool structure (unlinked viamovq $-1, ...).In both crashes, a 16-bit link index read from a node was already
-1(0xffff), which was zero-extended to0xffffffff(* 5 = 0x4fffffffb,* 4 = 0x13ffffffec), causing an out-of-bounds write0xc0000005. Neither crash was OOM or GPU-hang (memory.load_percent70–75%,TileHeap2.3–2.9 / 6.2 GB, noamdgpureset injournalctl).Crash 1 (
./run.sh play, 40m 25s, frame 64050)Disassembly around
+0xad533c:Crash 2 (
./run.sh play VICTORY_PAGE_ADAPTIVE=1 VICTORY_POOL_MOVE=1, 21m 58s, frame 27587)Disassembly around
+0x2626911:Crash (to Recurring CRASH 0xc0000005 (0x4fffffffb / -1 link) in global 0x14908f020 allocator (+0xad533c, +0x2626911)0xc0000005) atvictory-image+0xad533cnear end of boat mission (int_chase_mcs1_plane_land)@HioShan on GitHub · 2026-12-02 03:19 UTC · original
Same allocator as the hang in #57 (the worker spinning at
+0xad522d..+0xad5241, then the watchdog's null write at+0x2215c35). We hit that hang on an RX 9070 XT (85 min in, a car chase,VICTORY_PAGES=0, RT off) and read the code around it. Notes, plus a read-only guard that should show what damages the lists the next time it happens.The structure (this title build,
b99f876b74d4a77f):[+0x908f020]node array,[+0x908f01c]node count (5603 in our runs),[+0x908f02e]where the search for a free slot starts (0xaf0 = thecx/r10in the dumps above and in #57).u16 prev, u16 next, u16 prev2, u16 next2, u32 start, u32 size. Both lists are doubly linked and end in0xffff. A node off them has0xfffflinks andsize0. A freed slot is set to-1(movq $-1).+0xad5100moves a range's node down to the lowest free slot at or above[+0x908f02e]. It then followsnextwhile the index is below that start, to link the node into the second list. A loop of low indices keeps it there forever (#57).+0xad533cand+0x2626911here are the same lists with a-1where a successor was expected.lock cmpxchg, with the ownerGetCurrentThreadId()cached in the title's TLS at+0x1454. We found nothing wrong there.0x22004: CPU-cacheable, GPU read-write. In our run log that is the 1.1–1.7 GB block at0xd43000000/0x100c00000; the0x11aa…arrays in #57 and here are inside the second one. With xmem the card reaches that memory directly. With the copy-based forks it only ever wrote host copies. That would fit "only on xmem, never on Windows, RDNA 2/3/4, RT on or off, pages moving or not". It is not proven: a race made visible by Wine's timing is the other candidate.A guard to tell the two apart:
VICTORY_RANGE_GUARD=1in HioShan/VIctory-xmem-bazzite (crates/victory-hle/src/range_guard.rs, self-contained, about 300 lines). How it works:ReadProcessMemory, read only and without the title's lock.If the bad bytes are list links, it is a race. Anything else (floats, colours, addresses) is a stray write. In our runs it found the array, logged
lists read wholeand cost nothing measurable (about 35 min of play so far, no false alarms after the first fixes). If you hit #57 or this crash regularly, running with the guard and posting therange guard:lines would pin down the cause.@DecayingEagle on GitHub · 2026-12-02 14:53 UTC · original
A highway drive on a 7900 XT under Wine reached a different loop in this allocator. The road stayed visible. Frame 33,810 was the last frame to begin. At +10 s and +20 s the same worker had the same stack, starting at
+0x2626977 → +0xbc06cd → +0xbc03f9 → +0x82cd46. The title main thread was waiting at+0x509898d. About 30 s into the stall the watchdog wrote to zero at+0x2215c35. No kernel GPU reset or OOM kill. Total run time 23m50s.The worker's context in the crash minidump still has RIP at
+0x2626977,rax=0,r10=r8,edx=0x30andr11d=0x15e1. It is checking node 0. In 1.0.2.1 this walk tests the size at offset 12 against the request, then takes the signed 16-bit link at offset 6 until it reaches the stop index or finds a large enough range. The minidump doesn't contain the node bytes, so this is evidence of a stuck walk, not proof of a self-loop or of who wrote it.An earlier run on this PC at
37bb30f, without frame generation, had the #57 stack at+0xad5241twice and the same watchdog exit. The currentdamaged()check in the linked Bazzite guard follows offset 2 below the first free slot. That check may miss the offset-6 case. I’m adding local read-only snapshots at the two hang dumps to examine both links.Latest run used
d044248plus local patches from #135, #163, #164, #173, #178, #179, #188 and #191. Series X, 1440p Native AA, frame generation on, RT off,VICTORY_PAGES=0. Across the highway samples, zero texture block requests failed for lack of space. Some passes did start above the memory budget threshold. The two runs aren't a controlled comparison of FG or page migration.Analysis and write-up by OpenAI Codex. No save, minidump or raw log attached.
@Lightje on GitHub · 2026-12-02 15:42 UTC · original
Ran with
VICTORY_RANGE_GUARD=1(portedd2f7375afromHioShan/VIctory-xmem-bazzite, plus an offset-4/6 cycle check indamaged()and read-only snapshots at bothhang watchdumps and crash as@DecayingEaglesuggested) and caught the exact corruption live 29 min in (1736 s, frame45618), 25 s before the freeze at frame46134and watchdog null write at+0x2215c35.Key findings
u16links,u32start/size, trailing 4 bytes all00 00 00 00). Zero floats, colors, or random bytes.loops_off2=0, loops_off4_6=15, asymmetric=7. At the freeze (frame46134), worker thread 580 was stuck spinning in the offset-4 walk (+0x2626830):45618, List 1 was already out of descendingstartorder (0x040datstart=0x0b4bhadnext=0x01f7atstart=0x1844, and0x01f2atstart=0x17e5also hadprev=0x01f7), which caused List 2 to have0x0b26 (0x18fd) -> 0x0ba3 (0x0c7f) -> 0x0b3b (0x0b7b) -> 0x0b05 (0x17b8) -> ... -> 0x0afe (0x0df5) -> 0x0b3e (0x0cb9) -> 0x0b25 (0x18a3).45618, freeing0x02d6(prev=0x0b3e, next=0x0ba3, start=0x0c84, size=0x35) coalesced0x0b3e(0x0cb9, size0x12) +0x02d6(0x35) +0x0ba3(0x0c7f, size0x5) into0x0ba3(size=0x4c).+0xad52f0assumes adjacent physical free nodes are adjacent in List 2, so it set0x0ba3.prev2 = 0x0afe(was0x0b26) and0x0afe.next2 = 0x0ba3(was0x0b3e), closing a 15-node bidirectional ring on bothprev2andnext2:0x0afe <-> 0x0ba3 <-> 0x0b3b <-> 0x0b05 <-> 0x0b8c <-> 0x0b37 <-> 0x0b81 <-> 0x0b47 <-> 0x0b16 <-> 0x0b85 <-> 0x0b9d <-> 0x0afd <-> 0x0bb1 <-> 0x0b86 <-> 0x0b32 <-> 0x0afe0x0b3ewas freed and immediately reused (start=0x85c6), leaving0x0b25.prev2dangling on0x0b3eand0x0b26.next2pointing into the ring at0x0ba3.range guard:log lines (first detection at 1736 s, 500 ms after last whole read)Asymmetric nodes at hang watch (frame 46134, showing the earlier List-1 break
0x040d -> 0x01f7)Notice
0x040d (0x0b4b)already hadnext=0x01f7 (0x1844)before the 500 ms window (unchanged betweenwasandnow) — so checking for astartmonotonicity inversion in List 1 (prev/next) would catch the very first corruption event!@HioShan on GitHub · 2026-12-02 16:13 UTC · original
Thanks @Lightje and @DecayingEagle: that settles the stray-write question. We hit the same second-list walk: an RX 9070 XT, 2 h 11 min into story mode, one worker stuck at
+0x2626977(+0xbc06cd → +0xbc03f9 → +0x82cd46). Then came the watchdog'sint3at+0x2215c40(our build turns the title's null store into that). The card's memory was flat for the whole game: VRAM 15.4–15.6 GB from minute 30 on, 1.3–1.5 GB of it free, no swap, and the frame rate did not fall with time. So it was not a leak.The guard in HioShan/VIctory-xmem-bazzite (
crates/victory-hle/src/range_guard.rs, branchbazzite) now does three more things:next2from the node at[+0x908f032]and checks that it comes back to the sentinel[+0x908f030], as+0x2626930does. The first read must show the layout holds, or this check stays off; here it loggedsentinel=5601 head=5602 ring=true(your0x15e1/0x15e2). A walk that revisits a node, or reaches a link that names no node (the-1of the+0x2626911crash), counts as broken.VICTORY_RANGE_GUARD=heal, a stop-gap, not a fix. It acts only when the same damage has held for 2 s and no frame has begun for 3 s, so the title is already stuck and its watchdog will end the game at 20 s.next2= sentinel, and the sentinel'sprev2= that node.next=0xffffon the loop's last node.startorder in the first list stays broken, so it may fail later anyway.@Lightje's idea of flagging the first
start-order inversion in the first list seems the way to find the cause. Whatever writes that inversion, maybe a double free or a race that only Wine's scheduling shows, is what to catch next.@Lightje on GitHub · 2026-12-02 17:12 UTC · original
@HioShan, I added that exact List-1
start-order check and it caught the initial inversion on the very next run (1585 s, frame 43405). It turns out to be a double-allocation race on a live node, not a double free:1. Live capture of the first
start-order break (0x0203allocated0x5ftwice in place)In one 1.3 s window,
0x0203started free (size=0) and was allocated twice with the exact same size0x5fwithout being freed between the two:0x5foff0x0b01(start=0x2973, size=0x65->start=0x29d2, size=0x06, setting0x0b01.next=0x0203and0x03ea.prev=0x0203).0x5foff0x0b2e(start=0x3195, size=0x77->start=0x31f4, size=0x18, setting0x0b2e.next=0x0203and0x0471.prev=0x0203), overwritingnodes[0x0203]in place and leaving0x0b01.next=0x0203and0x03ea.prev=0x0203dangling across memory:2. Root cause in the disassembly (
+0xbc0380lock-gap TOCTOU)Audited every caller of the allocator in
b99f876b74d4a77f:+0xbc0380(sole caller+0x82cd41, the same stack frame as your+0x2626977hang) checks a slot's A/B sizes unlocked (+0xbc0470/+0xbc0450/+0xbc0640), then calls:slot_free_a(+0xbc04d0) -> locks & unlocks+0x76b8e70slot_alloc_a(+0xbc0530) -> re-locks+0x76b8e70, zeroes the slot's cachedsize_awithout freeingslot.node_a, and calls+0x2626830which overwritesnodes[node_a]in placeslot_free_b(+0xbc05b0) ->slot_alloc_b(+0xbc0670->+0x2626930), followed by a tail-call to+0xbc0750(which also reads the slot unlocked before acquiring+0x76b8e70).+0xbc0380concurrently for the same slot, both fail the size check and both runslot_alloc_a/slot_alloc_b, overwriting the live node in place and breaking List 1 — which later cascades into either the List-2 hang ring (+0x2626877/+0x2626977), the List-1 loop (#57+0xad522d), or0xc0000005(+0xad533c/+0x2626911).3. Bonus bug explaining the
+0xad533c(0x4fffffffb) crashis_free_node(+0xad52d0) only checks:cx >= [+0x908f02e] (0xaf0) && cx != [+0x908f030] (0x15e1) && cx != [+0x908f032] (0x15e2)So
is_free_node(0xffff)returnstrue. On our crash snapshot,nodes[0]hadsize=0, prev=next=prev2=0xffffwith a stalenext2=0x0ba8, bypassingfree_node's all--1guard and causingfree_nodeto callcoalesce_nodes(0xffff, 0)-> crash at+0xad533c.4. Local fix + initial 31-minute test result
+0x76b8e70(+0x4b40/+0x4d9dab0) is a recursivesysCriticalSectionToken, and nothing reachable from+0xbc0380(including+0xbc0750) acquires+0x76b8e50or any other lock.+0xbc0380to hold+0x76b8e70across the entire check -> free -> alloc -> queue sequence (so the second racing thread sees the updated size and skips reallocation).+0xad52e2fromje(0x74) tojbe(0x76) aftercmp [head_a], cx, socx >= head_a(including0xffff) returnsfalseinis_free_node.VICTORY_RANGE_GUARD=1active: 17,801 checks,damaged=false, 0 errors, 0 hangs, clean exit (whereas my previous three unpatched runs hit damage/crashed at 22 min, 29 min, and 26.5 min). Needs a multi-hour run to be 100% sure, so I'll keep testing and report back if anything shows up.@GustawMatuszewski on GitHub · 2026-12-02 18:04 UTC · original
Data point from a second card and a different trigger — same site.
Machine: RX 9060 XT (Navi 44, RDNA4, GV-R9060XTGAMING OC-16GD), Ryzen 9 3900X, 46 GB RAM, Ubuntu, Mesa 26.0.8 RADV, ReBAR on (16 GB BAR), Proton Experimental. Built from main (
37bb30f) plus two ports (8 GiB address-space spare + host-FidelityFX-any-output-size, from Skrills68/Valhalla-xmem 21d973f/ca81fb7 and trustno1's v2026.11.29.04).The title stops at the same watchdog null write — — but for us it is deterministic at frame 0, System Init, in every run that selects the host FidelityFX upscaler (any output size, Series S or X, RT on or off):
No line precedes it (the 6.5 GB heap is served; the 8 GiB spare reserves fine and is logged), so our instance looks like the title writing through a null FidelityFX context/interface rather than the pool walk you two are chasing — but the crashing site (+0x2215c35, the same worker state HioShan quoted) is the same. Without the host FidelityFX the title runs fine for us (15.2 fps, console FSR, world black — the known fault).
Full test matrix, crash context dumps and log lines: https://github.com/Skrills68/Valhalla-xmem/issues/11 (same build family). Happy to run anything — the box reproduces in under a minute.
@GustawMatuszewski on GitHub · 2026-12-02 18:05 UTC · original
Data point from a second card and a different trigger — same site.
Machine: RX 9060 XT (Navi 44, RDNA4), Ryzen 9 3900X, 46 GB RAM, Ubuntu, Mesa RADV 26.0.8, ReBAR on (16 GB BAR), Proton Experimental. Built from main (
37bb30f) plus two ports (8 GiB address-space spare + host-FidelityFX any output size, from Skrills68/Valhalla-xmem 21d973f/ca81fb7 and trustno1's v2026.11.29.04).The title stops at the same watchdog null write — victory-image-b99f876b74d4a77f.dll+0x2215c35 (write 0x0) — but for us it is deterministic at frame 0, System Init, in every run that selects the host FidelityFX upscaler (any output size, Series S or X, RT on or off):
No XMemVirtualAlloc-refused line precedes it (the 6.5 GB heap is served; the 8 GiB spare reserves fine and is logged), so our instance looks like the title writing through a null FidelityFX context/interface rather than the pool walk you are chasing — but the crashing site is the same one HioShan quoted. Without the host FidelityFX the title runs fine for us (15.2 fps, console FSR, world black — the known fault).
Full test matrix, crash context dumps and log lines: Skrills68/Valhalla-xmem#11 (same build family). Happy to run anything — the box reproduces in under a minute.
@AxolotOfficialYT on GitHub · 2026-12-03 21:07 UTC · original · edited 2026-12-03 21:13 UTC
Automatic report by Axolot's AI agent.
Same crash signature as the first crash here:
0xc0000005atvictory-image-...dll+0xad533c,r11=0x4fffffffb. Adding a data point from an RX 7700 XT on the currentmain.Environment
lobomfz/VIctory-xmem@00aa4d38820e94c2f85d14dcf93ee7e12d9d735f(main, 2026-12-03 12:22 -0600)b99f876b74d4a77f03af5f878223b27bd647b5c35a79d5decd9f716504239e93Linux 7.3.4-arch1-126.3.1(the VUM RADV fromsetup.sh)GE-Proton11-5-x86_64), vkd3d-proton from the repo4.1.2selected, quality preset (1280x720->1920x1080)Settings
Launched with
./run.sh play; cgroupMemoryMax=15485M,MemorySwapMax=32G. The crash happened with RT off, not with ray tracing.Crash
20:55:06Z)930.048.020-vb_sub_story,TitleID 7952987a, Anaconda / RETAILamdgpufault in the window.Note the stack here is 2 frames shallower than the #142 crash 1; frames 3-4 differ (
+0xad5042/+0xad4f96here vs+0xad5054/+0xad4f96in #142), but the faulting instruction and registers match (r11=0x4fffffffb,rsi=0xb56ffff,rcx=0xb56).Title crash context
The title's Breakpad handler tried to upload the crash context and minidump to
submit.backtrace.io:443; VIctory's net module blocked the connection, so the report stayed local.Files
local/data/7952987A/temp/victory-20261203-215506-256.crash.log(2,648 bytes)local/data/7952987a/temp/38947266-0c04-4c9e-9287-b3d070873160.dmp(461,306 bytes)local/run/play-20261203-210201.log(34 MB)I can provide the minidump or the full session log if they would help; I did not attach the dump here.
Reproducibility
First occurrence on this checkout; I have not retried the same route/mission yet. No GPU fault, no OOM, no texture-eviction error immediately before the fault. It looks like the same allocator-list corruption as the two crashes in #142 (the
0xfffflink read as0xffffffff, then*5 = 0x4fffffffb).Related reports I found while searching: #57, #184, #196, #200. This one matches #142's
+0xad533cexactly.@abomalocaris on GitHub · 2026-12-04 04:14 UTC · original
Another data point: same site, under a second after a menu opened, on
mainat00aa4d3RX 9070 XT 16 GB, Ryzen 7 9800X3D, 32 GB RAM, CachyOS (kernel 7.3.7),
proton-cachyos-slr, repo Mesa 26.3.1.mainat00aa4d3with #342, #216 and #344 merged (their switches off), Series X, 2560x1440 with FSR 4 quality, hardware ray tracing off,VICTORY_PAGES=0.About 3.5 minutes into a free-roam session, walking up to a clothes rack to try on a hat:
Same
r11 = 0x4fffffffb, andrax + 4 * r11 + 2is the faulting address again. Not memory: the card was at 12.7 of 17.0 GB (budget as set), the title reported 79 % memory load, noamdgpumessage in the kernel log. One occurrence so far; the same session type ran for 10 minutes several times in scripted tests without it, but those never open a menu.Written with AI assistance (Claude Code); the runs and observations are from my own machine.