levels.rpf: 16-byte misalignment after decompression -> dstorage hr=0x8007000d, title stops at +0x4da6315 #3335
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#3335
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 21:56 UTC · original
A 16-byte misalignment inside
levels.rpfmakes dstorage returnERROR_INVALID_DATA, then the title stops at+0x4da6315This is not the
XMemVirtualAllocstop from v2026.11.29.04 (that one is+0x1e6c284), and it is not the Series S / Series X memory budget. It is a broken archive in a repackaged copy of the 1.0.2.1 package. Reported here because it looks exactly like "crashes loading the first scene" and, once identified, was reproducible byte for byte.What the log shows
The exception comes 4 ms after the refusals. Five separate runs (five PIDs, 64 s to 409 s apart) stopped at the same address with identical registers (
rax=0x2,rbx=0x260,r12=0x4c00989,r13=0xb747c,r14=0x13), so it is the same 16-byte window read every time.The archive is internally misaligned
Two copies of the package, both reporting
levels.rpfas 76,155,065,056 bytes, read at the two offsets the log names:17,570,844,688, a copy that runs reads78 da 64 d9 79 d4 0f 64 fe ff f1 d7 fb fd be 91then25 42 31 b4 28 92 4a fb aa 1d 51 31 e5 76 a3 db;25 42 31 b4 28 92 4a fb aa 1d 51 31 e5 76 a3 db ..., i.e. the good copy's bytes at17,570,844,688 + 16;17,635,937,168, both copies read the same 32 bytes (78 da 9d 9a 0b 5c 4d 69 ...).So the broken file is shifted by 16 bytes over part of that range and back again, inside a file of the same length. It came out of a 208 GB package that was distributed as one compressed archive and decompressed locally; the second copy is the same package extracted from the same archive on another PC. The failure is in the extraction, not in the emulator.
Why this is worth a change in the emulator
0x80000003in the title's own code with no file named. It took the twohr=0x8007000dlines to find it.PackageCheck(crates/victory-game/src/lib.rs) only checksdata/ttdb/graphics/ttdb_graphics.ttpf's size, and size is exactly what is wrong here: both copies are 76,155,065,056 bytes.dstoragerefusal onlevels.rpfis already fatal, and the title does not say which archive is damaged.Two possible asks, either is fine:
run, read the first block of each.rpfbeside the executable at its directory table's offset and check it starts with a zlib header (78 01/78 9c/78 da) or the block's declared compression; one file, one read per archive, done in a second.runlog say, once per archive, the firstERROR_INVALID_DATAand the offset, so that "the title stopped at +0x4da6315" is traceable to a named file.I can provide the crash log and the stack in full for the broken copy if useful; the good copy is the same package on the other PC, so the byte window above can be verified from either side.
@suluojin-ui on GitHub · 2026-11-29 22:30 UTC · original
Follow-up with a narrower ask, and one correction to my own wording above: nobody needs a copy of the broken archive to act on this.
The invariant, verified on a package that runs
levels.rpfat offset17,570,844,688,zlib,source_size=23074,destination_size=36272;78 da— a zlib header, which is what the archive's own table says is there;25 42 31 b4 28 92 4a fb aa 1d 51 31 e5 76 a3 db, which is the good copy's bytes at+16. So zlib is asked to decompress something that is not a zlib stream, and answersERROR_INVALID_DATA;17,635,937,168both copies read78 da 9d 9a 0b 5c …, so the 16-byte displacement is local, inside a file of the same length.The rule "the first byte at a zlib block's offset is
0x78" therefore holds on every package that runs, and costs one byte to check. This is not a guess about the title; it is a property of the archive format the title itself relies on.Minimal change in the layer
No RPF parsing, no behaviour change:
In
victory_hle::modules::dstorage, before a zlib request is given to the decompressor, check the byte atoffset. If it is not0x78, log once per archive, aterror:archive damaged: <path> offset=<n> does not start a zlib block (ERROR_INVALID_DATA follows): the package was not extracted completelyOn the existing failure path, raise the present
WARN … hr=0x8007000dtoerrorwith the same sentence.That alone replaces "the title stopped at
+0x4da6315" with a named file and offset. A user can then re-extract instead of changing F1 settings, which is what everyone tries first.Optional, before the run
The same one-byte check over the first block of each of the twelve
.rpffiles beside the executable: one 4 KiB read per archive, a few milliseconds. Only the byte at the offset the table names is needed.Also
A section in
docs/crash-addresses.mdunder a new+0x4da6315heading would let the people in #3084, #1813 and #2460 recognise this without reading the byte comparison: an0x80000003on the main-loop thread (+0x2215eca) withhr=0x8007000dfor an archive four milliseconds before it.I am not asking you to reproduce my file, and I am not claiming the emulator broke it. The point is that this stop has a cause that can be named and checked, and the log is the right place to name it.
@kibagami-nc on GitHub · 2026-11-29 22:39 UTC · original
Thanks, that's a clean case, and easy to act on. Two PRs now cover it:
0x78). The0x8007000dwarning with the request's details stays. The test uses your bytes (25 42 31 b4 …). It sits beside the same kind of line for a file cut short (#1250).+0x4da6315entry indocs/crash-addresses.md. It says to look forhr=0x8007000dnaming an archive just before the stop. It lists #3335 with its cause, and #3334 with the same address and no cause known yet.I left the optional check before the run out for now. It needs each archive's table to find a block's offset, and the line above already names the file on the first bad block.
@hkj4250 on GitHub · 2026-11-29 22:55 UTC · original
i ran a byte check on my story000.rpf and got a mismatch between my source file and the one im running from so recopying that. doing a b4b on the levels.rpf next and will let you know if it comes up clean and test after. (+0x4da6315)
#3334
@kibagami-nc on GitHub · 2026-11-29 23:26 UTC · original
@hkj4250 Good catch. If the stop at
+0x4da6315is gone once the files match, #3334 has the same cause as this issue, and I'll add it to the docs entry in #3219. Before recopying, a look at your play log forhr=0x8007000d(or0x80070026) just before the stop would also confirm which archive it was.@hkj4250 on GitHub · 2026-11-29 23:40 UTC · original
@kibagami-nc It was Story00.rpf. #3334 was my issue and i just went ahead and closed it after recopying the file and testing. Levels.rpf was fine on my end but that story change also fixed the subtitle freeze and the missed dialog execution. All good here now, ill be back if i find something else!