fix(libc): reserve the guest arena at its fixed range around what Windows already placed in it #231
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/231"
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 MichonGoddijn231849 on 2026-10-01T17:25:58Z.
What
Replaces #196, following the review there: one arena reservation path that keeps the required range, without relocating or shrinking.
On Windows the arena used to search for a free base and size, starting at 0x200000000. Windows places thread stacks and other reservations at random low addresses before libc starts, so the search often moved the arena up (to 0x2200000000) or shrank it. Guest mappings at the fixed low addresses titles use then fell outside it, and the process aborted with
shared mapping outside the guest arena.The arena is now always [0x200000000, 0x7200000000):
VirtualQuery. Every free, allocation-granularity-aligned piece is reserved as a placeholder.Allocateskips,MarkUsedrefuses to overlap, andReleasenever frees. The system-reserved range is one of them, as before.VirtualQueryor a failed reservation throws astd::system_error. There is no other layout to fall back to.Tested
Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.
shared mapping outside the guest arena; the earlier #196 runs had 3 of 4.ctest: all tests pass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository🤖 Generated with Claude Code