xcrdapi: fail a read whose destination is not committed instead of faulting #486
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/486"
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?
Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-29T15:47:39Z.
Summary
A read that decodes into the title's own memory ends with a plain store. When part of that range is not committed, the store faults on the provider's worker thread and the title ends with an access violation inside
xcrdapi.dll. An undecoded read into the same memory fails inReadFileinstead.Look at the destination first. A range with a part that is not committed now fails its request with
ERROR_NOACCESSthrough the usual failure path, and the log says how much of it could not be written, from which offset, and its state and protection. A part that is committed but protected is only logged (the first sixteen times) and the store goes ahead as before: whoever closed those pages may open them on the store, as draft #413 does.Seen in ProjectScarlett 1.0.2.1, 12 min 40 s into an offline run: a zlib read of
0x290000bytes to0x8c6200000faulted at offset0x10000, with the stack insidexcrdapi.dlland only the first 64 KiB of the destination writable. That run wasb8355fawith #389 andfc69bc2; the store is the same onmain.Not established: why the title's destination was in that state, and whether the rest of it was uncommitted or closed. The minidump holds no memory state. If it was closed rather than uncommitted, this change only logs it and the fault is still to be fixed where the pages are closed. The log line added here will say which the next time it happens.
Follows
fc69bc2(#457) in the same file. Draft #413 also changesqueue.rs; the two merge without a conflict there.Tested
Run the checks relevant to this change.
xcrdapisuite and the code checks did, except one Python test of the launcher that fails the same way onmainon this machine (below)Lanes issues no storage read into memory it has not committed, so the case is a unit test.
a_read_into_a_partly_committed_destination_fails_instead_of_faultingreads a zlib stream into three 64 KiB pages of which one is committed and expects the request to fail, then commits the rest and expects the same read to land. With the check taken out, the test process ends with an access violation in that read.GPU, driver and backend: GeForce RTX 4070 Ti SUPER, 620.73.04, Proton Experimental for the checks (Core i9-12900K, Linux 7.2.11).
Commands run and their results:
Checks
No evidence JSON changed.
Imported from brcly/TuxBox. Originally posted by Copilot on 2026-11-29T15:52:05Z.
Code review location:
runtime/xcrdapi/src/queue.rs; line 799A committed but protected prefix followed by an uncommitted tail returns
Some((true, ...))here, soexecute()copies the whole range and can still fault after the prefix's protection fault is handled. Continue scanning the full output range, giving uncommitted regions precedence over the saved protected-region diagnostic. Add a regression with a protected committed prefix followed by a reserved tail.Imported from brcly/TuxBox. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-29T15:52:05Z.
Review: COMMENTED
🟡 Changes recommended
The output-range check stops at a protected committed prefix, allowing execute() to copy into an uncommitted tail and fault; it must scan the full range and prioritize uncommitted regions.
1 open issue
What changed in this PR
Adds destination-memory checks to decoded reads in TuxBox’s
xcrdapiprovider, aiming to report uncommitted destinations through normal request failure instead of crashing the worker thread.Changes:
ERROR_NOACCESSfor detected uncommitted regions.runtime/xcrdapi/src/tests/queue.rsruntime/xcrdapi/src/queue.rsruntime/xcrdapi/Cargo.tomlReview effort: Balanced