mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:40:52 +01:00
[PR #555] [MERGED] fs, dstorage: a ReadFile into first-touch title memory commits the pages and reads again (RT-READFILE-NOACCESS) #600
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#600
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/555
Author: @Tyrannys
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:fix/readfile-noaccess📝 Commits (1)
779f901fs, dstorage: a ReadFile into first-touch title memory commits the pages and reads again (RT-READFILE-NOACCESS)📊 Changes
3 files changed (+118 additions, -1 deletions)
View changed files
📝
runtime/shims/dstorage.cpp(+23 -1)📝
runtime/shims/file_system.cpp(+36 -0)📝
runtime/test/file_system_test.cpp(+59 -0)📄 Description
Claimed in #14 as
RT-READFILE-NOACCESS.What
xmemmaps the title's physical pages as views of a reserve-only section, and its vectored handler commits each page the first time user-mode code faults on it. A kernel write raises no such fault. So aReadFileinto a page nobody has touched yet fails withERROR_NOACCESS(998).Sleep(1)andReadFileagain forever. Seen by sampling the thread and reading its TEB last-error. The boot never gets past its first frame loop (one clear, one draw,PresentX).read_file_rangereads into the same memory. The request completes withE_DSTORAGE_ACCESS_VIOLATION, and the title stops on anint3.Fix
ReadFile. OnERROR_NOACCESSit reads one byte of every 4 KiB page of the destination from user mode (the handler commits them), then callsReadFileonce more. Other errors and the normal path are unchanged.dstorage.cpp'sread_file_rangedoes the same.Tested
file_system_test: new check on a reserve-only section view with a first-touch commit handler. The hostReadFilefails withERROR_NOACCESS; the shimmed one reads all 196,731 bytes, which match. 494 checks, 0 failures.dstorage_testpasses.mainplus the open boot PRs (#375–#432, #445, #360, #219, #461, #404; see #321). Without this change, the file reader loops at 998 forever. With it, that loop is gone, the DirectStorageint3is gone, and the title runs much further: about 190 slot-67 compute pipelines instead of about 40, and still running at 120 s. It is still not past the boot screen: the frames are still black. The DirectStorage half is checked only by that run; there's no unit test for it.AI-assisted (Claude Code).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.