8329533: TestCDSVMCrash fails on libgraal

Reviewed-by: iklam, ccheung
This commit is contained in:
Matias Saavedra Silva 2024-04-08 14:06:43 +00:00
parent 3ebf8c9359
commit 6439375bb9

@ -25,6 +25,7 @@
* @test TestCDSVMCrash
* @summary Verify that an exception is thrown when the VM crashes during executeAndLog
* @requires vm.cds
* @requires vm.flagless
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @run driver TestCDSVMCrash
@ -37,19 +38,21 @@ import jdk.test.lib.process.ProcessTools;
public class TestCDSVMCrash {
static Object[] oa;
public static void main(String[] args) throws Exception {
if (args.length == 1) {
// This should guarantee to throw:
// java.lang.OutOfMemoryError: Requested array size exceeds VM limit
try {
Object[] oa = new Object[Integer.MAX_VALUE];
oa = new Object[Integer.MAX_VALUE];
throw new Error("OOME not triggered");
} catch (OutOfMemoryError err) {
throw new Error("OOME didn't abort JVM!");
}
}
// else this is the main test
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder("-XX:+CrashOnOutOfMemoryError",
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+CrashOnOutOfMemoryError",
"-XX:-CreateCoredumpOnCrash", "-Xmx128m",
"-Xshare:on", TestCDSVMCrash.class.getName(),
"throwOOME");