Crash reports: name the host's CPU and Windows build #213

Manually merged
github merged 1 commit from gh-pr/213/head into gh-pr/213/base 2026-11-26 03:55:00 +00:00
Owner

@⁠Dufftwt on GitHub · 2026-11-24 01:28 UTC · original
Dufftwt:fix/crash-log-names-host → main · +74 −5 · 2 files · 1 commits · merged 2026-11-25 00:16 UTC

What's wrong

Two facts about the host decide whether many crashes are bugs at all, and a crash report contains neither:

  • The CPU. The console's CPU is a Zen 2, and title code uses AMD-only instructions that Intel CPUs lack (clwb before Ice Lake, clzero, monitorx, SSE4a…). The loader emulates the ones it knows. Whether an 0xc000001d is a known case, an unknown instruction or something else depends entirely on the CPU.
  • The Windows build. It decides which D3D12 runtime and shader model are available (Windows 10's in-box runtime stops at SM 6.5, #84).

Neither is in the console output or in crashes.log. So every report needs a follow-up question, or reporters type their specs by hand, and some guess wrong (#103 guessed at the instruction without knowing it depended on the CPU generation).

What the fix does

In crash.rs:

  • When the crash log is set up (log_crashes_to, at title start), the loader reads two values once:
    • the CPU's brand string, from cpuid leaves 0x80000002–0x80000004;
    • the real Windows version, from RtlGetVersion. GetVersionEx would return whatever the executable's manifest declares instead.
  • Unhandled exceptions, panics and host GPU failures (log_crash) now end with one more line, host: <CPU>, Windows <major.minor.build>. It comes just before the title's last debug output, which those reports already end with.

At crash time nothing is queried: the line was formatted at startup. First-chance reports don't change.

victory-loader gets two more windows-sys features for RtlGetVersion and its structure: Wdk_System_SystemServices and Win32_System_SystemInformation. It already uses Wdk_System_Threading.

How it behaves after the fix

VIctory: unhandled exception 0xc000001d at victory-image-….dll+0x4ecc84a
  rax … rbx …
  …
  #0  victory-image-….dll+0x4ecc84a
  …
  host: Intel(R) Core(TM) i3-10100F CPU @ 3.60GHz, Windows 10.0.19045

The same line goes to crashes.log, so a pasted report or log file says by itself what machine it came from.

Tests

The new test the_host_line_names_the_cpu_and_windows checks that the line has the form host: <non-empty CPU name>, Windows <a>.<b>.<c> with a major version of 10 or more.

I ran cargo test --workspace on GitHub's windows-latest with Rust 1.98.1 from rust-toolchain.toml:

  • This PR: everything passes. victory-loader has 19 passed, the other crates have 0 failed. On that runner the new test's line is host: AMD EPYC 9V74 80-Core Processor, Windows 10.0.26100.
  • The end of an unhandled-exception report: a throwaway test, used only on my CI branch, reports a synthetic illegal instruction. On main the report ends with the stack:
    VIctory: unhandled exception 0xc000001d at victory_loader-….exe+0xf9cf0
      #0  victory_loader-….exe+0xf9cf0
    
    With this PR:
    VIctory: unhandled exception 0xc000001d at victory_loader-….exe+0x102a30
      #0  victory_loader-….exe+0x102a30
      host: AMD EPYC 9V74 80-Core Processor, Windows 10.0.26100
    
  • I ran with --test-threads=1. With 4 threads, the shader crate's GPU tests sometimes crash on that runner (STATUS_ACCESS_VIOLATION), on unmodified main as well.

Not tested: a crash in the title.

Related: #7, #84, #102, #103, #106. It touches different lines of crash.rs than #198 and #204 and merges cleanly with both.

**@⁠Dufftwt** on GitHub · 2026-11-24 01:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/213) `Dufftwt:fix/crash-log-names-host` → `main` · +74 −5 · 2 files · 1 commits · merged 2026-11-25 00:16 UTC ## What's wrong Two facts about the host decide whether many crashes are bugs at all, and a crash report contains neither: - **The CPU.** The console's CPU is a Zen 2, and title code uses AMD-only instructions that Intel CPUs lack (`clwb` before Ice Lake, `clzero`, `monitorx`, SSE4a…). The loader emulates the ones it knows. Whether an `0xc000001d` is a known case, an unknown instruction or something else depends entirely on the CPU. - **The Windows build.** It decides which D3D12 runtime and shader model are available (Windows 10's in-box runtime stops at SM 6.5, #84). Neither is in the console output or in `crashes.log`. So every report needs a follow-up question, or reporters type their specs by hand, and some guess wrong (#103 guessed at the instruction without knowing it depended on the CPU generation). ## What the fix does In `crash.rs`: - When the crash log is set up (`log_crashes_to`, at title start), the loader reads two values once: - the CPU's brand string, from `cpuid` leaves `0x80000002`–`0x80000004`; - the real Windows version, from `RtlGetVersion`. `GetVersionEx` would return whatever the executable's manifest declares instead. - Unhandled exceptions, panics and host GPU failures (`log_crash`) now end with one more line, `host: <CPU>, Windows <major.minor.build>`. It comes just before the title's last debug output, which those reports already end with. At crash time nothing is queried: the line was formatted at startup. First-chance reports don't change. `victory-loader` gets two more `windows-sys` features for `RtlGetVersion` and its structure: `Wdk_System_SystemServices` and `Win32_System_SystemInformation`. It already uses `Wdk_System_Threading`. ## How it behaves after the fix ``` VIctory: unhandled exception 0xc000001d at victory-image-….dll+0x4ecc84a rax … rbx … … #0 victory-image-….dll+0x4ecc84a … host: Intel(R) Core(TM) i3-10100F CPU @ 3.60GHz, Windows 10.0.19045 ``` The same line goes to `crashes.log`, so a pasted report or log file says by itself what machine it came from. ## Tests The new test `the_host_line_names_the_cpu_and_windows` checks that the line has the form ` host: <non-empty CPU name>, Windows <a>.<b>.<c>` with a major version of 10 or more. I ran `cargo test --workspace` on GitHub's `windows-latest` with Rust 1.98.1 from `rust-toolchain.toml`: - **This PR:** everything passes. `victory-loader` has 19 passed, the other crates have 0 failed. On that runner the new test's line is `host: AMD EPYC 9V74 80-Core Processor, Windows 10.0.26100`. - **The end of an unhandled-exception report:** a throwaway test, used only on my CI branch, reports a synthetic illegal instruction. On `main` the report ends with the stack: ``` VIctory: unhandled exception 0xc000001d at victory_loader-….exe+0xf9cf0 #0 victory_loader-….exe+0xf9cf0 ``` With this PR: ``` VIctory: unhandled exception 0xc000001d at victory_loader-….exe+0x102a30 #0 victory_loader-….exe+0x102a30 host: AMD EPYC 9V74 80-Core Processor, Windows 10.0.26100 ``` - I ran with `--test-threads=1`. With 4 threads, the shader crate's GPU tests sometimes crash on that runner (`STATUS_ACCESS_VIOLATION`), on unmodified `main` as well. **Not tested:** a crash in the title. Related: #7, #84, #102, #103, #106. It touches different lines of `crash.rs` than #198 and #204 and merges cleanly with both.
Whether a crash is a missing instruction depends on the CPU (Intel CPUs
lack some of the console's AMD-only instructions), and which D3D12
runtime there is depends on the Windows build, yet a report carries
neither, so every report has needed a follow-up question.

Unhandled exceptions, panics and host GPU failures now end with a
"host:" line naming the CPU's brand string and the real Windows
version (RtlGetVersion), read once when the crash log is set up.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:54:57 +00:00
github manually merged commit 7f00a62a4b into gh-pr/213/base 2026-11-26 03:55:00 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 05:04 UTC · original

Thanks @⁠Dufftwt for making the host line in crash reports identify the CPU and Windows build.

I tested commit 7f00a62a4b861f0a051cc600470ce0570ab43c6f with:

cargo test --locked -p victory-loader --lib the_host_line_names_the_cpu_and_windows -- --test-threads=1

The targeted test passed (1 passed, 0 failed; 18 filtered). the_host_line_names_the_cpu_and_windows verifies the host: line framing and newline, requires a nonempty CPU name without surrounding whitespace or NULs, and checks for three numeric Windows version components with a major version of at least 10.

This validates the formatted host-information line. It does not generate or inspect a full crash report from an actual exception.

**@⁠jeremygold02** on GitHub · 2026-11-24 05:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/213#issuecomment-7122598714) Thanks @⁠Dufftwt for making the host line in crash reports identify the CPU and Windows build. I tested commit `7f00a62a4b861f0a051cc600470ce0570ab43c6f` with: ``` cargo test --locked -p victory-loader --lib the_host_line_names_the_cpu_and_windows -- --test-threads=1 ``` The targeted test passed (1 passed, 0 failed; 18 filtered). [`the_host_line_names_the_cpu_and_windows`](https://github.com/Marvisak/VIctory/blob/7f00a62a4b861f0a051cc600470ce0570ab43c6f/crates/victory-loader/src/crash.rs#L723) verifies the `host:` line framing and newline, requires a nonempty CPU name without surrounding whitespace or NULs, and checks for three numeric Windows version components with a major version of at least 10. This validates the formatted host-information line. It does not generate or inspect a full crash report from an actual exception.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:23 UTC · original

Automated triage for the maintainers.

Merge candidate. This adds a host: <CPU brand string>, Windows <major.minor.build> line to crash reports, panics and log_crash output in crates/victory-loader/src/crash.rs, computed once in log_crashes_to from cpuid leaves 0x80000002-4 and RtlGetVersion, so nothing is queried at crash time. The Cargo.toml change only enables two more features of windows-sys, which the loader already uses; no new dependency. Small note: first-chance breakpoint reports (VICTORY_CRASH_BREAKPOINTS=1) go through the same path and will carry the line too, contrary to the PR body; harmless.

CI: no check runs on the head commit.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/213#issuecomment-7148456351) <!-- victory-triage v1 head=7f00a62a4b861f0a051cc600470ce0570ab43c6f verdict=merge-candidate at=2026-11-25T00:18:15Z --> Automated triage for the maintainers. **Merge candidate.** This adds a `host: <CPU brand string>, Windows <major.minor.build>` line to crash reports, panics and `log_crash` output in `crates/victory-loader/src/crash.rs`, computed once in `log_crashes_to` from `cpuid` leaves 0x80000002-4 and `RtlGetVersion`, so nothing is queried at crash time. The `Cargo.toml` change only enables two more features of `windows-sys`, which the loader already uses; no new dependency. Small note: first-chance breakpoint reports (`VICTORY_CRASH_BREAKPOINTS=1`) go through the same path and will carry the line too, contrary to the PR body; harmless. CI: no check runs on the head commit. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!213
No description provided.