[Linux/Proton] 0xC0000005 in title code after 3–20 min: range allocator race (+0xbc0380 / +0xad533c / +0x2215c35), RX 6800 XT RADV #395
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/gamingwithhomie--larp#395
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?
@Vallot-hub on GitHub · 2026-12-06 00:05 UTC · original
I had a crash while playing with LARP, so I asked Claude to solve it. Below his analysis; i hope it can help
Note: the crash analysis below (root cause, disassembly reading, address math) was done by an AI assistant (Claude) from my play.log, the game executable and the VIctory-xmem source. I checked the setup and the crashes myself; please double-check the reverse-engineering parts.
Summary
Random 0xC0000005 crashes (
[larp exited with code -1073741819]) after 3–20 minutes of normal free-roam play on Linux/Proton. Crashes 1 and 3 are both a -1 link from the title's own 16-bit range allocator, and crash 2 is the watchdog after a hang (same address as #66). I found no open or merged PR that touches this allocator.Setup
055b28a+ PR #183 wide-heap shadersonCrashes
There is no warning in the log beforehand. The faulting code is always in the title image, and all three stacks go through the same thread entry (
+0x221c29c->+0x2215eca).Crash 1 (~12 min)
Crash 2 (~3 min), same watchdog address as #66 (fixed by PR #103 for the binoculars scene; mine was in free roam)
Crash 3 (~20 min)
Analysis (AI-assisted, checked against the 1.0.2.1 exe disassembly)
The title's range allocator uses 16-bit node indices. The node array is at
+0x908f020, 20-byte nodes; the slots are at+0x908eff0. All offsets are image offsets of game_scarlett_master.exe 1.0.2.1, which match the larp-image offsets.1. TOCTOU race in slot ensure (
+0xbc0380)+0xbc0470,+0xbc0450) without the allocator lock.+0xbc04d0/+0xbc0530) and slot_free_b/slot_alloc_b (+0xbc05b0/+0xbc0670), and tail-jumps to+0xbc0750.+0x76b8e70(via+0x4b40, released via a tail jump to+0x4d9dab0) only around itself.2. -1 accepted as a free node (
+0xad52d0, is_free_node)cx >= [+0x908f02e] && cx != [+0x908f030] && cx != [+0x908f032], so0xffffpasses.[+0x908f030]looks like the end index:+0xad51a2..+0xad51cfscans nodes up to the count and then compares the result against it.3. How a -1 link becomes these exact fault addresses
At
+0xad532d..+0xad533cthe next link is loaded withmovswq (%r8), %r11, then zero-extended withmovl %r11d, %r11d, so -1 becomes0xffffffff. It is then scaled by 20 (lea (%r11,%r11,4)+*4):0x215d3ac67e - rax 0xd5d3ac690 = 0x13FFFFFFEE = 0xffffffff*20 + 2(themovw %cx, 0x2(%rax,%r11,4)store), withrsi 0xb37ffffending inffff0x215d397680 - rax 0xd5d397690 = 0x13FFFFFFF0 = 0xffffffff*20 + 4: the same -1 link, reached from slot ensure (+0xbc03b5is the return aftercall +0xbc0530, and+0xbc0576is inside it, aftercall +0x2626830)+0x2215c35) after a hang. The allocator race can cause such a hang (corrupted lists become a cycle), but so can the view-finish spin that PR #103 guards against. The stall dump of that run was overwritten, so I cannot tell which one it was. (Speculation: PR #103 notes that "a few objects simply reach the job without having been inserted for that frame"; allocator corruption might be one way that happens.)Existing fix (VIctory-xmem)
VIctory-xmem (another Xbox Series emulator for this title) fixes both at load time. The fix, by vMohammad24, was merged upstream in lobomfz/VIctory-xmem#466 (commit
a8df01conmain;ddf57e7onrdna2-3). Code:crates/victory-loader/src/range_allocator.rs:+0xbc0380(56 57 55 53 48 83 EC 28 41 8B 68 04 4C 89 C7, no RIP-relative instructions) to a wrapper that holds+0x76b8e70across the whole call, via a trampoline.je->jbeat+0xad52e2(bytes at+0xad52db:66 39 0D 4E 9D 5B 08 74 0A->... 76 0A), so any index>= [+0x908f030]is not a free node.The expected bytes at both sites match this exe. VIctory logs
range allocator: slot ensure wrapped with lockandis_free_node sentinel check patchedat every start on this machine.Could larp apply the same two patches?
Notes
[untested]settings (alldefault).@Vallot-hub on GitHub · 2026-12-06 00:06 UTC · original
play.log
@vanya890 on GitHub · 2026-12-06 01:18 UTC · original
The allocator-race hypothesis is technically plausible from the described
0xfffflink and the unsynchronised slot-size check, but I would keep the two failures separate for now: crashes 1/3 have the proposed allocator signature, while crash 2 is explicitly ambiguous between an allocator-corrupted list and the existing view-finish watchdog path.I would not transplant the VIctory-xmem byte patches unconditionally. The offsets and expected bytes are tied to the exact
game_scarlett_master.exebuild you disassembled; a title update can move either function or change its prologue while leaving the LARP image offsets misleadingly similar. Before implementing this in LARP, the patch should fail closed unless the loaded title image/version and both complete expected instruction sequences match, and the trampoline must preserve every overwritten instruction and calling convention. Please add the SHA-256 of the exact game executable used for the disassembly (and confirm whether all three crashes came from that same binary). That gives maintainers a reproducible target rather than a patch recipe that could corrupt a different build.@Vallot-hub on GitHub · 2026-12-06 02:11 UTC · original
Thank you for your response
These is the sha-265 : e95020b2fa4a721db3df59fdecf75621730ac559d8835252f6c3b658d5a08993 game_scarlett_master.exe
I can confirm that all three crashes originate from the same binary.