8179244: Assert failed in instanceMirrorKlass.inline.hpp
authortschatzl
Thu, 23 Nov 2017 15:51:06 +0100
changeset 48101 02f9be87cf5c
parent 48100 ab188c22d4b6
child 48102 08be4c1e540e
8179244: Assert failed in instanceMirrorKlass.inline.hpp Summary: Investigate the failure and upon observing that the assert is too strict, disable it and addd a comment. Reviewed-by: ehelin
src/hotspot/share/oops/instanceMirrorKlass.inline.hpp
--- a/src/hotspot/share/oops/instanceMirrorKlass.inline.hpp	Thu Nov 23 09:53:53 2017 +0100
+++ b/src/hotspot/share/oops/instanceMirrorKlass.inline.hpp	Thu Nov 23 15:51:06 2017 +0100
@@ -71,10 +71,15 @@
         Devirtualizer<nv>::do_klass(closure, klass);
       }
     } else {
-      // If klass is NULL then this a mirror for a primitive type.
-      // We don't have to follow them, since they are handled as strong
-      // roots in Universe::oops_do.
-      assert(java_lang_Class::is_primitive(obj), "Sanity check");
+      // We would like to assert here (as below) that if klass has been NULL, then
+      // this has been a mirror for a primitive type that we do not need to follow
+      // as they are always strong roots.
+      // However, we might get across a klass that just changed during CMS concurrent
+      // marking if allocation occurred in the old generation.
+      // This is benign here, as we keep alive all CLDs that were loaded during the
+      // CMS concurrent phase in the class loading, i.e. they will be iterated over
+      // and kept alive during remark.
+      // assert(java_lang_Class::is_primitive(obj), "Sanity check");
     }
   }