author | lana |
Fri, 18 Jul 2014 08:25:26 -0700 | |
changeset 25597 | 6073de33135f |
parent 24661 | 27e82ef5a006 |
permissions | -rw-r--r-- |
24661
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
1 |
/* |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
2 |
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
4 |
* |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
8 |
* |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
13 |
* accompanied this code). |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
14 |
* |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
18 |
* |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
21 |
* questions. |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
22 |
*/ |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
23 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
24 |
public class DoOverflow { |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
25 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
26 |
static int count; |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
27 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
28 |
public void overflow() { |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
29 |
count+=1; |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
30 |
overflow(); |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
31 |
} |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
32 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
33 |
public static void printAlive() { |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
34 |
System.out.println("Java thread is alive."); |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
35 |
} |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
36 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
37 |
public static void printIt() { |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
38 |
System.out.println("Going to overflow stack"); |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
39 |
try { |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
40 |
new DoOverflow().overflow(); |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
41 |
} catch(java.lang.StackOverflowError e) { |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
42 |
System.out.println("Test PASSED. Got StackOverflowError at " + count + " iteration"); |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
43 |
} |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
44 |
} |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
45 |
} |