8210861: Move assert to help diagnose rare RedefineStress crash
authorcoleenp
Tue, 18 Sep 2018 16:11:36 -0400
changeset 51793 6cd1ee2b4fa1
parent 51792 d0dfb9775c08
child 51794 4129f43607cb
8210861: Move assert to help diagnose rare RedefineStress crash Summary: assert that Method being marked on stack hasn't been missed by previous metadata walk Reviewed-by: lfoltan
src/hotspot/share/oops/method.cpp
test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java
--- a/src/hotspot/share/oops/method.cpp	Tue Sep 18 22:32:25 2018 +0200
+++ b/src/hotspot/share/oops/method.cpp	Tue Sep 18 16:11:36 2018 -0400
@@ -2152,6 +2152,8 @@
   if (value && !already_set) {
     MetadataOnStackMark::record(this);
   }
+  assert(!value || !is_old() || is_obsolete() || is_running_emcp(),
+         "emcp methods cannot run after emcp bit is cleared");
 }
 
 // Called when the class loader is unloaded to make all methods weak.
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java	Tue Sep 18 22:32:25 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java	Tue Sep 18 16:11:36 2018 -0400
@@ -32,6 +32,7 @@
  *          /test/lib
  * @run driver jdk.test.lib.FileInstaller . .
  * @run main/othervm/native
+ *      -Xlog:redefine+class+iklass+purge=trace,redefine+class+iklass+add=trace
  *      -agentlib:stressRedefine
  *      nsk.jvmti.RedefineClasses.StressRedefine
  *      ./bin