Skip to content

Commit

Permalink
[Backport] 8217362: Emergency dump does not work when disk=false is set
Browse files Browse the repository at this point in the history
Summary:

Test Plan: jdk/jfr

Reviewed-by: yuleil

Issue: dragonwell-project/dragonwell8#112
  • Loading branch information
D-D-H committed Jul 31, 2020
1 parent 22a02da commit 7db9d1a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/jdk/jfr/jvm/TestDumpOnCrash.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,27 @@ public static void main(String[] args) throws Exception {
}

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())
Expand Down

0 comments on commit 7db9d1a

Please sign in to comment.