changeset 9701:975fdc0daefa

Merge
author aeriksso
date Thu, 05 Nov 2015 15:28:24 +0000
parents 9812b5403f04 2a591a32d924
children 976f986375f2
files
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/services/heapDumper.cpp	Thu Nov 05 13:39:03 2015 +0000
+++ b/src/share/vm/services/heapDumper.cpp	Thu Nov 05 15:28:24 2015 +0000
@@ -897,8 +897,10 @@
 void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
   InstanceKlass* ik = InstanceKlass::cast(k);
 
-  // Ignore the class if it hasn't been initialized yet
-  if (!ik->is_linked()) {
+  // We can safepoint and do a heap dump at a point where we have a Klass,
+  // but no java mirror class has been setup for it. So we need to check
+  // that the class is at least loaded, to avoid crash from a null mirror.
+  if (!ik->is_loaded()) {
     return;
   }
 
--- a/test/serviceability/dcmd/gc/HeapDumpTest.java	Thu Nov 05 13:39:03 2015 +0000
+++ b/test/serviceability/dcmd/gc/HeapDumpTest.java	Thu Nov 05 15:28:24 2015 +0000
@@ -66,6 +66,7 @@
         String cmd = "GC.heap_dump " + heapDumpArgs + " " + dump.getAbsolutePath();
         executor.execute(cmd);
 
+        verifyHeapDump(dump);
         dump.delete();
     }