United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6231936 hprof format=b problem with HAT: Thread 200000 not found for JNI local ref
6231936 : hprof format=b problem with HAT: Thread 200000 not found for JNI local ref

Details
Type:
Bug
Submit Date:
2005-02-23
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2005-04-01
Component:
tools
OS:
generic
Sub-Component:
hprof
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
6

Related Reports
Backport:
Relates:
Relates:
Relates:

Sub Tasks

Description
cruella<55> /opt/java/jdk1.6.0/bin/java -Xrunhprof:file=dump.hprof,format=b -jar /opt/java/jdk1.5.0/demo/jfc/SwingSet2/SwingSet2.jar 
Dumping Java heap ... allocation sites ... done.

cruella<56> ~/hat/bin/hat dump.hprof
Started HTTP server on port 7000
Reading from dump.hprof...
Dump file created Tue Mar 19 07:34:03 PST 2148
java.io.IOException: Thread 200000 not found for JNI local ref
	at hat.parser.HprofReader.getThreadObjectFromSequence(HprofReader.java:577)
	at hat.parser.HprofReader.readHeapDump(HprofReader.java:408)
	at hat.parser.HprofReader.read(HprofReader.java:221)
	at hat.parser.Reader.readFile(Reader.java:90)
	at hat.Main.main(Main.java:149)

###@###.### 2005-2-23 00:33:22 GMT

                                    

Comments
EVALUATION

It appears that this bug still isn't fixed. I have opened a new bug for Tiger on this problem 6325354 and will investigate making more changes in a Tiger update.

There is a window of time where the heap may have thread objects, but they won't actually be running threads, even though all the thread information is coming from JVMTI, I need to make doubly sure that leftover JNI local references that just missed being garbage collected don't try and refer to a thread object that hprof hasn't listed in the dump as a running thread.
                                     
2005-09-16
SUGGESTED FIX

Make sure hprof tls entries are not freed before heap is dumped.
Add checks in dump to verify this doesn't happen again.
Changed tls table to have a serial_number search key.
###@###.### 2005-03-12 01:50:13 GMT
                                     
2005-03-12
EVALUATION

Working on suggested fix.
###@###.### 2005-03-12 01:50:13 GMT

Further investigation on this issue reveals that JVMTI's IterateOverReachableObjects implementation has a bug whereby it reports references from threads which are exiting. It also reports the java.lang.Thread object for java threads which are not visible to JVMTI agents.

###@###.### 2005-03-16 20:03:11 GMT
                                     
2005-03-12



Hardware and Software, Engineered to Work Together