runtime: verify page boundaries across a partial decommit #183

Merged
Vonsek merged 1 commit from upstream-pr/184 into main 2026-11-21 18:12:47 +00:00
Vonsek commented 2026-11-21 18:10:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T18:10:01Z.


Change

Extend the existing desktop_memory_query fixture to cover a two-byte request crossing a page boundary. It dirties four committed pages, decommits the two middle pages, and queries both bytes of the request. The fixture now checks the containing page address and the exact length of each contiguous region. After recommit it checks all four pages for the expected contents.

Verification

Commit 2ebbd84 on ccfa703, Windows build 26200 x64, MSVC 19.44.35230, Debug.

. ./tools/dev.ps1
cmake --preset dev
cmake --build --preset dev --target memory_query_check era_query_check era_heap_check
ctest --preset dev --no-tests=error -R '^(desktop_memory_query|era_query_.*|era_heap_.*)$' -V

All 11 selected CTests passed with zero skips. The page size was 4,096 bytes. The two-byte request decommitted 8,192 bytes. After recommit, all 8,192 bytes read zero and both neighboring pages retained their 8,192 marker bytes.

Before changing the region checker, the new fixture built successfully and failed ctest --preset dev --no-tests=error -R '^desktop_memory_query$' -V with Two-byte decommit: expected two reserved pages between committed neighbors. The old assertion compared the unaligned query pointer to Windows' page-aligned result.

Evidence and follow-up

This is an original, MIT-licensed C++ fixture using anonymous private memory in its own process. The two-byte decommit and page-aligned query semantics follow Microsoft's VirtualFree and VirtualQueryEx documentation. The result measures desktop Windows behavior.

This contribution was AI-assisted.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed. The existing test command covers this fixture.
  • I did not include game files, dumps, distribution links or secrets.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6532560359 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/184). Originally posted by [Vonsek](https://github.com/Vonsek) on 2026-11-21T18:10:01Z. --- ## Change Extend the existing `desktop_memory_query` fixture to cover a two-byte request crossing a page boundary. It dirties four committed pages, decommits the two middle pages, and queries both bytes of the request. The fixture now checks the containing page address and the exact length of each contiguous region. After recommit it checks all four pages for the expected contents. ## Verification Commit `2ebbd84` on `ccfa703`, Windows build 26200 x64, MSVC 19.44.35230, Debug. ```powershell . ./tools/dev.ps1 cmake --preset dev cmake --build --preset dev --target memory_query_check era_query_check era_heap_check ctest --preset dev --no-tests=error -R '^(desktop_memory_query|era_query_.*|era_heap_.*)$' -V ``` All 11 selected CTests passed with zero skips. The page size was 4,096 bytes. The two-byte request decommitted 8,192 bytes. After recommit, all 8,192 bytes read zero and both neighboring pages retained their 8,192 marker bytes. Before changing the region checker, the new fixture built successfully and failed `ctest --preset dev --no-tests=error -R '^desktop_memory_query$' -V` with `Two-byte decommit: expected two reserved pages between committed neighbors`. The old assertion compared the unaligned query pointer to Windows' page-aligned result. ## Evidence and follow-up This is an original, MIT-licensed C++ fixture using anonymous private memory in its own process. The two-byte decommit and page-aligned query semantics follow Microsoft's [VirtualFree](https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualfree) and [VirtualQueryEx](https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualqueryex) documentation. The result measures desktop Windows behavior. This contribution was AI-assisted. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. The existing test command covers this fixture. - [x] I did not include game files, dumps, distribution links or secrets.
upstream-sync closed this pull request 2026-11-24 06:41:43 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 06:47:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T18:10:12Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T18:11:53.545687Z 2ebbd84 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7067053255 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/184#issuecomment-7067053255). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-21T18:10:12Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"2ebbd84cb8821184d4c0c7b57a9b3deda595dbff","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-21T18:11:53.545687Z">2026-11-21T18:11:53.545687Z</relative-time> | `2ebbd84` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!183
No description provided.