8144553: java/lang/StackWalker/StackWalkTest.java and MultiThreadStackWalk.java fail with stack overflows
authormchung
Thu, 17 Dec 2015 09:39:21 -0800
changeset 34710 906d9513cabc
parent 34709 931408264ee8
child 34711 65544417508e
8144553: java/lang/StackWalker/StackWalkTest.java and MultiThreadStackWalk.java fail with stack overflows Reviewed-by: dfuchs
jdk/test/java/lang/StackWalker/MultiThreadStackWalk.java
jdk/test/java/lang/StackWalker/StackWalkTest.java
--- a/jdk/test/java/lang/StackWalker/MultiThreadStackWalk.java	Wed Dec 16 14:45:21 2015 -0800
+++ b/jdk/test/java/lang/StackWalker/MultiThreadStackWalk.java	Thu Dec 17 09:39:21 2015 -0800
@@ -328,7 +328,7 @@
 
         public void run() {
             try {
-                Env env = runTest(test, 2000, 10);
+                Env env = runTest(test, 1000, 10);
                 //waitWalkers(env);
                 checkTest(env, test);
             } catch(Throwable t) {
--- a/jdk/test/java/lang/StackWalker/StackWalkTest.java	Wed Dec 16 14:45:21 2015 -0800
+++ b/jdk/test/java/lang/StackWalker/StackWalkTest.java	Thu Dec 17 09:39:21 2015 -0800
@@ -236,6 +236,8 @@
         if (didWalk) {
             throw new IllegalStateException("StackWalkTest already used");
         }
+        // Test may run into StackOverflow when running in -Xcomp mode on deep stack
+        assert stackDepth <= 1000;
         assert markAt <= stackDepth : "markAt(" + markAt + ") > stackDepth("
                 + stackDepth + ")";
         System.out.print("runTest(" + swOptions
@@ -297,15 +299,15 @@
             // Long stack, default maxDepth
             StackWalkTest swt;
             swt = new StackWalkTest();
-            swt.runTest(StackWalkTest.class, "main", 2000, 10);
+            swt.runTest(StackWalkTest.class, "main", 1000, 10);
 
             // Long stack, matching maxDepth
             swt = new StackWalkTest(2000);
-            swt.runTest(StackWalkTest.class, "main", 2000, 10);
+            swt.runTest(StackWalkTest.class, "main", 1000, 10);
 
             // Long stack, maximum maxDepth
             swt = new StackWalkTest(Integer.MAX_VALUE);
-            swt.runTest(StackWalkTest.class, "main", 2000, 10);
+            swt.runTest(StackWalkTest.class, "main", 1000, 10);
 
             //
             // Single batch
@@ -349,7 +351,7 @@
             swt.runTest(StackWalkTest.class, "main", 80, 40);
 
             swt = new StackWalkTest(EnumSet.of(RETAIN_CLASS_REFERENCE), 50);
-            swt.runTest(StackWalkTest.class, "main", 2000, 1048);
+            swt.runTest(StackWalkTest.class, "main", 1000, 524);
         }
     }
 }