dstorage: say why a read failed, retry EINTR, map errno to Win32 #130
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!130
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-130"
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?
@Olima34 on GitHub · 2026-11-26 18:01 UTC · original
Olima34:fix/dstorage-read-errors→main· +113 −21 · 2 files · 2 commits · merged 2026-11-26 19:00 UTCDirectStorage read failures on macOS lost their cause, and a read interrupted by a signal failed the request.
Evidence. In ItsMariusBC's run 3 on #110 (M5 Pro, Series S), 179 lines read
dstorage: request failed: reading the source ... hr=0x8007001e(ERROR_READ_FAULT) right before the crash, and the log cannot say why:from_win32mapped every io error except NotFound and PermissionDenied to ERROR_READ_FAULT;read_intogave up onEINTR, which is plausible in this signal-heavy process (read_exactretries it).What (only
modules/dstorage.rsand the docs):reading the source: Input/output error (os error 5) (Uncategorized). This covers both the raw copy and compressed sources.read_intogoes through a newfill_at, asread_exactdoes: it retriesInterrupted, continues through short reads, and treatsOk(0)asUnexpectedEof, which still becomesEND_OF_FILE.read_into/read_sourcenow returnio::Result, so the error reaches the log.from_win32(non-Windows) is the inverse of the UCRT's_dosmaperrtable:errno values below 35 are the same on every Unix; others are matched by kind. The Windows
from_win32is unchanged. Its other caller,open_file, gets the finer codes too, and nothing relied on 0x8007001e.Tests (both fail on main):
host_errors_map_to_their_win32_codes: on main, errno 12 gives 0x8007001e instead of 0x80070008.reads_go_on_past_signals_and_short_reads: a test reader returnsInterruptedonce, then 2 bytes at a time; no real signals.victory-hle tests on x86_64-apple-darwin (247), Windows clippy and
cargo xtask policypass. The Windows victory-hle tests also pass under Wine (161 library tests, including the 20 dstorage ones). This doesn't claim to fix the crash: it makes the next log say why those reads fail.@LakshanSivakumar on GitHub · 2026-11-26 18:56 UTC · original · approved these changes
Reviewed and tested together with the other open PRs on main (macOS x86_64 tests for shader, hle, loader and gpu, the setup shell tests, and Windows clippy). Thanks!