hle(dstorage): clean up WALLS_FILES on File drop and fix open_file checks #3145
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!3145
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3145"
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?
@RanoGames on GitHub · 2026-11-29 20:17 UTC · original
RanoGames:fix/dstorage-walls-files-and-open-file→main· +38 −4 · 1 files · 1 commits · openWhat it changes
Fixes three issues in
open_fileandFileincrates/victory-hle/src/modules/dstorage.rs:open_filepreviously pushed(file as usize, kept)intoWALLS_FILES, whilerelease::<File>never removed the entry when theFileinstance was dropped — causing unbounded growth and stale-address aliasing if a newFilewas later allocated at the same address. Addedwalls_key: usizeandimpl Drop for Fileto remove the entry fromWALLS_FILES.out.is_null()check inopen_filebefore callingCreateFileW/ allocatingInstance<File>soE_INVALIDARGdoes not leak the handle or object.std::io::Error::last_os_error()immediately afterCreateFileWbefore allocatingnameviaString::from_utf16_lossy.modules::dstorage::tests::open_file_cleans_up_walls_files_on_release_and_rejects_null_out.How it was tested
Fileleft its address inWALLS_FILES,out == NULLleaked an openFile, andlast_os_error()ran afterString::from_utf16_lossy.Drop for Fileremoves theWALLS_FILESentry,out == NULLreturnsE_INVALIDARGupfront, andlast_os_error()is captured immediately afterCreateFileW.cargo testpassed for the crates it touches: yes (cargo test --locked -p victory-hle --lib -- modules::dstorage::tests: 29 passed, 0 failed, 2 ignored;cargo xtask policy --stagedpassed)Checked for overlap
WALLS_FILES(0 PRs).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.