0xc000001d Illegal instruction (CLWB) crash on AMD Ryzen 7 #210

Open
opened 2026-11-26 03:54:51 +00:00 by github-bot · 2 comments
Owner

@⁠FulhR on GitHub · 2026-11-24 01:27 UTC · original

Bug report

Description

VIctory crashes during initial system initialization due to an illegal CPU instruction (CLWB).

The host CPU supports AVX2 but does not support the CLWB instruction.

Error details

Exception code: 0xc000001d (ILLEGAL_INSTRUCTION)
Faulting instruction: clwb [r9]
Module: victory-image-b99f876b74d4a77f.dll
Offset: 0x4ecc84a

Steps to reproduce

  1. Build VIctory successfully.
  2. Configure the game directory.
  3. Run the title using victory.exe run --execute.
  4. The executable and its dependencies are mapped successfully.
  5. During system initialization, VIctory crashes with exception 0xc000001d.

Expected behavior

VIctory should detect whether the host CPU supports CLWB before executing it and provide a compatible fallback when the instruction is unavailable.

Actual behavior

An unsupported CLWB instruction is executed, causing an illegal instruction exception (0xc000001d) and terminating the process.

Additional information

  • All imports are successfully bound (0 missing imports).
  • The D3D12 host device initializes successfully.
  • The crash occurs before the first frame is rendered.
  • The crash happens before world loading begins.
  • Searching the repository with git grep -i clwb does not find a direct reference to this instruction.

Possible solution

Could a CPU feature check or a fallback implementation be added for systems that support AVX2 but do not support CLWB?

Is this an expected hardware limitation, or could it be addressed in VIctory?

**@⁠FulhR** on GitHub · 2026-11-24 01:27 UTC · [original](https://github.com/Marvisak/VIctory/issues/210) ## Bug report ### Description VIctory crashes during initial system initialization due to an illegal CPU instruction (`CLWB`). The host CPU supports AVX2 but does not support the `CLWB` instruction. ### Error details ```text Exception code: 0xc000001d (ILLEGAL_INSTRUCTION) Faulting instruction: clwb [r9] Module: victory-image-b99f876b74d4a77f.dll Offset: 0x4ecc84a ``` ### Steps to reproduce 1. Build VIctory successfully. 2. Configure the game directory. 3. Run the title using `victory.exe run --execute`. 4. The executable and its dependencies are mapped successfully. 5. During system initialization, VIctory crashes with exception `0xc000001d`. ### Expected behavior VIctory should detect whether the host CPU supports `CLWB` before executing it and provide a compatible fallback when the instruction is unavailable. ### Actual behavior An unsupported `CLWB` instruction is executed, causing an illegal instruction exception (`0xc000001d`) and terminating the process. ### Additional information - All imports are successfully bound (0 missing imports). - The D3D12 host device initializes successfully. - The crash occurs before the first frame is rendered. - The crash happens before world loading begins. - Searching the repository with `git grep -i clwb` does not find a direct reference to this instruction. ### Possible solution Could a CPU feature check or a fallback implementation be added for systems that support AVX2 but do not support `CLWB`? Is this an expected hardware limitation, or could it be addressed in VIctory?
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:54:52 +00:00
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 01:32 UTC · original

Current main handles this instruction, so the first thing to check is the build.

  • crates/victory-loader/src/crash.rs emulates clwb m8 (66 [rex] 0f ae /6) in the illegal-instruction handler: clwb_len skips a single write-back hint, and clwb_loop completes a whole write-back loop in one exception. That came in with #45, merged as 7d33c46.
  • If the binary was built before that commit (for example 97c78d1), rebuild from current main (d2a4bae as of now) and the clwb [r9] at +0x4ecc84a should no longer fault.
  • If it still does on current main, the useful datum is the crash log's refused-instruction bytes plus the exact CPU model. The handler matches by encoding, so a segment prefix or a REX variant it does not expect is what would explain it. #198 (open) adds those bytes to the crash report, which makes this diagnosable without a debugger.
  • AMD Ryzen 7: Zen 1/Zen 2 lack CLWB (Zen 3+ have it), which fits the report; the emulation is the intended path for those CPUs.

Related: #7, #106 and #108 are the same class (CLWB/CLZERO/rdpru); #34 (open) extends the handler to clzero loops and rdpru.

No game data used.

**@⁠DaviTostes** on GitHub · 2026-11-24 01:32 UTC · [original](https://github.com/Marvisak/VIctory/issues/210#issuecomment-7119202662) Current `main` handles this instruction, so the first thing to check is the build. - `crates/victory-loader/src/crash.rs` emulates `clwb m8` (`66 [rex] 0f ae /6`) in the illegal-instruction handler: `clwb_len` skips a single write-back hint, and `clwb_loop` completes a whole write-back loop in one exception. That came in with **#45**, merged as `7d33c46`. - If the binary was built before that commit (for example `97c78d1`), rebuild from current `main` (`d2a4bae` as of now) and the `clwb [r9]` at `+0x4ecc84a` should no longer fault. - If it still does on current `main`, the useful datum is the crash log's refused-instruction bytes plus the exact CPU model. The handler matches by encoding, so a segment prefix or a REX variant it does not expect is what would explain it. **#198** (open) adds those bytes to the crash report, which makes this diagnosable without a debugger. - AMD Ryzen 7: Zen 1/Zen 2 lack CLWB (Zen 3+ have it), which fits the report; the emulation is the intended path for those CPUs. Related: #7, #106 and #108 are the same class (CLWB/CLZERO/`rdpru`); #34 (open) extends the handler to `clzero` loops and `rdpru`. No game data used.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:44 UTC · original · edited 2026-11-25 01:52 UTC

Automated triage for the maintainers.

  • The fault at +0x4ecc84a is the same clwb write-back loop reported in #102, #103 and #108. The cause is tracked in #102 (oldest report of this crash); #106 reports the related clzero case.
  • main handles this: crates/victory-loader/src/crash.rs, emulate_amd_only, catches the illegal-instruction exception and uses clwb_loop (whole write-back loop in one exception) or clwb_len (skip one clwb). The 66 41 0f ae 31 (clwb [r9]) encoding is covered. This arrived with #45 (merge 7d33c46, 2026-11-24 00:30 UTC), shortly before this report; on #108 a reporter confirmed the title gets past this point after updating.
  • Please pull current main, rebuild and retry. If it still crashes, please post the VIctory commit (git rev-parse HEAD), the exact CPU model, GPU and driver version, Windows version, and the crashes.log entry. Since #198 the log includes the bytes of the refused instruction, which shows which encoding was not recognised.

Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:44 UTC · [original](https://github.com/Marvisak/VIctory/issues/210#issuecomment-7149905835) · edited 2026-11-25 01:52 UTC <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T01:32:33Z at=2026-11-25T01:44:45Z --> Automated triage for the maintainers. - The fault at `+0x4ecc84a` is the same `clwb` write-back loop reported in #102, #103 and #108. The cause is tracked in **#102** (oldest report of this crash); #106 reports the related `clzero` case. - `main` handles this: `crates/victory-loader/src/crash.rs`, `emulate_amd_only`, catches the illegal-instruction exception and uses `clwb_loop` (whole write-back loop in one exception) or `clwb_len` (skip one `clwb`). The `66 41 0f ae 31` (`clwb [r9]`) encoding is covered. This arrived with #45 (merge `7d33c46`, 2026-11-24 00:30 UTC), shortly before this report; on #108 a reporter confirmed the title gets past this point after updating. - Please pull current `main`, rebuild and retry. If it still crashes, please post the VIctory commit (`git rev-parse HEAD`), the exact CPU model, GPU and driver version, Windows version, and the `crashes.log` entry. Since #198 the log includes the bytes of the refused instruction, which shows which encoding was not recognised. --- _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#210
No description provided.