fix(tests): link Windows test executables without high-entropy addresses #18253
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18253"
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?
Imported from boykopovar/AnyPS5. Originally posted by angrysandhill on 2026-11-11T00:21:49Z.
What
Link the Windows test executables with
--disable-high-entropy-va, the address-space layout the relinker already gives titles.With MinGW's default
HIGH_ENTROPY_VA, Windows places the stacks of a test process's start-up threads anywhere from 4 GiB to past 1 TiB. These are the main thread and the loader's worker threads. So they sit inside the guest arena range in almost every run. Each is a 2 MiB reservation on a 2 MiB boundary. When one lands on the AGC driver memory at0xfe0000000, driver start-up fails withreplace guest placeholder with private memory: Attempt to access invalid address(#18252).add_test_executable: adds the flag for every test executable it makes.guest_video_out_wqhd_detection_exit_tests: built withadd_executableso that DLL teardown runs without--wrap=main. It loads libc, so it gets the same flag.agc_driver_frame_replay_relaunch_tests: drops its own-Wl,--disable-high-entropy-va, which the helper now covers.#679 made the same change for titles: the relinker writes them without
HIGH_ENTROPY_VA(0x140or0x100inWindowsPeWriter.cpp), andtest_windows_address_space.pychecks that a title's main thread stack stays below0x200000000. This applies it to the test executables. The trade-off is the one #679 describes: stacks and heaps keep 8-bit bottom-up randomization near the bottom of the address space, and images are still relocated.Tested
Setup: Windows 10 Home 22H2 (10.0.19045), AMD Radeon RX 6750 XT, AMD Software Adrenalin 26.10.1 (driver 32.0.21045.16010), WinLibs GCC 15.2.0 r7 UCRT, Release,
BUILD_TESTING=ON. Built onmain41b9e25with this change. The branch is based onb1f8766e5f, and the three changed spots are identical there.Flags: with the change,
objdump -pshowsHIGH_ENTROPY_VAon none of the 2,437 executables underbuild/tests.Where host memory sits at libc load. These numbers come from a local libc build that printed the guest arena's host holes and exited; that build is not part of this PR. Each run was
agc_driver_draw_cache_reuse_tests.exe.[0x7FFFFC000, 0x1000000000)mainFull suite: all 4,945 tests, 4 at a time, with the GPU tests on the RX 6750 XT (
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1). Nothing fails that passed in a run ofmain41b9e25without the change on this machine.vulkan_validation_gate_commandsand the threeguest_job_manager_worker_spin*tests are fixed onmainsince41b9e25, by #16558 ande8a78de717.agc_driver_sample_order_grid_referenceis addressed by #9503.guest_kernel_sys_aio,public_headers_compile_46andpublic_headers_compile_62timed out in themainrun and passed here. They also pass alone onmain, so this change doesn't explain them.Crash reproduced deliberately. Starting the test suspended and placing a stack-shaped 2 MiB region at
0xfe0000000before its loader runs reproduces the message exactly, 3 of 3 times. The issue has the details and the injector.No validation-layer run: only test link options change here, with no driver, recompiler or VideoOut code, and the Khronos layer is not installed on this machine.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)add_test_executable; a trial merge of both is clean.🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-11T00:33:08Z.
Review: COMMENTED
Reviewed — no blocking findings
I found no blocking issue in the CMake changes; the Windows and Windows relinker checks are still pending, so this is a comment rather than an approval.
What I ran
Head
977dd8053e21655af6a6d8b5d6e5f17ccfdd755d; base233c1606c46804b83e3f06f5bf8f376b8f8e07a8. The merge preview was clean and both revisions remained unchanged during the precheck. Environment: Linux 6.1, Python 3.11.2, GCC 12.2.0.Results
git diff --checkon the pinned base and head.All conventions checks passed.Negative control
mainFindings
Blocking
None found in the reviewed diff.
Non-blocking
The Windows and Windows relinker checks remain pending. The PR changes the MinGW test executable link options, so those results are relevant before approval.
Sources
Not verified
I did not run a local build or CTest, and I did not reproduce the reported Windows startup failure. The author’s Windows build and negative-control results are reported evidence, not runs performed here. The hosted Windows checks are pending; skipped jobs do not verify behavior.
To get this to a good state
No code change is requested from this review. Once the Windows checks finish, I can re-check their result against this head.