RFR: JDK-8303549: [AIX] TestNativeStack.java is failing with exit value 1
Varada M
duke at openjdk.org
Tue May 30 10:47:56 UTC 2023
On Tue, 30 May 2023 07:56:32 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Stackoverflow exception has caused an exit value 1 when native thread is attaching as daemon.
>> On AIX the default stack for posix thread is 192 KB. For this particular test we run thread in pthread_create() which is defined in pthread library thus not following JVM thread creation routines. Hence we have to explicitly provide stack size.
>>
>> Reported Issue :[JDK-8303549]( https://bugs.openjdk.org/browse/JDK-8303549)
>
> test/hotspot/jtreg/runtime/jni/nativeStack/libnativeStack.c line 112:
>
>> 110: warning = warn;
>> 111:
>> 112: #ifdef AIX
>
> I don't think we need to make this AIX specific, but of course the chosen value must work on all platforms.
Yes you are right, then I would change it.
> I'm still a little confused about this issue because we have:
>
> ```
> ./os_cpu/aix_ppc/os_aix_ppc.cpp:size_t os::_java_thread_min_stack_allowed = 64 * K;
> ```
>
> but the current issues suggests the pthread default of 192K is too small, so 64K is definitely too small!
>
> I would expect we have the same problem with other tests ... though some of them may be (artificially?) restricted to run on Linux. I have a test in #14139 that will likely need the same adjustment.
For this test , the default thread stack size is defined here :
`./src/hotspot/os_cpu/aix_ppc/globals_aix_ppc.hpp : define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default`
`test/hotspot/jtreg/runtime/jni/getCreatedJavaVMs/TestGetCreatedJavaVMs.java `failed with an exit value 134. The test is passing when stack size is explicitly provided.
> test/hotspot/jtreg/runtime/jni/nativeStack/libnativeStack.c line 115:
>
>> 113: pthread_attr_t attr;
>> 114: pthread_attr_init(&attr);
>> 115: size_t stack_size = 0x100000;
>
> Can we use a human readable value please e.g. `1 * M`
I got this error when given 1 * M `error: use of undeclared identifier 'M'`
By giving value as `1024 * 1024` also works.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14209#discussion_r1210088900
PR Review Comment: https://git.openjdk.org/jdk/pull/14209#discussion_r1210089024
More information about the hotspot-runtime-dev
mailing list