storage: streamed archive pieces past end of file, constant offset shift and garbage-size requests during heavy streaming #1586
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#1586
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?
@denn0x on GitHub · 2026-11-24 14:37 UTC · original
Summary
With the DirectStorage stand-in (
src/startup_stubs/xcrdapi.cpp), one executable crashes intermittently in its own code during a heavy streaming phase. The crash site differs between runs, at about the same point in time. Every disassembled site reads a pointer or offset out of data the queue delivered, and the value it reads is garbage (-1,0xAAAAAAAC, or a null table). Runs with no refused or failed requests survived a 10-minute window; runs with them mostly did not.What is measured
stream_on_diskalready corrects zlib pieces it can prove against the archive's boundary table.Open questions
E_FAILand continues with stale destination memory.Done when
The same build passes 3 consecutive 600 s runs through the streaming phase with no refused requests, no zlib failures, and no crash in the executable's code. The run logs show the counts for each.
Not verified: whether zero-filled BCPack contributes to the crashes. Its data is texture data, so pointers there are not expected.
AI-assisted (Claude Code).
@R0Y00 on GitHub · 2026-11-24 14:54 UTC · original
Thanks for giving the repeated-run acceptance condition. Link the offset-shift comparison to #1198 and keep this issue for end-to-end stability. The next check should be a source-built archive and a caller that poisons the destination, then submits one valid, one past-EOF and one implausibly sized request. Record the first failed request, its status/fence order and whether the consumer proceeds after failure. Keep a truthful failure status and leave the destination untouched on refusal. Avoid an unconditional per-file offset or a fallback based on matching compressed size. Share a summary of outcomes from the private run.
@RenzoWit35 on GitHub · 2026-11-24 16:42 UTC · original
I'd like to take the source-built check requested here: a self-authored file, poisoned destinations, and one batch with a valid request, an offset-at-EOF request, an implausibly sized request and a valid one after them, for raw and zlib reads.
It records each status, the status/fence order, and that refused destinations stay untouched. Test-only, with no per-file offset or size fallback.
Environment: Windows 11, MSVC 14.51, dev and release presets. Related: #1198.
@R0Y00 on GitHub · 2026-11-24 16:54 UTC · original
Thanks for the fixture. #1664 is on main. Its raw and zlib controls show that a refused request leaves its poisoned destination untouched, the next request still completes, and each fence follows its status. Windows Release passed locally. This issue stays open for the loading reproduction and its first failing request.
@denn0x on GitHub · 2026-11-24 22:06 UTC · original
Thanks for #1664 and #1672. Summary of the private loading runs since then, in aggregate.
Build. A local build, not
main. It now contains #1672 and #1410. The local inferred-position fallbacks are off by default there: the constant offset shift and the later-piece / shared stream cache paths became opt-in after they served 0 requests in three consecutive runs. One local path remains on: a partial request served from the table interval that has the request's compressed size.Outcomes. Per run, through roughly the first 11,000 requests of the streaming phase:
Checks. With the fallbacks on, the stub check's storage controls failed (a damaged continuation was served from the stream cache). With them off, those controls pass on this build.
Not met. The 3 × 600 s condition is still not met. Runs now end between 300 and 500 s for reasons outside storage. I have no failing request beyond the two above to report an order for.
Next. The offset-shift comparison for #1198, kept separate from this issue.
@R0Y00 on GitHub · 2026-11-24 22:23 UTC · original
Thanks for separating the two repeatable end-of-file refusals from the write failures caused by local remapping. The later completions and absence of stuck statuses are useful. Let's keep this open for the three 600-second runs, and preserve the current end-of-file refusal.
For the next reusable storage check, please keep the constant shift, later-piece cache and partial interval match distinguishable. A source-built request at the table end should leave a poisoned destination untouched, publish its error before the fence, and allow the next request to finish. If you propose the partial interval lookup separately, a same-size wrong-entry control would test whether the lookup actually establishes entry identity. The offset-shift investigation can stay on #1198. Aggregate counts and a source-built fixture are enough for the public thread.
@denn0x on GitHub · 2026-11-25 00:55 UTC · original
Status update on the three requests, before anything else: the condition for closing (three runs of 600 s of streaming) is not met yet.
Why not. All our recent runs stop at our own time limit, set between 200 and 360 seconds, because each run currently tests something else (shader and memory changes), not storage. None of them reached 600 seconds of streaming. We have not run storage-only 600 s runs yet. Until we do, the numbers below are only partial runs, not the evidence you asked for.
What the partial runs show (seven full-length runs and one short one, all on the same private executable; aggregate counts from the storage heartbeat):
Still open from your list:
Please keep the issue open. We will post again when we have the 600 s runs, or the fixture, whichever comes first.
@R0Y00 on GitHub · 2026-11-25 01:17 UTC · original
The basic EOF refusal fixture already exists in startup_storage_refusal_order. I reran the Release test on Windows with the built XCRDAPI stand-in: raw and zlib requests starting at EOF completed with E_FAIL, their poisoned destinations stayed unchanged, the fence observed the failed status, and subsequent valid requests delivered exact bytes. Run
ctest --preset release --no-tests=error -R '^startup_storage_refusal_order$' -Vafter building startup_storage_refusal_order and startup_stub_xcrdapi. There is no need to duplicate that fixture. A table producer that selects one past its last entry, or the same-size wrong-entry case for the proposed interval match, would add separate evidence. The three full streaming runs and the local page-mapping refusal remain open.