fix(victory): refcount host_alias views across section close and drop sections outside PHYSICAL lock #432
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!432
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-432"
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?
@Lewandox on GitHub · 2026-11-26 18:40 UTC · original
Lewandox:fix/victory-section-closed-alias-race→main· +128 −48 · 3 files · 1 commits · closed without mergingSummary
Fixes the section-close /
host_aliasrace conditions introduced in #352 (ee8b92e1) that contribute to #428 (first-world-frame GPU reset / TDR / MMU fault even withVICTORY_SECTION_MBunset).Root Causes Fixed
inplace::title_memory_section_closed+host_alias:host_aliasreturned a raw*mut u8after droppingALIASES, whiletitle_memory_section_closedimmediately calledUnmapViewOfFileon the same view. An in-flightshadow.rs::write_aliascould either fault mid-copy or silently write into another mapping/buffer allocated at the recycled virtual address.Arc<AliasView>(whoseDropcallsUnmapViewOfFile) and returned a scopedHostAliasguard fromhost_alias, guaranteeing the view remains mapped until every in-flight writer finishes.VIEWSandALIASESinhost_alias:host_aliasdroppedVIEWSbefore lockingALIASESand callingMapViewOfFile(section, ...). IfSection::droprantitle_memory_section_closed+CloseHandle(section)in that gap,host_aliascould callMapViewOfFileon a closed or recycled Windows kernel handle and cache the stale/wrong view inALIASES.VIEWS->ALIASES) acrosstitle_memory_section,title_memory_section_closed, andhost_alias, keepingVIEWSheld acrossMapViewOfFilesoCloseHandlecannot run concurrently, while dropping replacedArc<AliasView>values outside both locks.SectionoutsidePHYSICALlock inxmem::XMemFreePhysicalPages:Slice/Sectiondrops until afterPHYSICALmutex is released sotitle_memory_section_closedandCloseHandlenever run while holding the physical page-table lock.Tests
inplace::tests::host_alias_keeps_view_mapped_across_section_close_and_blocks_post_close_mappingverifying that an activeHostAliasstays valid and writable acrosstitle_memory_section_closed+CloseHandle, while subsequenthost_aliaslookups returnNone.Verification
cargo test -p victory-gpu --lib inplace::tests::host_alias_keeps_view_mapped_across_section_close_and_blocks_post_close_mapping(default and--features diagnostics)cargo test -p victory-hle --lib modules::xmem::testscargo xtask policyAddresses #428.
@Lewandox on GitHub · 2026-11-26 19:16 UTC · original
Closing as superseded after #409 (\inplace.rs\ in the combined base no longer uses the pre-#409 \host_alias\ map). Keeping the PR queue clean.
Pull request closed