Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8306583

Add JVM crash check in CDSTestUtils.executeAndLog

XMLWordPrintable

    • b22

        JDK-8306476 caused ArchiveHeapTestClass.java to reliably crash when running "java -Xshare:dump" for the following test case

        https://github.com/openjdk/jdk/blob/20b1d19d26a039b963590ca6f806f78a4a94c25f/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchiveHeapTestClass.java#L160
        mustFail(output, "Class pkg.ClassInPackage not allowed in archive heap");

        However, the test case only checks for a non-zero exit code and the require error message. It missed the fact that the JVM has crashed. As a result, JDK-8306476 was discovered only intermittently when the test itself timed out.

        It will be cumbersome to test for JVM crashing in every test case. Since most of CDS tests launch subprocesses using CDSTestUtils.executeAndLog, we can add the following check there:

        if (output.getStdout().contains("https://bugreport.java.com/bugreport/crash.jsp")) {
            throw new RuntimeException("Hotspot crashed");
        }



              matsaave Matias Saavedra Silva
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: