-
Bug
-
Resolution: Duplicate
-
P3
-
repo-portola
-
None
-
Alpine Linux 3.11.3, musl libc (x86_64) version 1.1.24.
JDK built from Portola repository: https://hg.openjdk.java.net/portola/portola
-
x86_64
-
other
According to the specification: "ERRORS ESRCH No thread with the ID thread could be found."
This works because pthread_getcpuclockid() in glibc checks the passed thread id [2], [3].
However, this is not the case for musl libc which does not check the passed thread id [4]. For more details see discussion on musl mail list [5].
It looks like the thread id needs to be checked to be valid for muls libc.
[1] https://hg.openjdk.java.net/jdk/jdk/file/e6336e3c5984/src/hotspot/os/linux/os_linux.cpp#l5736
[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_getcpuclockid.c;h=5dadc95817479b4049c1f0d09947ec10b2b1e887;hb=HEAD#l30
[3] https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthreadP.h;h=06fb0d74c5c5941dc6a96a44a938ad265838b049;hb=HEAD#l256
[4] https://git.musl-libc.org/cgit/musl/tree/src/thread/pthread_getcpuclockid.c
[5] https://www.openwall.com/lists/musl/2020/02/10/6
- duplicates
-
JDK-8247589 Implementation of Alpine Linux/x64 Port
- Resolved
- relates to
-
JDK-8247589 Implementation of Alpine Linux/x64 Port
- Resolved
-
JDK-8205878 pthread_getcpuclockid is expected to return 0 code
- Resolved