Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8303549

[AIX] TestNativeStack.java is failing with exit value 1

    XMLWordPrintable

Details

    • b04
    • ppc
    • aix

    Backports

      Description

        Stackoverflow exception has caused an exit value 1 when native thread is attaching as daemon.

        On AIX the default stack size of POSIX thread is 192 KB [https://www.ibm.com/docs/en/aix/7.1?topic=p-pthread-attr-getstacksize-subroutine ]. But in VM's thread creation logic, we set the default thread stack size to 2 MB [ https://github.com/openjdk/jdk/blob/master/src/hotspot/os_cpu/aix_ppc/globals_aix_ppc.hpp#LL33C64-L33C64 ] . So, in the absence of an explicit -Xss value the Java threads have 2M as the default stack size.
         
        This stack size is used by the function CallJavaMainInNewThread() to explicitly set the pthread attribute for stack size: https://github.com/openjdk/jdk/blob/master/src/java.base/unix/native/libjli/java_md.c#L671
         
        But on this particular test we are not going through any particular JVM thread creation routines instead we are using a pthread_create() function which is defined in pthread library, hence we are getting 192 KB as default stack size which is default stack size of posix thread on AIX.
         

        Log:

        stdout: [Triggering a JNI warning
        Native thread is running and attaching as daemon ...
        ];
         stderr: [ Test ERROR. Can't attach current thread: -1 ]
         exitValue = 1

        java.lang.RuntimeException: Expected to get exit value of [0], exit value is: [1]`

        Attachments

          Issue Links

            Activity

              People

                varadam Varada M
                amitkumar Amit Kumar
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: