src/share/vm/services/heapDumper.cpp

changeset 9668
acb9351e3a29
parent 9344
ad057f2e3211
child 9703
2fdf635bcf28
child 9820
a67e9c6edcdd
     1.1 --- a/src/share/vm/services/heapDumper.cpp	Fri Jan 18 17:05:41 2019 +0100
     1.2 +++ b/src/share/vm/services/heapDumper.cpp	Thu Nov 05 11:42:42 2015 +0100
     1.3 @@ -941,8 +941,14 @@
     1.4  // its array classes
     1.5  void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
     1.6    Klass* klass = k;
     1.7 -  assert(klass->oop_is_instance(), "not an InstanceKlass");
     1.8 -  InstanceKlass* ik = (InstanceKlass*)klass;
     1.9 +  InstanceKlass* ik = InstanceKlass::cast(k);
    1.10 +
    1.11 +  // We can safepoint and do a heap dump at a point where we have a Klass,
    1.12 +  // but no java mirror class has been setup for it. So we need to check
    1.13 +  // that the class is at least loaded, to avoid crash from a null mirror.
    1.14 +  if (!ik->is_loaded()) {
    1.15 +    return;
    1.16 +  }
    1.17  
    1.18    writer->write_u1(HPROF_GC_CLASS_DUMP);
    1.19  

mercurial