On Fri, 14 Aug 2026 04:22:40 GMT, Ashay Rane <[email protected]> wrote:

> This patch rewrites the code in the Windows port of HotSpot for detecting,
> handling, and reporting stack overflows.  This patch is motivated by 
> documented
> failures in JDK-8152598, JDK-8156538, JDK-8157521, JDK-8157924, JDK-8335362, 
> and
> in JDK-8067946.
> 
> The key result of this patch is that in addition to preventing the crashes 
> that
> can be reproduced using the information in the above JBS issues, HotSpot on
> Windows now supports far-access stack bangs in compiled code while continuing
> to leverage Windows' incremental stack growth based on guard pages, ensuring
> that we don't sacrifice performance that would have been lost to page-by-page
> stack bangs.  The Red and Yellow page counts now change the actual page
> permissions and HotSpot Guard Zone size, thus impacting the page that triggers
> the stack overflow error after stack banging.  This patch also makes HotSpot's
> semantics for stack overflows for native and VM threads on Windows to match 
> with
> those for Linux and macOS, in turn paving the way for supporting Reserved 
> Stack
> pages on Windows.
> 
> This is a non-trivial change, so I have documented the key ideas 
> [here](https://cr.openjdk.org/~arane/windows-stack).  The
> commits in this patch are organized (so far) to match the section headings in
> the document:
> 
> - ed824007: [Section 
> 4.1](https://cr.openjdk.org/~arane/windows-stack#growing-the-stack-on-demand)
> - f765e79d: [Section 
> 4.2](https://cr.openjdk.org/~arane/windows-stack#matching-hotspots-guard-zone-with-windows-stack-guarantee)
> - 9d694f5c: [Section 
> 4.3](https://cr.openjdk.org/~arane/windows-stack#handling-windows-stack-overflow-exceptions)
> - edf58c4f: [Section 
> 4.4](https://cr.openjdk.org/~arane/windows-stack#handling-subsequent-stack-overflows)
> - ff9b65f6: [Section 
> 4.5.1](https://cr.openjdk.org/~arane/windows-stack#miscellaneous-supporting-changes)
> - b3e146e9: [Section 
> 4.5.2](https://cr.openjdk.org/~arane/windows-stack#miscellaneous-supporting-changes)
> - 8189a507: [Section 
> 4.6](https://cr.openjdk.org/~arane/windows-stack#validation)
> 
> I've validated this patch by running through all tier 1, 2, and 3 JDK, 
> HotSpot,
> and LangTools tests on Windows/x64 and Windows/ARM64 in FastDebug config.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.org/jdk/pull/32365

Reply via email to