Repository navigation
Crash reports: show the bytes of an instruction the CPU refused - #198
Merged
Marvisak merged 1 commit intoNov 24, 2026
Merged
Conversation
An illegal or privileged instruction is reported by its address only, which does not say which instruction it was. On an Intel host that is the question every such report raises (clwb, clzero, rdpru, an SSE4a form...), and reporters have had to guess or dump the bytes by hand. The report's first line now ends with up to 15 bytes at the faulting address, as hex, read no further than the end of that page, so the report names the instruction by itself.
This was referenced Nov 24, 2026
|
Tested
No game data used. |
edsuuu
referenced
this pull request
in edsuuu/VI-BR-PORT
Nov 24, 2026
…U refused Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closed
suirentakamura
referenced
this pull request
in suirentakamura/victory-suiren
Nov 24, 2026
Crash reports: show the bytes of an instruction the CPU refused
itsonlysimbo
pushed a commit
to itsonlysimbo/VIctory
that referenced
this pull request
Nov 24, 2026
…tion-bytes Crash reports: show the bytes of an instruction the CPU refused
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's wrong
When the CPU refuses an instruction (
0xc000001dillegal instruction,0xc0000096privileged instruction), the crash report gives only its address:The address doesn't say which instruction failed. On Intel hosts that is the first question every one of these reports raises, because the console's Zen 2 CPU has instructions Intel CPUs lack:
clwb,clzero,monitorx/mwaitx,rdpru, SSE4a. The loader emulates the ones it knows, and the next one it doesn't know shows up as exactly this line. So far reporters have had to guess (#103 suggests "SHA-NI, SSE4a, or RDPID" for what turned out to beclwb) or dump the bytes by hand (#7). The reply in #106 asks for the address and the CPU model "to tell which encoding" it was, and #85's local patch logged the bytes for the same reason.What the fix does
For these two exceptions,
reportincrash.rsnow adds the bytes at the faulting address to the end of the report's first line:emulate_amd_onlyalready reads instruction bytes under the same rule.Other exceptions, the register lines and the stack lines don't change.
How it behaves after the fix
The report names the instruction by itself, in the console output and in
crashes.logalike:0f 01 fdisrdpru,66 0f ae /6isclwb, and so on, so whoever reads the report can tell which instruction is missing without a debugger or the title's files.Tests
The new test
instruction_bytes_stop_at_the_end_of_their_pagecovers the byte reader:PAGE_NOACCESS, it gives exactly those 3 bytes and doesn't fault.I ran
cargo test --workspaceon GitHub'swindows-latestwith Rust 1.98.1 fromrust-toolchain.toml:victory-loaderhas 19 passed, the other crates have 0 failed.reportan illegal instruction at the bytes ofrdpru. Onmainit prints--test-threads=1. With 4 threads, the shader crate's GPU tests sometimes crash on that runner (STATUS_ACCESS_VIOLATION), on unmodifiedmainas well.Not tested: a real illegal instruction on an Intel host, or the title.
Related: #7, #85, #102, #103, #106 (Intel hosts,
0xc000001d). #34 addsrdpruandclzeroloops; this change doesn't overlap it.