From a3931a76f668d5891ac541be9ea5ac33e67f85c1 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Tue, 18 Sep 2018 16:11:36 -0400 Subject: [PATCH] 8210861: Move assert to help diagnose rare RedefineStress crash Assert that Method being marked on stack hasn't been missed by previous metadata walk Reviewed-by: lfoltan --- src/hotspot/share/oops/method.cpp | 2 ++ .../TestDescription.java | 1 + 2 files changed, 3 insertions(+) diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp index 87932c527cf..b5c1a8edeea 100644 --- a/src/hotspot/share/oops/method.cpp +++ b/src/hotspot/share/oops/method.cpp @@ -2152,6 +2152,8 @@ void Method::set_on_stack(const bool value) { 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. diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java index aaf1eb9db33..ab72c59a05b 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java @@ -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