Media test: the file-creation callback outlives the test (victory-hle test process crash) #4732
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4732
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4731"
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?
@KruIN689 on GitHub · 2026-12-01 04:11 UTC · original
KruIN689:up/media-callback-outlives→main· +9 −7 · 1 files · 1 commits · open[pr-tests]
What it changes
modules::media::tests::asynchronous_file_creation_reads_the_rewritten_pathhandsMFBeginCreateFilea COM callback with no-op AddRef/Release, and both the object and its vtable sit on the test's stack. Media Foundation releases the callback on its work queue afterInvokereturns. By then the test may be over and its thread's stack gone. ThatReleasereads freed memory, and the wholevictory-hletest process dies with 0xC0000005 (once 0xC0000409). It happens now and then on a busy or small machine, such as the 2-core CI runners.The callback and its vtable are now leaked with
Box::leak, so a lateReleasefinds them. Only the test changes.The other cause of the same process crash is in
xasync::complete_call, which upstream #2927 fixes. That PR is open and needs a rebase.How it was tested
modules::media::group, 2×10 runs in turns: 7 of 20 crashed. The test alone: 1 of 12.5fabb46e+ this) 0 of 15, and 10 passed unpinned.victory-hlesuite, pinned, 3×10 runs in turns, with #2927 applied too: 0 of 30 crashed, against 9 of 30 without both.cargo testpassed for the crates it touches: yes (cargo test -p victory-hle --lib).cargo clippy -p victory-hle --all-targets --locked -- -D warnings: clean on palmlight. On upstream main it stops at victory-gpu's five existing errors (#4708), before reaching this crate.Checked for overlap
Same change in our fork: Lyrnc/palmlight#93.
Found and fixed with the help of Claude Code (Claude Opus 5.5).
@Dukestar69 on GitHub · 2026-12-01 12:06 UTC · original · approved these changes
Reviewed crates/victory-hle/src/modules/media.rs: leaking the test's COM Callback and its vtable via Box::leak fixes the stack use-after-free when Media Foundation releases the callback on its async work queue after Invoke returns. Verified on Windows: cargo test -p victory-hle --lib modules::media::tests -- --test-threads=1 (10 passed, 0 failed).
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.