Crash right after "audio DSP connected": title memsets unmapped address 0x217800 (len 0x2173a0) #289

Open
opened 2026-11-26 03:58:06 +00:00 by github-bot · 4 comments
Owner

@⁠DreamColt14 on GitHub · 2026-11-24 02:03 UTC · original

Environment

  • CPU: Intel family 6 model 0xB7, 28 threads (i7-14700kf)
  • GPU: NVIDIA Gigabyte RTX 5060ti 16gb, driver file version 32.0.16.2135
  • Windows 11 (ntdll 10.0.26100.10068), 32 GB RAM, 3840x2160 3440x1440
  • VIctory: d2a4bae1f4, release build
  • Title: game_scarlett_master.exe, build hash b99f876b74d4a77f..., Version 930.048.020-vb_sub_story, Series X mode

What happens
Boot, first-boot screens and menus render at 30 fps. About 9 s after start, right after
"audio DSP connected base_length=393216 ir_seconds=30 max_streams=128 max_channels=1",
the title crashes:

0xc0000005, write at 0x217800, VCRUNTIME140.dll+0x1e579 (14.51.36247.0).
This is the rep stosb in memset: memset(dst=0x217800, 0, len=0x2173a0)
(r9=rdi=0x217800, r8=rcx=0x2173a0 unchanged, so the first byte already faulted).
The minidump memory map has 0x0-0x55a0000 FREE, so this is not a guard-page race.
Callers: image+0x1712b25, +0x1e74a4f, +0x5c523b0, +0x25a4d45, +0x1d857a6
Struct at r15 (title memory): ptr 0xd074b8dc0, u16 0x15, u16 0x16, u64 0x217800 @+0x10,
u32 0x2173a0 @+0x1c and @+0x20, u32 0x3000 @+0x24.

Guess (unverified): 0x217800 is small and 0x800-aligned, like an APU device address from
the HLE heap (audio.rs, APU_BASE = 0x10000), so the title may be using a device address
where it expects a host pointer. I could not disassemble the title image to check.

Attached: crashes.log and the crash.log from the title's data folder (minidump on request).
victory-20261124-042612-21088.crash.log
crashes.log

**@⁠DreamColt14** on GitHub · 2026-11-24 02:03 UTC · [original](https://github.com/Marvisak/VIctory/issues/289) Environment - CPU: Intel family 6 model 0xB7, 28 threads (i7-14700kf) - GPU: NVIDIA Gigabyte RTX 5060ti 16gb, driver file version 32.0.16.2135 - Windows 11 (ntdll 10.0.26100.10068), 32 GB RAM, 3840x2160 3440x1440 - VIctory: d2a4bae1f49533ef5cb512fd1b1ba1513f2e1989, release build - Title: game_scarlett_master.exe, build hash b99f876b74d4a77f..., Version 930.048.020-vb_sub_story, Series X mode What happens Boot, first-boot screens and menus render at 30 fps. About 9 s after start, right after "audio DSP connected base_length=393216 ir_seconds=30 max_streams=128 max_channels=1", the title crashes: 0xc0000005, write at 0x217800, VCRUNTIME140.dll+0x1e579 (14.51.36247.0). This is the rep stosb in memset: memset(dst=0x217800, 0, len=0x2173a0) (r9=rdi=0x217800, r8=rcx=0x2173a0 unchanged, so the first byte already faulted). The minidump memory map has 0x0-0x55a0000 FREE, so this is not a guard-page race. Callers: image+0x1712b25, +0x1e74a4f, +0x5c523b0, +0x25a4d45, +0x1d857a6 Struct at r15 (title memory): ptr 0xd074b8dc0, u16 0x15, u16 0x16, u64 0x217800 @+0x10, u32 0x2173a0 @+0x1c and @+0x20, u32 0x3000 @+0x24. Guess (unverified): 0x217800 is small and 0x800-aligned, like an APU device address from the HLE heap (audio.rs, APU_BASE = 0x10000), so the title may be using a device address where it expects a host pointer. I could not disassemble the title image to check. Attached: crashes.log and the crash.log from the title's data folder (minidump on request). [victory-20261124-042612-21088.crash.log](https://github.com/user-attachments/files/35307488/victory-20261124-042612-21088.crash.log) [crashes.log](https://github.com/user-attachments/files/35307507/crashes.log)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:58:06 +00:00
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 12:00 UTC · original

Claiming this issue for investigation and resolution.

Architectural Context & Root Cause Analysis

In crates/victory-hle/src/modules/audio.rs, APU_BASE is defined as 0x0001_0000, and heap_alloc issues 32-bit device addresses (apu) in that range (such as 0x217800). However, heap_alloc allocates backing host buffers via standard heap alloc_zeroed, keeping the 32-bit apu device address virtualized only in HEAP.by_apu.

When the audio DSP or middleware expects CPU-visible direct access to the APU buffer or assumes device addresses correspond to accessible virtual memory, passing 0x217800 directly into memset faults because 0x00010000.. is unmapped in the title process virtual address space.

We are investigating establishing a fixed low memory mapping or ensuring APU allocation addresses mirror a reserved virtual region so direct CPU accesses by audio worker threads do not fault.

**@⁠pushkarreddyy** on GitHub · 2026-11-24 12:00 UTC · [original](https://github.com/Marvisak/VIctory/issues/289#issuecomment-7130839533) Claiming this issue for investigation and resolution. ### Architectural Context & Root Cause Analysis In `crates/victory-hle/src/modules/audio.rs`, `APU_BASE` is defined as `0x0001_0000`, and `heap_alloc` issues 32-bit device addresses (`apu`) in that range (such as `0x217800`). However, `heap_alloc` allocates backing host buffers via standard heap `alloc_zeroed`, keeping the 32-bit `apu` device address virtualized only in `HEAP.by_apu`. When the audio DSP or middleware expects CPU-visible direct access to the APU buffer or assumes device addresses correspond to accessible virtual memory, passing `0x217800` directly into `memset` faults because `0x00010000..` is unmapped in the title process virtual address space. We are investigating establishing a fixed low memory mapping or ensuring APU allocation addresses mirror a reserved virtual region so direct CPU accesses by audio worker threads do not fault.
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 12:18 UTC · original · edited 2026-11-24 14:22 UTC

Verified Patch Ready on Fork

The implementation resolving APU device address mapping is verified and available on my fork:

Changes (crates/victory-hle/src/modules/audio.rs):

  • Updated heap_alloc on Windows to allocate backing APU memory using VirtualAlloc(apu as *mut c_void, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE) directly at the 32-bit device address apu (starting at APU_BASE = 0x0001_0000).
  • If fixed allocation is unavailable, falls back gracefully to std::alloc::alloc_zeroed.
  • Added free_apu_memory to properly release via VirtualFree or std::alloc::dealloc.
  • Because the buffer memory is committed at 0x217800, direct CPU operations by title audio worker threads (such as memset(0x217800, 0, len)) execute without access violations (0xc0000005).
  • Added unit test apu_alloc_memory_is_accessible.

Verification:

  • Formatted with rustfmt --edition 2024.
  • Rule #1 asset policy compliant (cargo xtask policy clean).
  • ready for review or merge when PR permissions reopen.
**@⁠pushkarreddyy** on GitHub · 2026-11-24 12:18 UTC · [original](https://github.com/Marvisak/VIctory/issues/289#issuecomment-7131264933) · edited 2026-11-24 14:22 UTC ### Verified Patch Ready on Fork The implementation resolving APU device address mapping is verified and available on my fork: - **Branch:** https://github.com/pushkarreddyy/VIctory/tree/fix/audio-apu-address-mapping - **Commit:** [`161cdc7`](https://github.com/pushkarreddyy/VIctory/commit/161cdc7) based on `main` (`ffe310e`) #### Changes (`crates/victory-hle/src/modules/audio.rs`): - Updated `heap_alloc` on Windows to allocate backing APU memory using `VirtualAlloc(apu as *mut c_void, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE)` directly at the 32-bit device address `apu` (starting at `APU_BASE = 0x0001_0000`). - If fixed allocation is unavailable, falls back gracefully to `std::alloc::alloc_zeroed`. - Added `free_apu_memory` to properly release via `VirtualFree` or `std::alloc::dealloc`. - Because the buffer memory is committed at `0x217800`, direct CPU operations by title audio worker threads (such as `memset(0x217800, 0, len)`) execute without access violations (`0xc0000005`). - Added unit test `apu_alloc_memory_is_accessible`. #### Verification: - Formatted with `rustfmt --edition 2024`. - Rule #1 asset policy compliant (`cargo xtask policy` clean). - ready for review or merge when PR permissions reopen.
Author
Owner

@⁠imjustprism on GitHub · 2026-11-24 20:45 UTC · original

i hit this crash on my machine and traced it. the write to 0x217800 is not an apu device address being used as a pointer. the title asks ApuAlloc for one block of about 401 MiB and passes null for the device-address out-param, so it never sees a device address at all.

on my machine the host refused that allocation: windows was almost out of commit (ram + pagefile) because of other work, the title's own telemetry showed about 8 MB left. the call failed, the title did not check the result, and then cleared memory at null plus an offset inside that block. that offset is 0x217800.

i can reproduce it on demand: running the title in a job object with a 7.1 GB per-process commit cap gives the same crash at the same address. with commit free it boots to the menus, peak private memory about 7.3 GB.

so mapping memory at the device addresses would at best let the write land in an unrelated block and hide the crash. if you hit this, check free commit before launch and your pagefile size.

i have a small change that writes the refused allocation to crashes.log with the size and the system commit, so this shows up by name. pr coming.

**@⁠imjustprism** on GitHub · 2026-11-24 20:45 UTC · [original](https://github.com/Marvisak/VIctory/issues/289#issuecomment-7144009192) i hit this crash on my machine and traced it. the write to 0x217800 is not an apu device address being used as a pointer. the title asks ApuAlloc for one block of about 401 MiB and passes null for the device-address out-param, so it never sees a device address at all. on my machine the host refused that allocation: windows was almost out of commit (ram + pagefile) because of other work, the title's own telemetry showed about 8 MB left. the call failed, the title did not check the result, and then cleared memory at null plus an offset inside that block. that offset is 0x217800. i can reproduce it on demand: running the title in a job object with a 7.1 GB per-process commit cap gives the same crash at the same address. with commit free it boots to the menus, peak private memory about 7.3 GB. so mapping memory at the device addresses would at best let the write land in an unrelated block and hide the crash. if you hit this, check free commit before launch and your pagefile size. i have a small change that writes the refused allocation to crashes.log with the size and the system commit, so this shows up by name. pr coming.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:47 UTC · original

Automated triage for the maintainers.

  • This is the first report of this crash (write at 0x217800 right after "audio DSP connected"), so it is tracked here. The related startup failure when Windows cannot commit memory is #23.
  • What the code does: in crates/victory-hle/src/modules/audio.rs, ApuAlloc gives the title a host pointer through out (from heap_alloc, which uses alloc_zeroed) and writes the device address only to the optional second out-parameter. When the host allocation fails, it returns E_OUTOFMEMORY and leaves out unwritten. A write at a small offset from null therefore matches an allocation that failed and whose result went unchecked. That is the explanation in the latest comment (commit exhausted, reproducible with a commit cap). It does not match a device address used as a pointer.
  • @⁠DreamColt14: if you can, please retry with plenty of free commit (larger paging file, nothing else heavy running) and say whether the crash goes away.
  • A patch is offered on a fork branch. Pull requests are open to everyone, so please open one if you want it considered. Given the point above, mapping memory at the device addresses would probably hide the failed allocation, not fix it. A PR that reports the refused allocation in crashes.log was announced in the thread.

Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:47 UTC · [original](https://github.com/Marvisak/VIctory/issues/289#issuecomment-7149959083) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T20:45:11Z at=2026-11-25T01:47:15Z --> Automated triage for the maintainers. - This is the first report of this crash (write at `0x217800` right after "audio DSP connected"), so it is tracked here. The related startup failure when Windows cannot commit memory is #23. - What the code does: in `crates/victory-hle/src/modules/audio.rs`, `ApuAlloc` gives the title a host pointer through `out` (from `heap_alloc`, which uses `alloc_zeroed`) and writes the device address only to the optional second out-parameter. When the host allocation fails, it returns `E_OUTOFMEMORY` and leaves `out` unwritten. A write at a small offset from null therefore matches an allocation that failed and whose result went unchecked. That is the explanation in the latest comment (commit exhausted, reproducible with a commit cap). It does not match a device address used as a pointer. - @⁠DreamColt14: if you can, please retry with plenty of free commit (larger paging file, nothing else heavy running) and say whether the crash goes away. - A patch is offered on a fork branch. Pull requests are open to everyone, so please open one if you want it considered. Given the point above, mapping memory at the device addresses would probably hide the failed allocation, not fix it. A PR that reports the refused allocation in `crashes.log` was announced in the thread. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#289
No description provided.