Repository navigation
XAsync: a wait on a failed call during its cleanup waits for the status - #374
marquezinii wants to merge 1 commit into
Conversation
A failed call leaves the call table and runs its provider's cleanup before its status is published. XAsyncGetStatus(block, true) called in that window found no call to wait on and returned E_PENDING, which the documentation rules out for a wait. Such a waiter now waits until a status is published.
|
Thanks @marquezinii for this waiter-race fix. I tested head Result: 1 passed, 0 failed (86 filtered out). The regression test starts a waiter during failed-call cleanup and verifies |
|
CI evidence that this flake turns unrelated PRs red:
The status is read while the call is still pending. #566 does not touch |
|
Automated triage for the maintainers. Needs rebase. This PR does not merge cleanly into current The content has not been reviewed yet; it will be once the branch is rebased onto Generated by Claude Code |
Every BC7 dictionary entry but the first repeats its two width bytes before its indices; the first has its indices right after the widths. The parser skipped a u16 in every entry, so entry 0 lost its first index and the rest moved down by one, and blocks that refer to dictionary[0] came out wrong. In the shipped tables entry 0's widths are 4, 0 and the u16 after them is 2, where every other entry holds a copy of its widths. From fxceless/victory-fork pull request Marvisak#374 (davutsimsekk), also Belobug pull request Marvisak#181. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed (or zero-size) call is removed from
CALLSand has its provider's cleanup run inXAsyncCompletebefore its status is stored. A thread callingXAsyncGetStatus(block, true)in that window finds no call, so it does not wait, and reads the status that is stillE_PENDING. The docs say a wait returns only once the call "either completes or is canceled".This keeps the order (cleanup, then the status), which #114 also relies on, and fixes the waiter instead: when there is no call for the block and its status is still pending, it waits on a condition variable that
XAsyncCompletenotifies after it publishes a status. The check and the wait are done under the same lock the notifier takes after the store, so a wakeup cannot be lost.Tested with a new test: a provider whose cleanup starts a thread that waits on the block, then gives it 100 ms to find the call gone. Before the change that thread gets
E_PENDING(3 of 3 runs); now it getsE_ABORT(5 of 5 runs).cargo test -p victory-hlepasses and clippy reports nothing new. Not tried in a title run.The change sits next to the lines #114 edits in
XAsyncComplete, so whichever lands second may need a trivial rebase.https://learn.microsoft.com/gaming/gdk/docs/reference/system/xasync/functions/xasyncgetstatus