From 7db9d1a67398842989693ce57a1d7eb7dd206fca Mon Sep 17 00:00:00 2001 From: Denghui Dong Date: Sat, 25 Jul 2020 11:09:37 +0800 Subject: [PATCH] [Backport] 8217362: Emergency dump does not work when disk=false is set Summary: Test Plan: jdk/jfr Reviewed-by: yuleil Issue: https://github.com/alibaba/dragonwell8/issues/112 --- test/jdk/jfr/jvm/TestDumpOnCrash.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/jdk/jfr/jvm/TestDumpOnCrash.java b/test/jdk/jfr/jvm/TestDumpOnCrash.java index 18ffd5454..a543e58b1 100644 --- a/test/jdk/jfr/jvm/TestDumpOnCrash.java +++ b/test/jdk/jfr/jvm/TestDumpOnCrash.java @@ -116,24 +116,27 @@ public class TestDumpOnCrash { } public static void main(String[] args) throws Exception { - verify(runProcess(CrasherIllegalAccess.class.getName(), "")); - verify(runProcess(CrasherHalt.class.getName(), "")); + verify(runProcess(CrasherIllegalAccess.class.getName(), "", true)); + verify(runProcess(CrasherIllegalAccess.class.getName(), "", false)); + verify(runProcess(CrasherHalt.class.getName(), "", true)); + verify(runProcess(CrasherHalt.class.getName(), "", false)); // Verification is excluded for the test case below until 8219680 is fixed - long pid = runProcess(CrasherSig.class.getName(), "FPE"); + long pid = runProcess(CrasherSig.class.getName(), "FPE", true); // @ignore 8219680 // verify(pid); } - private static long runProcess(String crasher, String signal) throws Exception { + private static long runProcess(String crasher, String signal, boolean disk) throws Exception { System.out.println("Test case for crasher " + crasher); + final String flightRecordingOptions = "dumponexit=true,disk=" + Boolean.toString(disk); Path pidPath = Paths.get("pid-" + System.currentTimeMillis()).toAbsolutePath(); Process p = ProcessTools.createJavaProcessBuilder(true, "-Xmx64m", "-XX:-TransmitErrorReport", "-XX:-CreateMinidumpOnCrash", /*"--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",*/ - "-XX:StartFlightRecording", + "-XX:StartFlightRecording=" + flightRecordingOptions, crasher, signal, pidPath.toString()) -- GitLab