startup: distinct DirectStorage error codes and null-argument checks #2178
No reviewers
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!2178
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2178/head"
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?
@tedin7 on GitHub · 2026-11-25 02:59 UTC · original
tedin7:x2w-w4-1843-dstorage-status→main· +137 −48 · 14 files · 7 commits · merged 2026-11-25 04:33 UTCPart of #1843
What this unblocks: a caller of the DirectStorage stand-in can tell a too-small destination from a read past the end of a file, and bad null arguments are refused instead of accepted silently.
Changes:
0x8007007A(ERROR_INSUFFICIENT_BUFFER); a file read at or past the end, or crossing it, reports0x80070026(ERROR_HANDLE_EOF). Other causes stayE_FAIL. The status entry and the first-failure record carry the same code.OpenFilewith a null path andCreateQueuewith a null descriptor returnE_INVALIDARG; a null output returnsE_POINTER; the output is nulled on refusal.E_FAILfor these causes now expect the specific code.startup_dstorage_destination_checkgains positive and negative cases on the real stand-in DLL.docs/startup-runtime.mddocuments the codes.Verification:
python3 -B tests/docs_links_check.py-> PASS (18 files, 401 links), Linux.python3 -B tests/run_checks_parallel_check.py-> PASS, Linux.x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-onlyonxcrdapi.cppand the changed fixtures -> no errors apart from MSVC-only__try/__exceptinlocal_log.h.3cea0e4b, default 3-slot pool:python3 x2w_pipe.py win2025 2178with the auto-discovered targets plusstartup_storage_worker_start.ctest --preset dev17/17 passed, 0 skipped.ctest --preset release17/17 passed, 0 skipped.0x80070026for the EOF case;Enqueuenow catches a failed queue growth inside the lock scope so astd::bad_allocno longer leaves the queue mutex held (startup_storage_worker_start, alloc sweep N=5, previouslyan exception left Submit).AI-assisted; commands listed were executed locally.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 03:59 UTC · original · edited 2026-11-25 04:05 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
3cea0e4ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 04:05 UTC · original
Every
begin_batch()call now passes this 32-byte array tofactory_create_queue, but that function unconditionally reads 40 bytes from each non-null descriptor insrc/startup_stubs/xcrdapi.cpp:355-357. Queue creation therefore reads eight bytes past the stack buffer; an ASan probe using the same logging loop reproduces a stack-buffer-overflow. Allocate at least0x28bytes here and for the newly added descriptor indstorage_directory_batches()so the archive fixtures do not introduce an out-of-bounds read.Useful? React with 👍 / 👎.
@tedin7 on GitHub · 2026-11-25 04:20 UTC · original
Fixed in
4ebbf8aa: every queue descriptor passed to factory slot 10 is now 0x28 bytes (directory_gpu.cpp and the other startup storage/dstorage fixtures that used 0x20), so the factory's 40-byte read stays in bounds.Verification (Win2025, 3-slot pool,
x2w_pipe.py win2025 2178 --force): dev 17/17 passed, release 17/17 passed, 0 skipped. Linux:python3 tests/docs_links_check.pypassed.AI-assisted; commands listed were executed locally.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 04:05 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
3cea0e4bbcℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".