< prev index next >

test/runtime/ErrorHandling/ProblematicFrameTest.java

Print this page




  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8050167
  27  * @summary Test that error is not occurred during printing problematic frame
  28  * @library /test/lib
  29  * @modules java.base/jdk.internal.misc
  30  *          java.compiler
  31  *          java.management
  32  *          jdk.jvmstat/sun.jvmstat.monitor
  33  * @run driver ProblematicFrameTest
  34  */
  35 
  36 import jdk.test.lib.process.ProcessTools;
  37 import jdk.test.lib.process.OutputAnalyzer;
  38 import jdk.test.lib.unsafe.UnsafeHelper;
  39 
  40 import jdk.internal.misc.Unsafe;
  41 
  42 public class ProblematicFrameTest {
  43     private static class Crasher {
  44         public static void main(String[] args) {
  45             UnsafeHelper.getUnsafe().getInt(0);
  46         }
  47     }
  48 
  49     public static void main(String[] args) throws Exception {
  50         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  51             "-Xmx64m", "-XX:-TransmitErrorReport", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:-CreateCoredumpOnCrash", Crasher.class.getName());
  52         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  53         output.shouldNotContain("Exception in thread");
  54         output.shouldNotMatch("error occurred during error reporting \\(printing problematic frame\\)");
  55     }
  56 }


  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8050167
  27  * @summary Test that error is not occurred during printing problematic frame
  28  * @library /test/lib
  29  * @modules java.base/jdk.internal.misc
  30  *          java.compiler
  31  *          java.management
  32  *          jdk.jvmstat/sun.jvmstat.monitor
  33  * @run driver ProblematicFrameTest
  34  */
  35 
  36 import jdk.test.lib.process.ProcessTools;
  37 import jdk.test.lib.process.OutputAnalyzer;

  38 
  39 import jdk.internal.misc.Unsafe;
  40 
  41 public class ProblematicFrameTest {
  42     private static class Crasher {
  43         public static void main(String[] args) {
  44             Unsafe.getUnsafe().getInt(0);
  45         }
  46     }
  47 
  48     public static void main(String[] args) throws Exception {
  49         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  50             "-Xmx64m", "-XX:-TransmitErrorReport", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:-CreateCoredumpOnCrash", Crasher.class.getName());
  51         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  52         output.shouldNotContain("Exception in thread");
  53         output.shouldNotMatch("error occurred during error reporting \\(printing problematic frame\\)");
  54     }
  55 }
< prev index next >