Title crashes on CPUs without CLWB support (STATUS_ILLEGAL_INSTRUCTION 0xc000001d) #108
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#108
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?
@lucastol3do on GitHub · 2026-11-24 00:35 UTC · original
Summary
The title boots, loads all archives, creates the D3D12 device, opens the window, and then crashes within ~2 seconds with
STATUS_ILLEGAL_INSTRUCTION(0xc000001d). The faulting instruction isclwb(Cache Line Write Back), which the host CPU does not support. The README lists "a CPU with AVX2" as the only CPU requirement, but the title's own code usesclwb, which is not present on all AVX2-capable CPUs (notably Intel Broadwell and earlier).Environment
b99f876b74d4a77f(release and diag,--features diagnostics)7952987A, version1.0.2.1series-x(default)VICTORY_D3D12_WARP=1(software adapter) — same crash, confirming it is CPU-side, not GPU-sideWhat happens
The loader maps the image, binds all imports (
game_scarlett_master.exe: 88 hle, 427 host, 72 title, 0 missing), redirects static TLS (index 12, 53246 patches), opens every.rpfarchive, creates the host D3D12 device, fits the window, and enters the title's first frames. Then:The faulting instruction
Disassembly of the in-memory image at RVA
0x4ecc84a(dumped viaVICTORY_CRASH_SAVE=0x4ecc84a:256):This is a cache-line write-back loop, present in the title's own code (confirmed at file offset
0x4ecbc4ain the prepared image, which is the same RVA after section alignment). It is not a VIctory-injected patch — the VIctory runs the title's x86-64 code natively, and the title was compiled for the Xbox Series X's AMD Zen 2, which supportsclwb.clwb(66 0f ae /6) was introduced in:It is not present on:
These CPUs do have AVX2, satisfying the stated requirement, but cannot execute
clwb.Call stack
Registers at the fault (from the diag build):
r9points into the title's mapped memory;raxisr9 + 0x1f(end of a 32-byte region, though the loop strides by 0x40).Suggestion
Could VIctory detect
clwbsupport at startup (CPUIDleaf 7, sub-leaf 0, EDX[6]) and, when absent, trap#UDonclwband fall back toclflush(orclflushoptif available, elseclflush) on the same address?clwbandclflush/clflushopttake the samem8operand, so the emulation is a straight substitution of the opcode bytes. This would let the title run on all AVX2 CPUs, matching the README's stated requirement.Alternatively, the README's CPU requirement could be updated to "AVX2 and CLWB" to set expectations, though emulation seems preferable since the title presumably only needs the write-back effect, not
clwbspecifically.Reproduction
Attachments
crashes.log— the 3 crash recordscrashes.log
@DaviTostes on GitHub · 2026-11-24 00:38 UTC · original
CLWB is the instruction #45 adds for Intel CPUs before Ice Lake, and it is merged now —
main7d33c46is the merge of #45.So the first thing worth trying is a build of current
main(or a release binary from it): the loader's illegal-instruction handler (crates/victory-loader/src/crash.rs) should emulateclwbinstead of faulting.If it still crashes after that, the neighbouring class is #34 (open): the handler also emulates
clzeroloops andrdprufor the same reason. The crash log's exception address plus the CPU model is enough to tell which encoding was not recognised.No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
@lucastol3do on GitHub · 2026-11-24 00:41 UTC · original
Thank you — the fix works. I pulled
main(7d33c46), rebuilt, and the title now boots past the crash. It loads all archives, connects audio, translates shaders, and presents frames (the first menus run at ~17–19 fps on this machine). No more0xc000001d.For anyone else on a Broadwell or older CPU: updating to current
mainis all that's needed, no binary patching required. The illegal-instruction handler emulatesclwbtransparently.One question: how do you track what still needs doing? Is there a task board, a roadmap issue, or a list of known gaps somewhere (beyond the status table in the README)? I'd like to help if I can — whether that's testing specific subsystems, writing up reproducible cases from this hardware (a dual-socket Broadwell with a D3D12 GPU, which seems to be a configuration you haven't tested on), or picking up small tasks from the open issues.
Thanks again for the quick response and the fix.
@Sunkiller-qc on GitHub · 2026-11-24 12:54 UTC · original
Since you confirmed that
7d33c46(#45) gets you past theclwbcrash, could you close this one?#102, #103 and #210 fault at the same address (
+0x4ecc84a) and were all built before #45 landed, so they should be closed too once their reporters retest.@Marvisak on GitHub · 2026-11-25 01:48 UTC · original
Automated triage for the maintainers.
Fixed in
main, as the reporter confirmed above: #45 (7d33c46) addedclwbemulation for CPUs without it. The code is now incrates/victory-loader/src/crash.rs:emulate_amd_onlyskips a singleclwb(clwb_len) and completes a whole write-back loop in one exception (clwb_loop,clwb_loop_end). The remaining reports of this crash are tracked in #102. One request for the future: please don't post disassembly of the title's code here; the crash address and VIctory's log lines are enough.This issue will be closed in 48 hours unless the reporter replies or a maintainer removes the
triage: proposed closelabel.On the question in the comments about what still needs doing: open issues and PRs are the task list; #49 collects tester results.
Generated by Claude Code