JDK-6246078 : HPROF: java -Xrunhprof Unexpected Exception
  • Type: Bug
  • Component: tools
  • Sub-Component: hprof
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-03-25
  • Updated: 2010-04-02
  • Resolved: 2005-09-30
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.
JDK 6
6 b55Fixed
Related Reports
Relates :  
Description
java -Xrunhprof 

Dumping Java heap ...Exception in thread "AWT-EventQueue-0" HPROF ERROR: Unexpected Exception found afterward [../../../src/share/demo/jvmti/hprof/hprof_util.c:589]
HPROF TERMINATED PROCESS

Happens on solaris/sparc with 1.6 ~b26, windows/x86 with 1.6 b27.
###@###.### 2005-03-25 16:36:34 GMT
This same basic problem is being fixed in 5.0 Update 7 (see bug 6326020).

Comments
EVALUATION This same basic problem is being fixed in 5.0 Update 7 (see bug 6326020).
27-10-2005

SUGGESTED FIX Make sure jclass objects are saved asap when event callback happens. Make sure new jclass objects only replace old ones when necessary. Make sure unprepared classes are handled properly. Make sure that getting fields failures means we can't use the field index values in the heap iterations.
20-09-2005

EVALUATION It appears this is due to an unprepared class, not a missing one, although fixing the places where a jclass might disappear for small windows of time does help things. The unprepared class would cause misc failures and the code logic figured it would just call FindClass to re-load the class, but the class was in the process of being loaded I suspect. If a jclass is unprepared, hprof can't do much with it, and the heap iteration functions will often give hprof references to unprepared classes, hprof just needs to handle this better. In any case, all uses of jclass's has been double checked for safety, and this problem should be fixed. I will verify a few runs with Volano to verify.
20-09-2005

SUGGESTED FIX Making sure class_get_all_fields does not fail if jclass is not available.
08-09-2005

EVALUATION I'm assuming hprof has gotten a VM_DEATH event, it is then doing the heap iteration, it gathers up reference information for all the current classes and instances of classes. Then it traverses that data and needs to get all the field information about each class, it is during that pass that I suspect a jni FindClass call is failing. Why would it be calling FindClass? If there is no jclass to get the fields, I need to get one via the name and the only way is with FindClass, but when I tag the class the jclass handle is saved, so I should have it. I'll try to re-create the problem.
08-09-2005