Details
-
Bug
-
Resolution: Fixed
-
P3
-
7u45
-
b10
-
x86_64
-
generic
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8045389 | 8u25 | Kevin Walls | P3 | Resolved | Fixed | b01 |
JDK-8039740 | 8u20 | Kevin Walls | P3 | Closed | Fixed | b10 |
JDK-8053308 | emb-8u26 | Kevin Walls | P3 | Resolved | Fixed | b17 |
JDK-8039907 | 7u80 | Kevin Walls | P3 | Closed | Fixed | b01 |
JDK-8060865 | 7u79 | Kevin Walls | P3 | Resolved | Fixed | b01 |
JDK-8057298 | 7u76 | Kevin Walls | P3 | Resolved | Fixed | b01 |
JDK-8050335 | 7u75 | Kevin Walls | P3 | Resolved | Fixed | b01 |
JDK-8049869 | 7u72 | Kevin Walls | P3 | Closed | Fixed | b04 |
Description
JNI code is using pthread_key_create with a destructor to detach the thread from the JVM when the thread is exiting.
This solution works well when running on Solaris or a 32 bit JVM on Linux, but when run on 64 bit JVM on Linux the threads hang when detaching.
For 64 bit Linux the JVM is also using the pthread_key_create, to store the
Thread::current() value in a thread local storage.
Since the thread local storage containing the thread pointer is erased (by pthread) before the JNI destructor runs, we run detachCurrentThread on a thread that has NULL as current thread.
With a product build this breaks locks/monitors, and the threads hang. With a debug build an assert in Thread::current() is hit instead.
Everything works if detachCurrentThread is called from the main logic instead.
Attachments
Issue Links
- backported by
-
JDK-8045389 "assert(thread != NULL) failed: just checking" due to Thread::current() and JNI pthread interaction
- Resolved
-
JDK-8050335 "assert(thread != NULL) failed: just checking" due to Thread::current() and JNI pthread interaction
- Resolved
-
JDK-8053308 "assert(thread != NULL) failed: just checking" due to Thread::current() and JNI pthread interaction
- Resolved
-
JDK-8057298 "assert(thread != NULL) failed: just checking" due to Thread::current() and JNI pthread interaction
- Resolved
-
JDK-8060865 "assert(thread != NULL) failed: just checking" due to Thread::current() and JNI pthread interaction
- Resolved
-
JDK-8039740 "assert(thread != NULL) failed: just checking" due to Thread::current() and JNI pthread interaction
- Closed
-
JDK-8039907 "assert(thread != NULL) failed: just checking" due to Thread::current() and JNI pthread interaction
- Closed
-
JDK-8049869 "assert(thread != NULL) failed: just checking" due to Thread::current() and JNI pthread interaction
- Closed
- relates to
-
JDK-8025568 Crash in VM starting NetBeans 7.3.1 on Ubuntu 13.04 with Java 8 EA build 106
- Resolved
-
JDK-8301570 Test runtime/jni/nativeStack/ needs to detach the native thread
- Resolved
-
JDK-8156708 Intermittent hangs/timeouts on SPARC in G1 since 9-b99
- Closed
-
JDK-8057761 [TESTBUG] Need a test to cover JDK-8033696
- Closed
-
JDK-8154715 Missing destructor and/or TLS clearing calls for terminating threads
- Resolved