From 5f06b60fa1d5a11450e994c5e7c7944ccf05b7b7 Mon Sep 17 00:00:00 2001 From: Bengt Rutisson Date: Thu, 23 Jul 2015 08:45:25 +0200 Subject: [PATCH] 8131600: heapdump/JMapHeap EXCEPTION_ACCESS_VIOLATION Reviewed-by: mgerdin, kbarrett, tschatzl --- hotspot/src/share/vm/prims/jvmtiTagMap.cpp | 2 +- hotspot/src/share/vm/services/heapDumper.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp index 3200d857ce4..3181fc5af38 100644 --- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp +++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp @@ -2824,7 +2824,7 @@ inline bool VM_HeapWalkOperation::iterate_over_class(oop java_class) { if (klass->oop_is_instance()) { InstanceKlass* ik = InstanceKlass::cast(klass); - // ignore the class if it's has been initialized yet + // Ignore the class if it hasn't been initialized yet if (!ik->is_linked()) { return true; } diff --git a/hotspot/src/share/vm/services/heapDumper.cpp b/hotspot/src/share/vm/services/heapDumper.cpp index c1e786b0931..81f49cde2ae 100644 --- a/hotspot/src/share/vm/services/heapDumper.cpp +++ b/hotspot/src/share/vm/services/heapDumper.cpp @@ -899,6 +899,11 @@ void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) { assert(klass->oop_is_instance(), "not an InstanceKlass"); InstanceKlass* ik = (InstanceKlass*)klass; + // Ignore the class if it hasn't been initialized yet + if (!ik->is_linked()) { + return; + } + writer->write_u1(HPROF_GC_CLASS_DUMP); // class ID