tests: reserve a fresh preferred base for the relocation-free fixture #1033

Merged
R0Y00 merged 1 commit from upstream-pr/1040 into main 2026-11-23 22:53:24 +00:00
R0Y00 commented 2026-11-23 22:34:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T22:34:32Z.


Refs #77 and #1026.

The Windows /O2 run for #1026 failed in the shared cpu_native_reloc_free test before it loaded the image: the fixed preferred address could not be reserved (Win32 487). Each child now reserves a system-selected range, proves the reservation covers the image, and sets that base only in its temporary source-built DLL copy. The free controls release the reservation immediately before native loading. The stripped case now also proves that the image executes when the range is free, and still requires exact Win32 487 and the existing mapper rejection when reserved.

Windows 11 26200.9974, MSVC 19.51, Release: ctest --test-dir out/verify-release --no-tests=error --output-on-failure --repeat until-fail:10 -R '^cpu_native_reloc_free$' passed 10/10. In every run the four relocated calls matched all 249 pairs; the stripped native free and reserved controls and exact pe_map refusal passed. In a separate synthetic setup, pre-reserving the original preferred address made a second fixed reservation fail with Win32 487, while the new setup reserved and encoded a different range.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6570220536 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1040). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T22:34:32Z. --- Refs #77 and #1026. The Windows /O2 run for #1026 failed in the shared `cpu_native_reloc_free` test before it loaded the image: the fixed preferred address could not be reserved (Win32 487). Each child now reserves a system-selected range, proves the reservation covers the image, and sets that base only in its temporary source-built DLL copy. The free controls release the reservation immediately before native loading. The stripped case now also proves that the image executes when the range is free, and still requires exact Win32 487 and the existing mapper rejection when reserved. Windows 11 26200.9974, MSVC 19.51, Release: `ctest --test-dir out/verify-release --no-tests=error --output-on-failure --repeat until-fail:10 -R '^cpu_native_reloc_free$'` passed 10/10. In every run the four relocated calls matched all 249 pairs; the stripped native free and reserved controls and exact pe_map refusal passed. In a separate synthetic setup, pre-reserving the original preferred address made a second fixed reservation fail with Win32 487, while the new setup reserved and encoded a different range.
upstream-sync closed this pull request 2026-11-24 06:45:59 +00:00
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!1033
No description provided.