changeset 13326:217fae74e562

8144553: java/lang/StackWalker/StackWalkTest.java and MultiThreadStackWalk.java fail with stack overflows Reviewed-by: dfuchs
author mchung
date Thu, 17 Dec 2015 09:39:21 -0800
parents a204b8e18d46
children 59f1d54869b9
files test/java/lang/StackWalker/MultiThreadStackWalk.java test/java/lang/StackWalker/StackWalkTest.java
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/lang/StackWalker/MultiThreadStackWalk.java	Wed Dec 16 14:45:21 2015 -0800
+++ b/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/test/java/lang/StackWalker/StackWalkTest.java	Wed Dec 16 14:45:21 2015 -0800
+++ b/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);
         }
     }
 }