8278415: [TESTBUG] vmTestbase/nsk/stress/stack/stack018.java fails with "java.lang.Error: TEST_RFE"
Reviewed-by: phh
This commit is contained in:
parent
4f594e6a28
commit
afd065b368
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -36,7 +36,7 @@
|
||||
* invocations until stack overflow, and then tries to reproduce similar
|
||||
* stack overflows 10 times in each of 10 threads -- each time by trying
|
||||
* to invoke the same recursive method for the given fixed depth
|
||||
* of invocations (which is 10 times that crucial depth just measured).
|
||||
* of invocations (which is 100 times that crucial depth just measured).
|
||||
* The test is deemed passed, if VM have not crashed, and
|
||||
* if exception other than due to stack overflow was not
|
||||
* thrown.
|
||||
@ -103,7 +103,7 @@ public class stack018 extends Thread {
|
||||
// Measure maximal recursion depth until stack overflow:
|
||||
//
|
||||
int maxDepth = 0;
|
||||
for (depthToTry = 0; ; depthToTry += STEP)
|
||||
for (depthToTry = 0; ; depthToTry += STEP) {
|
||||
try {
|
||||
invokeRecurse(depthToTry);
|
||||
maxDepth = depthToTry;
|
||||
@ -117,6 +117,12 @@ public class stack018 extends Thread {
|
||||
throw (ThreadDeath) target;
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (maxDepth == 0) {
|
||||
// The depth STEP was enough to cause StackOverflowError or OutOfMemoryError.
|
||||
maxDepth = STEP;
|
||||
}
|
||||
out.println("Maximal recursion depth: " + maxDepth);
|
||||
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user