JDK-6231936 : hprof format=b problem with HAT: Thread 200000 not found for JNI local ref
  • Type: Bug
  • Component: tools
  • Sub-Component: hprof
  • Affected Version: 6
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-02-23
  • Updated: 2010-04-02
  • Resolved: 2005-04-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6
5.0u4Fixed 6 b31Fixed
Related Reports
Relates :  
Relates :  
Relates :  
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.
16-09-2005

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
12-03-2005

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
12-03-2005