run.sh: mimalloc off by default (crash at world entry) #10

Closed
github-bot wants to merge 1 commit from gh-pr/10/head into gh-pr/10/base
Owner

@⁠PhialsBasement on GitHub · 2026-11-29 16:26 UTC · original
PhialsBasement:mimalloc-off → main · +3 −1 · 1 files · 1 commits · closed without merging

With VICTORY_PORT_HEAP=1 (set by run.sh play since 9f573f8) the game crashes at its first world frame, every time, after the pipelines are prepared:

unhandled exception 0xc0000005 at game_scarlett_master.exe+0x4e9b4b2 (read 0xffffffffffffffff)

Why: the crashing instruction walks a linked list the game keeps in an object (r15 = node; [r15+8]; r15 = [r15]). The node pointer was 0x10d9f4977ffe8: an address about 15 TB up with a tag bit (bit 48) set. That range is where mimalloc reserves its arenas, and the game keeps flags in the high bits of its pointers.

Diagnostics builds take the switch too. #[global_allocator] in port_heap.rs is only for non-diagnostics builds, but copystat.rs's counting allocator calls through PortHeap since 9f573f8.

Bisect: ca97da2 runs. 9f573f8 crashes even with its seven other new switches off (CLAMP_PREFIX, RECYCLE_READBACK, PLACED_OBJECTS, VIEW_SHAPES, READ_POOL, RESIDENT_SWEEP, IMAGE_FENCE). 5a60834 runs with VICTORY_PORT_HEAP=0 (played into the world and around it).

This makes it default off: VICTORY_PORT_HEAP=1 still turns it on. Seen on Wine 11.21, 64 GB, RX 9070 XT, Series X profile. It may depend on where mimalloc's arenas land on a given machine.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠PhialsBasement** on GitHub · 2026-11-29 16:26 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/10) `PhialsBasement:mimalloc-off` → `main` · +3 −1 · 1 files · 1 commits · closed without merging With `VICTORY_PORT_HEAP=1` (set by `run.sh play` since 9f573f8) the game crashes at its first world frame, every time, after the pipelines are prepared: ``` unhandled exception 0xc0000005 at game_scarlett_master.exe+0x4e9b4b2 (read 0xffffffffffffffff) ``` **Why:** the crashing instruction walks a linked list the game keeps in an object (`r15 = node; [r15+8]; r15 = [r15]`). The node pointer was `0x10d9f4977ffe8`: an address about 15 TB up with a tag bit (bit 48) set. That range is where mimalloc reserves its arenas, and the game keeps flags in the high bits of its pointers. Diagnostics builds take the switch too. `#[global_allocator]` in `port_heap.rs` is only for non-diagnostics builds, but `copystat.rs`'s counting allocator calls through `PortHeap` since 9f573f8. **Bisect:** ca97da2 runs. 9f573f8 crashes even with its seven other new switches off (`CLAMP_PREFIX`, `RECYCLE_READBACK`, `PLACED_OBJECTS`, `VIEW_SHAPES`, `READ_POOL`, `RESIDENT_SWEEP`, `IMAGE_FENCE`). 5a60834 runs with `VICTORY_PORT_HEAP=0` (played into the world and around it). This makes it default off: `VICTORY_PORT_HEAP=1` still turns it on. Seen on Wine 11.21, 64 GB, RX 9070 XT, Series X profile. It may depend on where mimalloc's arenas land on a given machine. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With VICTORY_PORT_HEAP=1 the title crashes at its first world frame, at
game_scarlett_master.exe+0x4e9b4b2, reading 0xffffffffffffffff. The
instruction walks a linked list the title keeps in an object; the node
pointer it fell on was 0x10d9f4977ffe8: an address about 15 TB up with a
tag bit (bit 48) set. That range is where mimalloc reserves its arenas,
and the title keeps flags in the high bits of its pointers.

Diagnostics builds take the switch too: copystat's counting allocator
calls through PortHeap since 9f573f8.

Seen on Wine 11.21, 64 GB, RX 9070 XT, Series X profile. ca97da2 runs;
9f573f8 crashes with all seven of its other switches off; 5a60834 runs
with VICTORY_PORT_HEAP=0 (played into the world, no crash). VICTORY_PORT_HEAP=1 still turns it on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 07:41:06 +00:00
github-bot closed this pull request 2026-12-01 07:41:06 +00:00
Author
Owner

@⁠PhialsBasement on GitHub · 2026-11-29 22:13 UTC · original

Superseded by 88c9c29, which keeps mimalloc and places its arenas below 2^40 (above the title's space). That fixes the same world-entry crash (title pointers into arenas ~15 TB up) without giving up mimalloc. Closing.

**@⁠PhialsBasement** on GitHub · 2026-11-29 22:13 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/10#issuecomment-7263501791) Superseded by 88c9c29, which keeps mimalloc and places its arenas below 2^40 (above the title's space). That fixes the same world-entry crash (title pointers into arenas ~15 TB up) without giving up mimalloc. Closing.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.