RFR: 8371948: TestStackOverflowDuringInit.java fails xss too small on linux-aarch64 [v2]

SendaoYan syan at openjdk.org
Tue Dec 9 15:05:38 UTC 2025


> 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
> 
> 
> This PR add whitebox API getMinimumJavaStackSize() to the the allowd minimum java stack size, and get the allowed minimum java stack size in test/hotspot/jtreg/runtime/ClassInitErrors/TestStackOverflowDuringInit.java
> 
> Change has been verified locally both on linux-x64 and linux-aarch64.

SendaoYan has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:

 - Make TestStackOverflowDuringInit.java start java sub-process after get wb.getMinimumJavaStackSize()
 - Make TestStackOverflowDuringInit.java start java sub-process after get wb.getMinimumJavaStackSize()
 - Add WhiteBox.getMinimumJavaStackSize() to get the minimum allowed java stack size
 - Merge branch 'openjdk:master' into jbs8371948
 - 8371948: TestStackOverflowDuringInit.java fails xss too small on linux-aarch64

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/28352/files
  - new: https://git.openjdk.org/jdk/pull/28352/files/633f6a79..b3f4fa96

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28352&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28352&range=00-01

  Stats: 96082 lines in 1652 files changed: 63062 ins; 23095 del; 9925 mod
  Patch: https://git.openjdk.org/jdk/pull/28352.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28352/head:pull/28352

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


More information about the hotspot-dev mailing list