diff --git a/test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java b/test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java index 1a9a283f740d8..337071269354f 100644 --- a/test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java +++ b/test/hotspot/jtreg/runtime/posixSig/TestPosixSig.java @@ -44,8 +44,17 @@ public static void main(String[] args) throws Throwable { if (args.length == 0) { // Create a new java process for the TestPsig Java/JNI test. + // We run the VM in interpreted mode, because the JIT might mark + // a Java method as not-entrant, which means turning the first instruction + // into an illegal one. Calling such a method after establishing + // the new SIGILL signal handler with TestPosixSig.changeSigActionFor(4) + // below, but before the JNI checker noted and reacted on this signal handler + // modification, the JVM may crash or hang in an endless loop, where the + // illegal instruction will be continously executed, raising SIGILL, and + // the signal handler will return to the illegal instruction again... ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder( "-XX:+CheckJNICalls", + "-Xint", "-Djava.library.path=" + libpath + ":.", "TestPosixSig", "dummy");