On linux systems with older glibc versions, e.g. 2.11, the test test/hotspot/jtreg/runtime/TLS/TestTLS.java fails, because __pthread_get_minstack is not provided. The test should be skipped instead if glibc is too old.
TestTLS.java tests the effect of -XX:+AdjustStackSizeForTLS by putting a large int array into glibc TLS [1]. The implementation of AdjustStackSizeForTLS uses the glibc private function __pthread_get_minstack to calculate the TLS size. AdjustStackSizeForTLS has no effect if __pthread_get_minstack is missing [2]. Consequently the test fails because the process reaper thread [4] cannot be created as the stack size is too small to accomodate the large TLS.
[1] TestTLS puts large array in glibc TLS
http://hg.openjdk.java.net/jdk/jdk/file/83949f956490/test/hotspot/jtreg/runtime/TLS/exestack-tls.c#l34
[2] No stack size adjustment if __pthread_get_minstack was not found in [3]
http://hg.openjdk.java.net/jdk/jdk/file/83949f956490/src/hotspot/os/linux/os_linux.cpp#l833
[3] Lookup of __pthread_get_minstack
http://hg.openjdk.java.net/jdk/jdk/file/83949f956490/src/hotspot/os/linux/os_linux.cpp#l821
[4] Process reaper cannot be created if stack size is not adjusted for TLS
http://hg.openjdk.java.net/jdk/jdk/file/83949f956490/test/hotspot/jtreg/runtime/TLS/T.java#l37
TestTLS.java tests the effect of -XX:+AdjustStackSizeForTLS by putting a large int array into glibc TLS [1]. The implementation of AdjustStackSizeForTLS uses the glibc private function __pthread_get_minstack to calculate the TLS size. AdjustStackSizeForTLS has no effect if __pthread_get_minstack is missing [2]. Consequently the test fails because the process reaper thread [4] cannot be created as the stack size is too small to accomodate the large TLS.
[1] TestTLS puts large array in glibc TLS
http://hg.openjdk.java.net/jdk/jdk/file/83949f956490/test/hotspot/jtreg/runtime/TLS/exestack-tls.c#l34
[2] No stack size adjustment if __pthread_get_minstack was not found in [3]
http://hg.openjdk.java.net/jdk/jdk/file/83949f956490/src/hotspot/os/linux/os_linux.cpp#l833
[3] Lookup of __pthread_get_minstack
http://hg.openjdk.java.net/jdk/jdk/file/83949f956490/src/hotspot/os/linux/os_linux.cpp#l821
[4] Process reaper cannot be created if stack size is not adjusted for TLS
http://hg.openjdk.java.net/jdk/jdk/file/83949f956490/test/hotspot/jtreg/runtime/TLS/T.java#l37
- relates to
-
JDK-8241092 make test-bundles fails on Alpine Linux because of TestTLS.java test
- Closed
-
JDK-8225035 Thread stack size issue caused by large TLS size
- Resolved