Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2150499 | 5.0-pool | Karunakar Gajjala | P4 | Closed | Won't Fix |
There is sometimes teh case when ThreadID gottten by TheadMXBean.getAllThreadIds() becomes zero.
The attached program works to pass the threadID gotten by getAllThreadIds() to getThreadInfo().
The passed threadID is zero, IllegalArgumentException arises.
REPRODUCE:
1) Compile the sttached test program: ThreadInfoGetter.java
2) Launch "java ThreadInfoGetter"
K:\shares2\threadid-becomes-zero>java ThreadInfoGetter
java.lang.IllegalArgumentException: Invalid thread ID entry
at sun.management.ThreadImpl.getThreadInfo0(Native Method)
at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:147)
at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:128)
at ThreadInfoGetter.run(ThreadInfoGetter.java:33)
---
Invalid thread ID entries = [0, 8, 5, 4, 3, 2]
Loop count = 19800
K:\shares2\threadid-becomes-zero>java -version
java version "1.6.0-beta2"
Java(TM) SE Runtime Environment (build 1.6.0-beta2-b76)
Java HotSpot(TM) Client VM (build 1.6.0-beta2-b76, mixed mode)
FREQUENCY:
2 times of 10 trials with test program
INVESTIGATION:
When AttachCurrentThread() is called , there seems short period which threadID is zero.
(threadID is not assined)
During such short period, if unassigned threadID is referred, IllegalArgumentException occurs.
The attached program works to pass the threadID gotten by getAllThreadIds() to getThreadInfo().
The passed threadID is zero, IllegalArgumentException arises.
REPRODUCE:
1) Compile the sttached test program: ThreadInfoGetter.java
2) Launch "java ThreadInfoGetter"
K:\shares2\threadid-becomes-zero>java ThreadInfoGetter
java.lang.IllegalArgumentException: Invalid thread ID entry
at sun.management.ThreadImpl.getThreadInfo0(Native Method)
at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:147)
at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:128)
at ThreadInfoGetter.run(ThreadInfoGetter.java:33)
---
Invalid thread ID entries = [0, 8, 5, 4, 3, 2]
Loop count = 19800
K:\shares2\threadid-becomes-zero>java -version
java version "1.6.0-beta2"
Java(TM) SE Runtime Environment (build 1.6.0-beta2-b76)
Java HotSpot(TM) Client VM (build 1.6.0-beta2-b76, mixed mode)
FREQUENCY:
2 times of 10 trials with test program
INVESTIGATION:
When AttachCurrentThread() is called , there seems short period which threadID is zero.
(threadID is not assined)
During such short period, if unassigned threadID is referred, IllegalArgumentException occurs.
- backported by
-
JDK-2150499 IllegalArgumentException:Invalid thread ID occurs in 6.0b76
- Closed
- relates to
-
JDK-8303624 The java.lang.Thread.FieldHolder can be null for JNI attaching threads
- Resolved
-
JDK-6412693 JNI attached threads can be seen to be partially constructed
- Closed
-
JDK-6300358 JVM abort with Full thread dump by kill -QUIT
- Closed
-
JDK-6576701 Thread.getName does not handle null name
- Closed