提交 7db9d1a6 编写于 作者: D Denghui Dong 提交者: D-D-H

[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
上级 22a02da0
...@@ -116,24 +116,27 @@ public class TestDumpOnCrash { ...@@ -116,24 +116,27 @@ public class TestDumpOnCrash {
} }
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
verify(runProcess(CrasherIllegalAccess.class.getName(), "")); verify(runProcess(CrasherIllegalAccess.class.getName(), "", true));
verify(runProcess(CrasherHalt.class.getName(), "")); 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 // 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 // @ignore 8219680
// verify(pid); // 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); 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(); Path pidPath = Paths.get("pid-" + System.currentTimeMillis()).toAbsolutePath();
Process p = ProcessTools.createJavaProcessBuilder(true, Process p = ProcessTools.createJavaProcessBuilder(true,
"-Xmx64m", "-Xmx64m",
"-XX:-TransmitErrorReport", "-XX:-TransmitErrorReport",
"-XX:-CreateMinidumpOnCrash", "-XX:-CreateMinidumpOnCrash",
/*"--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",*/ /*"--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",*/
"-XX:StartFlightRecording", "-XX:StartFlightRecording=" + flightRecordingOptions,
crasher, crasher,
signal, signal,
pidPath.toString()) pidPath.toString())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册