8156137: SIGSEGV in ReceiverTypeData::clean_weak_klass_links
authordlong
Wed, 31 Aug 2016 12:10:40 -0700
changeset 41060 c72f3248ea0c
parent 41059 6f019652dd5e
child 41061 7eecf643e9f3
8156137: SIGSEGV in ReceiverTypeData::clean_weak_klass_links Summary: process previous versions in Klass::clean_weak_klass_links() Reviewed-by: coleenp, sspitsyn, stefank, dcubed
hotspot/src/share/vm/oops/klass.cpp
--- a/hotspot/src/share/vm/oops/klass.cpp	Wed Aug 31 14:47:20 2016 +0300
+++ b/hotspot/src/share/vm/oops/klass.cpp	Wed Aug 31 12:10:40 2016 -0700
@@ -431,6 +431,12 @@
     if (clean_alive_klasses && current->is_instance_klass()) {
       InstanceKlass* ik = InstanceKlass::cast(current);
       ik->clean_weak_instanceklass_links(is_alive);
+
+      // JVMTI RedefineClasses creates previous versions that are not in
+      // the class hierarchy, so process them here.
+      while ((ik = ik->previous_versions()) != NULL) {
+        ik->clean_weak_instanceklass_links(is_alive);
+      }
     }
   }
 }