RFR: 8371948: TestStackOverflowDuringInit.java fails xss too small on linux-aarch64 [v4]
David Holmes
dholmes at openjdk.org
Wed Dec 10 07:52:31 UTC 2025
On Wed, 10 Dec 2025 03:21:58 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
>>
>>
>> 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 incrementally with one additional commit since the last revision:
>
> Use jlong instead of jint
Looking good. Just a couple of minor issues.
Thanks
src/hotspot/share/runtime/os.cpp line 2580:
> 2578: }
> 2579:
> 2580: jlong os::get_minimum_java_stack_sizes() {
Suggestion:
jlong os::get_minimum_java_stack_size() {
src/hotspot/share/runtime/os.hpp line 394:
> 392: public:
> 393: // get allowed minimum java stack sizes
> 394: static jlong get_minimum_java_stack_sizes();
Suggestion:
// get allowed minimum java stack size
static jlong get_minimum_java_stack_size();
test/hotspot/jtreg/runtime/memory/ReadMinimumJavaStackSize.java line 1:
> 1: /*
We don't need a test to exercise the WhiteBox API explicitly.
test/lib/jdk/test/whitebox/WhiteBox.java line 80:
> 78: public native long getHeapSpaceAlignment();
> 79: public native long getHeapAlignment();
> 80: public native long getMinimumJavaStackSize();
Suggestion:
public native long getMinimumJavaStackSize();
-------------
Changes requested by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/28352#pullrequestreview-3561172332
PR Review Comment: https://git.openjdk.org/jdk/pull/28352#discussion_r2605559716
PR Review Comment: https://git.openjdk.org/jdk/pull/28352#discussion_r2605552128
PR Review Comment: https://git.openjdk.org/jdk/pull/28352#discussion_r2605565863
PR Review Comment: https://git.openjdk.org/jdk/pull/28352#discussion_r2605566674
More information about the hotspot-dev
mailing list