Repository navigation
Conversation
A fault inside the crash report reached the vectored handler again on the same thread, whose report faulted the same way, until the thread ran out of stack. A thread-local flag in report() lets the nested exception go on unreported, for both the vectored handler and the unhandled filter.
e429f52 to
771b5d6
Compare
|
Independent WARP/CPU verification of #3520 at head Setup: Windows 11 Pro 10.0.26200, AMD Ryzen 7 5700X3D,
Diff review: no bug found.
AI-assisted: Claude Code, Claude Sonnet 5.5. |
a_fault_while_reporting_is_not_reported_again reports a synthetic illegal instruction on an unreadable page: reading its bytes faults inside the report, and a handler after ours reopens the page. One report is made; without the flag, two. Under Wine 11.21 GetModuleHandleExW(FROM_ADDRESS) succeeded for a page from VirtualAlloc with a module above it, and locate panicked on the subtraction (a test build). Such an address is shown bare.
|
Thanks for the independent run. I added the missing test in 4f58146.
Run under Wine 11.21 (cross-built
Second fix in the same commit Writing the test exposed another problem: under Wine 11.21, Whole crate under Wine: 35 passed, 1 failed. The failure is Clippy with |
|
Independent CPU-only verification on Windows / Rust 1.100.0 / MSVC.
|
|
Independent verification of the PR author's concurrent WARP pipeline/draw test at
Main baseline pin: Windows x86_64 MSVC native runs. Local and remote source snapshots matched before and after each check. The adaptation applies the PR diff without additional source edits. AI-assisted verification. |
AI-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 #1897, which recovers a faulting
RtlVirtualUnwindinside the walk, or #2401, which keeps a Wine compiler crash from ending the run. Those remove two 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-loaderunder Wine 11.21: 35 passed, 1 failed. The failure isconcurrent_crash_records_stay_together, which also fails 3 of 3 on base under Wine (Loader: keep concurrent crash records whole #3092).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.