RFR: 8371948: TestStackOverflowDuringInit.java fails xss too small on linux-aarch64
David Holmes
dholmes at openjdk.org
Tue Nov 18 03:00:17 UTC 2025
On Mon, 17 Nov 2025 14:31:46 GMT, SendaoYan <syan at openjdk.org> wrote:
> Hi all,
>
> On linux-aarch64, when page size is 64K, the minimal java thread stack size is 448K. So this PR increase the minimal java thread stack size in test/hotspot/jtreg/runtime/ClassInitErrors/TestStackOverflowDuringInit.java. Below is the calculation formula for the minimal java thread stack size:
>
>
> page_size = 64K
> _java_thread_min_stack_allowed = 72K
> _stack_red_zone_size = align_up(StackRedPages * unit, page_size) = align_up(1*4K, 64K) = 64K
> _stack_yellow_zone_size = align_up(StackYellowPages * unit, page_size) = align_up(2*4K, 64K) = 64K
> _stack_reserved_zone_size = align_up(StackReservedPages * unit, page_size) = align_up(1*4K, 64K) = 64K
> _stack_shadow_zone_size = align_up(StackShadowPages * unit, page_size) = align_up(25*4K, 64K) = 128K
> _java_thread_min_stack_allowed = align_up(72K+64K+64K+64K+128K, 64K) = 448K
>
>
> Change has been verified locally both on linux-x64 and linux-aarch64.
A more resilient change would be to add a WhiteBox API to obtain the minimum stack for the actual platform in use, and then exec the VM with that as an -Xss value. Is that something you can do?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28352#issuecomment-3544803277
More information about the hotspot-runtime-dev
mailing list