Loader: a fault while reporting one is not reported again #586
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!586
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-586"
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?
@gkissel on GitHub · 2026-11-27 12:42 UTC · original
gkissel:crash-report-reentrancy→a-publier· +94 −1 · 1 files · 2 commits · openAI-assisted (Claude). Measured on my own machine. What was and was not run is listed under "Tested".
Problem
Under Wine, a fault inside the crash report re-enters the vectored handler on the same thread. That report faults the same way, and the thread recurses until its stack runs out. The first report is lost and the thread dies on a stack overflow instead of the original exception.
What I saw (GTX 1650 Mobile, NVIDIA 620.70.06, Wine 11.21, vkd3d-proton 3.1, Linux): the host driver's shader compiler faulted on a pipeline worker. Wine then logged
virtual_setup_exception stack overflowon two workers, at the same instruction each time. That instruction symbolizes (PDB of a local build) tovictory_loader::crash::locate. Raising the worker stacks from 2 MiB to 64 MiB (RUST_MIN_STACK) moved nothing: the overflow came at the same instruction. So this is recursion, not a small stack.locateis only the deepest frame when the stack ran out. I did not pin down which call insidereportfaults first.Change
reportkeeps a thread-local flag. If the thread is already reporting, it returns, and the nested exception goes on unreported to the next handler. This covers both callers, the vectored handler and the unhandled-exception filter. The body ofreportis unchanged and now lives inreport_once.Known limit, also noted in the code: if a report never returns, the flag stays set and that thread reports nothing more.
This does not overlap the compiler guard here (
VICTORY_COMPILER_GUARD; in my runs it did not catch the NVIDIA fault under Wine), Marvisak/VIctory#1897 (recovers a faultingRtlVirtualUnwindinside the walk), or Marvisak/VIctory#2401 (keeps a Wine compiler crash from ending the run). Those remove causes of a fault in or around the report. This one stops any fault in the report from recursing.Also,
module_ofuseschecked_subnow. Under Wine 11.21,GetModuleHandleExW(FROM_ADDRESS)succeeded for aVirtualAllocpage and returned a module above the address, solocatepanicked on the subtraction in a test build. That was another fault inside the report. Such an address is now shown bare.Tested
cargo clippy -p victory-loader --all-targets --locked -- -D warnings, with and without--all-features, cross-built forx86_64-pc-windows-msvcon Linux: clean.cargo xtask policy: ok.cargo test -p victory-loader --libunder Wine 11.21: 57 passed. Theload_probeintegration test could not build its fixture in my Linux cross-build (a Windows-style manifest path), unrelated to this change.a_fault_while_reporting_is_not_reported_again: a report whose own instruction-bytes read faults, with a later handler reopening the page. Under Wine 11.21 it fails without the flag (2 reports) and passes with it (1).handlerrather than inreport. This PR moves it intoreportso the unhandled filter is covered too.The same change is open upstream as Marvisak/VIctory#3520.
@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-27 12:42 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
@DecayingEagle on GitHub · 2026-11-27 16:51 UTC · original
Independent Wine validation on RX 7900 XT / CachyOS, private Wine 11.22 (mapped-view lookup patch), Rust 1.98.1 MSVC cross-target, diagnostics enabled. The loader change matches
840e0e496f5a9150ff98e169861aa3c0fedbe96f; #569 was also present in the GPU crate.reportreentry guard, while retaining the regression, reproduces the assertion: two reports instead of one.a_fault_while_reporting_is_not_reported_again.-D warnings, and repository policy pass.This verifies reporting behavior under Wine 11.22. It does not fix or explain our separate title-side null command-allocator access in #583. No game data attached.
Testing and report assisted by OpenAI Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.