startup: skip unmapped ranges in guarded title-memory reads (VirtualQuery before __try) #2845
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#2845
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?
@tedin7 on GitHub · 2026-11-26 13:20 UTC · original
Part of #870
Problem
The startup runtime reads title memory through
probe_readable(),readable()and the guarded copy helpers (guarded_copy,copy_title_bytes). When a source range is not mapped at all (free address space), the read raises an access violation that the__tryguard catches. The copy result is correct, but each such fault is a first-chance exception. A debugger attached to the runtime stops on every one, and each costs a kernel round trip. Reads of stale or never-mapped pointers are common, so these faults add up.Wanted
VirtualQueryfirst and refuse a range that isMEM_FREE, without touching it. Reserved-but-uncommitted pages stay accessible, because the lazy-commit memory relies on first-touch faults.__trycopy as the last guard for ranges that change after the query.faults_avoided) and show the count in the render totals log line.Test
startup_local_logreleases its own address range, verifies it is free before and after, and requires zero first-chance exceptions on the checking thread, four counted refusals per round, and one control fault when the range is touched directly.Source: Microsoft documentation, VirtualQuery and Structured Exception Handling.
@tedin7 on GitHub · 2026-11-26 13:20 UTC · original
Claiming this; a Draft PR follows shortly.