Access violation at image+0x4dac5bf before the world (a pool link with a garbage offset) #339
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 alicans on 2026-11-27T12:53:12Z.
What went wrong
On an M4 Pro, 24 GB, macOS 15.8.2, Series S, windowed, many of my runs that get near the world end at
image+0x4dac5bf, 69 to 281 s in (render frame 1408 to 2112). I've seen it in 9 runs so far:49e7c64toc5d7f4d0;VICTORY_HOLD_BYTE=1471b6330:1instead.It does not look like memory pressure: in the latest run the macOS memory level was 31 to 37 % at the fault.
Each time 1 to 8 threads fault at the same instruction within a millisecond, reading an unmapped address. In every run the same two registers have the same shape:
0x10830075b56bdcd00x10840074b56bdcd00x268769cd00x8808027c4d6dd0370x8809027b4d6dd0370x201db10370x194201c3bb95cd000x194301c2bb95cd000x26fe10d000xc0020033c2be1c5a0xc0030032c2be1c5a0x27954dc5a0x2bad00b9b533acd00x2bae00b8b533acd00x268eaacd00x00000001d6bb86800x00010000d6bb86800x28b8146800x2252019e4254102b0x2253019d4254102b0x1fa90502b0x238e0090fffefffe0x238f008ffffefffe0x2b3df3ffe0x18dc008e193240850x18dd008d193240850x1cc570085Builds: main
49e7c64(NV6) throughc5d7f4d0(NV37); NV33 and NV34 also had #263, #253, #264, #278 (and #304 in NV34), NV37 had #296 and #301.r8is alwaysrcx + 0x0000ffff00000000: the top 16 bits go up by one and the next 16 go down by one. That looks like a lock-free pool head: a tag, a count and a 32-bit offset in one 64-bit word.0xfffefffe,0x4254102b(a float, 53.0...),0x19324085.My reading is that something wrote over a freed block's link while it sat on the title's free list, and the next pop followed it. Two host things could do that, and I can't tell them apart from here:
If there is a switch that catches a host or GPU write into a range the title has freed, I can run it.
Steps to reproduce
run-native.sh-equivalent run:
--console series-s, windowed,VICTORY_HOLD_BYTE=1471b6330:1, no other switches, warm or cold shader cache. Many runs that get near the end of the story load fault here; some get past it.Mac, macOS version and commit
M4 Pro, 24 GB, macOS 15.8.2. Latest: main
c5d7f4d0+ #296 + #301; seen on every main from49e7c64.Output or log
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T13:31:09Z.
/claim
I'll build the diagnostic switch: VICTORY_TRACE_FREED=1 records every range XMemAlloc/XMemAllocDefault hands out and XMemFree/XMemFreeDefault returns (the header's size, so page-level ranges), and every host write into title memory — the texture copy-back path, and every writable mapping handed to the GPU through resolve — is checked against the freed table and logged with both ranges and a serial. One honest scope limit up front: the title hooks its own sub-allocator (hooks()[1]), so frees the title's own pools do internally are invisible to this — it catches the XMem-granularity class, both your host-copy and GPU-write hypotheses at that granularity. PR within the day; you run it.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T13:31:20Z.
Claimed by @AnastasisKon. Open a draft pull request with
Refs #339in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by alicans on 2026-11-27T19:14:34Z.
One more run with the fault, this time with
VICTORY_TRACE_FREED=1(main582670f1, so #378 is in; copy-back off):0x063b07edb3c748f00x063c07ecb3c748f00x2695f48f0VICTORY_TEXTURE_DROP_TOP_MIP=1,VICTORY_METAL_RESIDENCY_SETS=heap,VICTORY_DEPTH_TWINS=0,VICTORY_HOLD_BYTE=1471b6330:1.So the freed-range check does not see what goes wrong here, at least not at XMem granularity. Is there a trace you would like run next for the title's own pools?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-28T00:35:24Z.
Thanks for the nine runs and the careful tables. I am sorry nobody from me answered sooner.
I do not know the cause yet. Your reading looks right to me: the low 32 bits are an offset, the offset is garbage, and something wrote over the link of a freed block. I cannot tell yet if the writer is the GPU, a host copy or the title itself.
Two things on main since your last build. #513 fixes heap buffer views that kept pointing at pages the title had freed and then reused, so a shader could read and write memory that now belonged to something else. That is one way a free-list link could be overwritten, so it may help, but I have not tested it against your fault. Also
VICTORY_TRACE_FREED=1is on main now (thanks to AnastasisKon). As you saw, it only catches XMem-sized ranges, so your NV43 result does not rule out a write inside the title's own pools.Could you run once more on main
a6a58361, same setup as NV43 withVICTORY_TRACE_FREED=1, and tell me if it still faults and when? If it does not fault, that is useful but not proof, because you only saw it in some runs. I have not run it myself.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-29T08:50:52Z.
The claim by @AnastasisKon has expired: no pull request referenced it within 24 hours. This issue is free to claim.