dstorage: name a damaged archive instead of a bare zlib error #3387
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!3387
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3387"
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?
@suluojin-ui on GitHub · 2026-11-29 22:39 UTC · original
suluojin-ui:diag-damaged-archive→main· +59 −2 · 1 files · 1 commits · openThe two zlib paths in
dstoragealready returnERROR_INVALID_DATAwhen the bytes at an offset the archive's own table named are not a zlib stream. Nothing says why. On a machine whose extraction was incomplete this showed up as a title stopping at+0x4da6315, with two requests refused four milliseconds earlier and nothing buthr=0x8007000dto go on (#3335).This adds one check on the failing path only, and changes no behaviour that succeeds:
starts_a_zlib_streamimplements RFC 1950's header test — compression method8and(CMF << 8 | FLG) % 31 == 0— rather than comparing against a literal0x78, so valid streams with a smaller window are not misreported.note_damaged_archivefires only when the result isERROR_INVALID_DATAand the source does not begin a zlib stream. It logs once per(path, offset)through aOnceLock<Mutex<BTreeSet<..>>>, so a run that refuses the same block a hundred times names that archive once.map_errsites call it.inflate, the destination closure and the success paths are untouched.The message is:
with
path,offsetand the first two bytes as fields.Checked with
cargo check -p victory-hleandcargo test -p victory-hle dstorage(30 passed, 2 ignored, 0 failed).Why this is worth a line rather than a fix: the offset comes from the archive's own table, so a mismatch between the table and the bytes is a statement about the file, not about the loader. Saying it once turns a silent
ERROR_INVALID_DATAinto the one thing a user can act on.@babuakhil on GitHub · 2026-11-30 18:05 UTC · original
Checked on Windows 11 (Rust 1.98.1, pinned), applied on current
main(84bd61e2); cherry-picks cleanly.cargo test -p victory-hle --lib dstoragegives 38 passed, 0 failed, including the new header test. Clippy onvictory-hlestops invictory-gpu(rangednever used), which is onmaintoo. Not tested in the game.One correction to the description first:
mainalready names the file. Since96270e51(also in this PR's base), every failed request goes throughfail, which logspath,offset, the sizes andhrwith "dstorage: request failed: zlib". So what this adds is the diagnosis, not the file name.I ran
executedirectly with a tracing subscriber capturing WARN and up, on both, from a throwaway test (not part of this PR):mainlogsERROR_INVALID_DATAfirst=74 68+ the same WARNERROR_INVALID_DATAERROR_INVALID_DATAERROR_INVALID_DATApath=""path=""+ WARNSo it does what it says for a file whose table and bytes disagree, and changes no result. Two suggestions:
MEMORY_SOURCEthe bytes came from title memory, not a package on disk, so "the package was not extracted completely; re-extract it" sends the user the wrong way, and the line names no file. Returning early whensource_path(request)is empty (or the option is set) would keep the message to files.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.