GPU: keep a guarded block's write fault from being declined in a race #77
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!77
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/77/head"
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?
@Exorion1er on GitHub · 2026-11-24 00:15 UTC · original
Exorion1er:fix/guard-fault-race→main· +5 −2 · 1 files · 1 commits · merged 2026-11-24 00:40 UTCWhat
on_write(the vectored handler behind guarded view memory inwatch.rs) callsopen()under the guard lock, then falls back towritable(at)after releasing it. A second thread can slip in between:protected, read-write).guard(), which protects B again and marks itprotectedandclean.open()saw no guarded block, andwritable(at)now sees B read-only →EXCEPTION_CONTINUE_SEARCH, and the title crashes on an ordinary write.The fix holds the guard lock across both checks, so nothing can re-guard the block in between.
Evidence
Under Wine/Proton (where exception dispatch is slow enough to hit the window), world runs ended 1–3 minutes in, three runs out of three, with an unhandled write fault in title code (
memcpyin ucrtbase, or title code directly) to view memory around0x1d…–0x20…. A temporary log in the decline path showed the faulting block inprotectedandcleanat the time it was declined, i.e. guarded by us, which is step 3 above.With the fix, the same runs went the full 8 minutes without that crash.
Tested
35b054e.cargo test -p victory-gpu -p victory-loader -p victory-game --libunder Wine: all pass (includingwatch.rs's guard tests).🤖 Generated with Claude Code