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
--- 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