RFR: JDK-8303549: [AIX] TestNativeStack.java is failing with exit value 1 [v2]

Gerard Ziemski gziemski at openjdk.org
Wed May 31 15:41:58 UTC 2023


On Wed, 31 May 2023 08:57:16 GMT, Varada M <duke 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)
>
> Varada M 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 three additional commits since the last revision:
> 
>  - stack size added
>  - Merge remote-tracking branch 'upstream/master' into test_native_stack
>  - Added stack size

Marked as reviewed by gziemski (Committer).

test/hotspot/jtreg/runtime/jni/getCreatedJavaVMs/exeGetCreatedJavaVMs.c line 98:

> 96:     size_t stack_size = 0x100000;
> 97:     pthread_attr_setstacksize(&attr, stack_size);
> 98:     int status = pthread_create(&threads[i], &attr, thread_runner, (void *)(intptr_t)i);

In real world app, we should use `pthread_attr_destroy(&attr)` after we no longer need it, but in this test it's no big deal (hopefully anyone reading this code will not stop here and learn to leak that resource).

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

PR Review: https://git.openjdk.org/jdk/pull/14209#pullrequestreview-1453566618
PR Review Comment: https://git.openjdk.org/jdk/pull/14209#discussion_r1211925575


More information about the hotspot-runtime-dev mailing list