Repository navigation
Crash reports: say what an access violation's address holds - #204
Merged
Merged
Conversation
An access violation is reported with the address it touched and nothing else, so a read of free memory, a write to memory that was reserved but whose commit failed, a stack guard page and a write to code or constants all look the same in a report. The report now adds what VirtualQuery says is at that address: nothing, reserved but never committed, a guard page, or the page's protection, with the module for an image's pages.
muhammed-aksoy
pushed a commit
to muhammed-aksoy/VIctory
that referenced
this pull request
Nov 24, 2026
edsuuu
referenced
this pull request
in edsuuu/VI-BR-PORT
Nov 24, 2026
…holds Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Thanks @Dufftwt for the access-violation report detail. I tested the open PR at head Result: 1 passed, 0 failed. The test exercises |
Closed
suirentakamura
referenced
this pull request
in suirentakamura/victory-suiren
Nov 24, 2026
Crash reports: say what an access violation's address holds
itsonlysimbo
pushed a commit
to itsonlysimbo/VIctory
that referenced
this pull request
Nov 24, 2026
…emory Crash reports: say what an access violation's address holds
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
An access violation is reported with the kind of access and the address it touched, and nothing else:
The address alone can't tell apart causes that need completely different fixes:
Today, finding out which one it was means asking the reporter for a dump and a debugger session. #99 is an example: three runs show "a write below 4 GB" with nothing more to go on.
What the fix does
reportincrash.rsnow asksVirtualQuerywhat is at the faulting address, and adds the answer after the address. A new helper,memory_at, turns the answer into one of these:nothing mapped therereserved, never committeda guard pageread-only,read-write,read-execute,no access, …), and the module name with offset when the page belongs to a loaded imageoutside the address space, for addressesVirtualQueryrejects, such as the all-ones address Windows reports for a non-canonical pointerIt only queries the address space; it never reads the faulting address itself, so it can't fault inside the handler. Other exceptions and the rest of the report don't change.
How it behaves after the fix
A report now says by itself whether a crash is a bad pointer, an allocation that never got its memory, a stack overrun, or a write to protected memory.
Tests
The new test
memory_at_names_what_an_access_hitreserves four pages and commits three of them as read-only, guard and no-access. It checks each description, then checks free memory (after releasing the pages, and address 0), an address past the end of the address space, and the test's own code (read-execute, in victory_loader-….exe+0x…).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.reportfour writes: into reserved pages, a guard page, address0x18, and the all-ones address. Onmain:--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 crash in the title.
Related: #23, #99. #12 and #34 also edit
crash.rs; both already conflict withmain, and this change adds no conflict of its own with either. It merges cleanly with #198, which adds the bytes of an illegal instruction to the same report line.