mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 08:33:12 -05:00
HotSpot makes its stack guard zones with an RW protect of the lowest pages of the thread's stack, then PROT_NONE, as it commits them on native Windows (os::pd_create_stack_guard_pages, then os::guard_memory). Below a host stack's guard page such a protect was only recorded, so the pages stayed reserved: they could not be written after the RW protect, and the zones never held. A protect of reserved pages that starts at the bottom of the reserve and stops short of the guard page now commits and protects them. The guard page and the reserve above the range stay as they are, so the stack still grows through the guard down to it, and the stack limit in the TEB still follows the committed stack. Windows moves the guard down by committing the pages below it as read/write guard pages, committed or not. The zones therefore hold until the stack is within one guard region of them (three pages on GitHub's runners), and the pages the guard reaches then come in read/write. The test checks both, and the debt entry says so.