Repository navigation
Conversation
…changes nothing Since ItsNotRexed#6919, XMemMapPhysicalPages maps page by page and map_page unmaps an address before it looks up the new page number. A call with a valid page followed by an unknown one returned ERROR_INVALID_PARAMETER but left the first address remapped and the second unmapped, so the title's next read there faults. XMemMapPhysicalPagesScatter had the same order, and an unaligned entry failed only after the entries before it were unmapped. XMemFreePhysicalPages freed the entries before an unknown or repeated one. All three now check every address, window and page number first and change nothing when one is bad. A host failure part-way through a map is unchanged (ItsNotRexed#7331 covers rolling that back). xmem_test: 6 new checks fail on main and pass here (183 checks). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows test of Setup: Windows 11 x64, MSVC 19.44.35220 (
AI-assisted review/test. |
|
Native Windows integration test of I linked the same combined
Windows 11 build 26300, LLVM-MinGW Clang 23.1.6. The test copy uses |
|
Tested
AI-assisted (Claude Code). |
|
Tested c09b9f3 on RTX 5060, Windows 11, MSVC 2022 RelWithDebInfo: its AI-assisted. |
Claimed in the coordination issue as: #7496 (comment) (new RT item, a bug #6919 brought into
main)What and why
Since #6919,
XMemMapPhysicalPagesmaps page by page, andmap_pageunmaps an address before it looks up the new page number. A call with a valid page followed by an unknown one returnsERROR_INVALID_PARAMETER, but the first address is already remapped and the second unmapped, so the title's next read there faults.XMemMapPhysicalPagesScatterhas the same order, and an unaligned entry failed only after the entries before it were unmapped.XMemFreePhysicalPagesfreed the entries before an unknown or repeated one.All three now check every address, window and page number first and change nothing when one is bad. A host failure part way through a map (
MapViewOfFile3refusing) is left as it was: #7331 rolls that back, but it is stacked on #6995, which no longer applies tomain.Found by building #6995's
xmem_physical_testagainstmain'sxmem.cpp: #7154 (comment). That test's "the mapping it would have replaced is untouched" check passes with this change. Not in scope: the view protection (#7492 / #7499 / #7550), the commit charge (#7556), the title'sVirtualFreeon a physical window.Tested
Windows 11 Pro 26300, MSVC 2022 BuildTools,
RelWithDebInfo, Intel Core Ultra 9 285K, RTX 5080 (no GPU test involved). No game files.xmem_test: 6 new checks fail onmain5eb8f1d (183 checks, 6 failures) and pass with this change (183 checks, OK).ctest -C RelWithDebInfo: 111/111 pass (GPU and game-file tests skip without a Vulkan SDK orLEONIDA_GAME_DIR), the same as onmain.python -I scripts/check_no_game_data.pyon both files: clean.AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed. (no translator change)🤖 Generated with Claude Code