HLE/xasync: run a failed call's cleanup without the completion lock (port of upstream #114) #1330
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/fxceless--victory-fork!1330
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1330"
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?
@CwWwWwW on GitHub · 2026-11-26 15:44 UTC · original
CwWwWwW:port/xasync-cleanup-lock→main· +52 −4 · 1 files · 1 commits · closed without mergingProblem
XAsyncComplete took the call's done lock and then ran the provider's cleanup while holding it - for a failing result, or a completion with no result size (crates/victory-hle/src/modules/xasync.rs). A provider whose cleanup waits for the thread that is completing the same call (or for a thread in XAsyncGetStatus) blocks on that lock while the completer waits for the cleanup: the title's async worker hangs permanently, and the whole game with it.
Upstream VIctory fixed this in commit 30a5202 (pull request #114, by Manuel Pérez); this is that fix ported to the fork.
Change
Callgets aclaimed: AtomicBool; the first completion swaps it and does the work, a second completion returns (same 'first one wins' rule as before).Tests
Coordination
Open PR #300 rewrites the same completion/cancel path for a different race (pending_with cancel use-after-free and the blocking XAsyncGetStatus wait). This fix is independent, but both edit the same lines: whichever lands second should be rebased. This branch is based on main; it does not include #300.
(CI note: the check job on main is currently red on the asset-policy violation; #1322 fixes that, after which this can be rebased.)
Pull request closed