HLE: name the archive whose compressed data does not unpack (#3893) #3938

Open
MannA-001 wants to merge 1 commit from upstream-pr/3938 into main
MannA-001 commented 2026-12-01 17:38:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MannA-001 on 2026-12-01T17:38:14Z.


Refs #3893.

What happens

On #3893 the title stops on its own breakpoint at +0x22106e0 in early boot. That address is a shared "must not be null" check (+0x2a34d0: test rcx,rcx; je +0x22106e0). Here it is reached from a deserializer at +0x247f590. That function reads a 0x90-byte header and a 4-byte count from a stream, allocates count bytes, and asserts the pointer. A count of 0 (garbage input) gives null, and the title stops with nothing in the log saying why.

The same report shows about 454 dstorage: request failed: zlib (0x8007000d) lines before the stop, described as optional content. They are not harmless. On a whole dump no request fails: a 70 s boot of main here (Series 1.0.2.1, i5-12400F, RX 7800 XT) gets to the front end with 0 failed requests. The title doesn't check the request status. It reads what dstorage wrote and fails much later.

The change

  • Each request failed line now also names the file the request read (file=), using the existing source_name. That function also gets a null guard, because the "no source" failure path would otherwise dereference a null source.
  • The first request that fails with bad data (0x8007000d, from zlib or BCPack) also logs one error naming the archive and offset. It says the archive is most likely damaged and should be copied again or the dump verified, and that the title will stop later on one of its own asserts.

No behavior changes otherwise: requests fail exactly as before.

Tests

  • New test a_failed_request_names_the_file_it_read: a file source is named as opened, memory and null sources are named safely, and zeros in place of a zlib stream fail with 0x8007000d.
  • cargo test -p victory-hle dstorage: 17 passed. cargo clippy -p victory-hle --all-targets: clean.

I haven't confirmed that the reporter's archive is damaged; this PR makes the next run say which file and offset. Their stop being Zen 1-only may just mean that machine has the bad copy. If the failing file turns out to be whole, the new line shows exactly which request to look at.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5591080112 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3938). Originally posted by [MannA-001](https://github.com/MannA-001) on 2026-12-01T17:38:14Z. --- Refs #3893. ## What happens On #3893 the title stops on its own breakpoint at `+0x22106e0` in early boot. That address is a shared "must not be null" check (`+0x2a34d0`: `test rcx,rcx; je +0x22106e0`). Here it is reached from a deserializer at `+0x247f590`. That function reads a 0x90-byte header and a 4-byte count from a stream, allocates `count` bytes, and asserts the pointer. A count of 0 (garbage input) gives null, and the title stops with nothing in the log saying why. The same report shows about 454 `dstorage: request failed: zlib` (`0x8007000d`) lines before the stop, described as optional content. They are not harmless. On a whole dump no request fails: a 70 s boot of `main` here (Series 1.0.2.1, i5-12400F, RX 7800 XT) gets to the front end with 0 failed requests. The title doesn't check the request status. It reads what dstorage wrote and fails much later. ## The change - Each `request failed` line now also names the file the request read (`file=`), using the existing `source_name`. That function also gets a null guard, because the "no source" failure path would otherwise dereference a null source. - The first request that fails with bad data (`0x8007000d`, from zlib or BCPack) also logs one error naming the archive and offset. It says the archive is most likely damaged and should be copied again or the dump verified, and that the title will stop later on one of its own asserts. No behavior changes otherwise: requests fail exactly as before. ## Tests - New test `a_failed_request_names_the_file_it_read`: a file source is named as opened, memory and null sources are named safely, and zeros in place of a zlib stream fail with `0x8007000d`. - `cargo test -p victory-hle dstorage`: 17 passed. `cargo clippy -p victory-hle --all-targets`: clean. I haven't confirmed that the reporter's archive is damaged; this PR makes the next run say which file and offset. Their stop being Zen 1-only may just mean that machine has the bad copy. If the failing file turns out to be whole, the new line shows exactly which request to look at. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cloph-dsp commented 2026-12-01 18:09:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-12-01T18:09:59Z.


Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree.

Base 63bcca43c6a00a758510398fa43096ce7e4f7df0, head 34166881d75323ed5139c4a9215a96852232c327. git diff --numstat → crates/victory-hle/src/modules/dstorage.rs 44/0.

The test is new on the base:

git grep -F a_failed_request_names_the_file_it_read 63bcca43 -- .

→ no match, exit 1.

git diff --check "63bcca43..34166881" → no output, exit 0.

$env:CARGO_TARGET_DIR='D:\Victory-Contrib\target-3938'
cargo test --locked -p victory-hle --lib -- modules::dstorage::tests::a_failed_request_names_the_file_it_read --exact --test-threads=1 --quiet

Result: running 1 test, test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 152 filtered out; finished in 0.01s.

What the test pins: with a request reading a file the title opened, source_name ends with data.bin (the name a user can act on); a MEMORY_SOURCE request reads as memory and a null source as nothing, so the error text can never walk a bad pointer; and zeros where a zlib stream belongs make execute return INVALID_DATA, the value that now routes into damaged.

Two limits worth stating: the one-shot SAID latch in damaged is not asserted (it is process-global and AtomicBool, so a second call would not be observed in the same test binary), and the test calls source_name and execute directly rather than going through the request queue.

The fixture writes its own 16 bytes to a temp file; no title archive, no device, GPU/driver N/A. No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7320507350 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3938#issuecomment-7320507350). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-12-01T18:09:59Z. --- Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree. Base `63bcca43c6a00a758510398fa43096ce7e4f7df0`, head `34166881d75323ed5139c4a9215a96852232c327`. `git diff --numstat` → crates/victory-hle/src/modules/dstorage.rs 44/0. The test is new on the base: ``` git grep -F a_failed_request_names_the_file_it_read 63bcca43 -- . ``` → no match, exit 1. `git diff --check "63bcca43..34166881"` → no output, exit 0. ``` $env:CARGO_TARGET_DIR='D:\Victory-Contrib\target-3938' cargo test --locked -p victory-hle --lib -- modules::dstorage::tests::a_failed_request_names_the_file_it_read --exact --test-threads=1 --quiet ``` Result: `running 1 test`, `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 152 filtered out; finished in 0.01s`. What the test pins: with a request reading a file the title opened, `source_name` ends with `data.bin` (the name a user can act on); a `MEMORY_SOURCE` request reads as `memory` and a null source as `nothing`, so the error text can never walk a bad pointer; and zeros where a zlib stream belongs make `execute` return `INVALID_DATA`, the value that now routes into `damaged`. Two limits worth stating: the one-shot `SAID` latch in `damaged` is not asserted (it is process-global and `AtomicBool`, so a second call would not be observed in the same test binary), and the test calls `source_name` and `execute` directly rather than going through the request queue. The fixture writes its own 16 bytes to a temp file; no title archive, no device, GPU/driver N/A. No game data.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3938:upstream-pr/3938'
git switch 'upstream-pr/3938'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3938'
git switch 'upstream-pr/3938'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3938'
git switch 'upstream-pr/3938'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3938'
git switch 'main'
git merge --squash 'upstream-pr/3938'
git switch 'main'
git merge --ff-only 'upstream-pr/3938'
git switch 'main'
git merge 'upstream-pr/3938'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!3938
No description provided.