author | tschatzl |
Wed, 19 Aug 2015 13:47:40 +0200 | |
changeset 32377 | 5ee15c417d02 |
parent 30604 | b8d532cb6420 |
child 36851 | 03e2f4d0a421 |
permissions | -rw-r--r-- |
19970
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
1 |
/* |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
19970
diff
changeset
|
2 |
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. |
19970
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
4 |
* |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
7 |
* published by the Free Software Foundation. |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
8 |
* |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
13 |
* accompanied this code). |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
14 |
* |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
18 |
* |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
21 |
* questions. |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
22 |
*/ |
16428
1b55a8d558b8
7030610: runtime/6878713/Test6878713.sh fails Error. failed to clean up files after test
rdurbin
parents:
13523
diff
changeset
|
23 |
|
8481
42a79b703814
6878713: Verifier heap corruption, relating to backward jsrs
kamg
parents:
diff
changeset
|
24 |
|
42a79b703814
6878713: Verifier heap corruption, relating to backward jsrs
kamg
parents:
diff
changeset
|
25 |
|
19970
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
26 |
/* |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
27 |
* @test OomWhileParsingRepeatedJsr |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
28 |
* @summary Testing class file parser; specifically parsing |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
29 |
* a file with repeated JSR (jump local subroutine) |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
30 |
* bytecode command. |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
31 |
* @bug 6878713 |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
32 |
* @bug 7030610 |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
33 |
* @bug 7037122 |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
34 |
* @bug 7123945 |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
35 |
* @bug 8016029 |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
36 |
* @library /testlibrary |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
19970
diff
changeset
|
37 |
* @modules java.base/sun.misc |
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
19970
diff
changeset
|
38 |
* java.desktop |
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
19970
diff
changeset
|
39 |
* java.management |
19970
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
40 |
* @run main OomWhileParsingRepeatedJsr |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
41 |
*/ |
16428
1b55a8d558b8
7030610: runtime/6878713/Test6878713.sh fails Error. failed to clean up files after test
rdurbin
parents:
13523
diff
changeset
|
42 |
|
30604
b8d532cb6420
8067013: Rename the com.oracle.java.testlibary package
ykantser
parents:
29678
diff
changeset
|
43 |
import jdk.test.lib.*; |
19970
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
44 |
|
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
45 |
|
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
46 |
public class OomWhileParsingRepeatedJsr { |
16428
1b55a8d558b8
7030610: runtime/6878713/Test6878713.sh fails Error. failed to clean up files after test
rdurbin
parents:
13523
diff
changeset
|
47 |
|
19970
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
48 |
public static void main(String[] args) throws Exception { |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
49 |
|
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
50 |
// ======= Configure the test |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
51 |
String jarFile = System.getProperty("test.src") + "/testcase.jar"; |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
52 |
String className = "OOMCrashClass1960_2"; |
8481
42a79b703814
6878713: Verifier heap corruption, relating to backward jsrs
kamg
parents:
diff
changeset
|
53 |
|
19970
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
54 |
// limit is 768MB in native words |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
55 |
int mallocMaxTestWords = (1024 * 1024 * 768 / 4); |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
56 |
if (Platform.is64bit()) |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
57 |
mallocMaxTestWords = (mallocMaxTestWords / 2); |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
58 |
|
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
59 |
// ======= extract the test class |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
60 |
ProcessBuilder pb = new ProcessBuilder(new String[] { |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
61 |
JDKToolFinder.getJDKTool("jar"), |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
62 |
"xvf", jarFile } ); |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
63 |
OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
64 |
output.shouldHaveExitValue(0); |
16428
1b55a8d558b8
7030610: runtime/6878713/Test6878713.sh fails Error. failed to clean up files after test
rdurbin
parents:
13523
diff
changeset
|
65 |
|
19970
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
66 |
// ======= execute the test |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
67 |
pb = ProcessTools.createJavaProcessBuilder( |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
68 |
"-cp", ".", |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
69 |
"-XX:+UnlockDiagnosticVMOptions", |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
70 |
"-XX:MallocMaxTestWords=" + mallocMaxTestWords, |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
71 |
className ); |
16428
1b55a8d558b8
7030610: runtime/6878713/Test6878713.sh fails Error. failed to clean up files after test
rdurbin
parents:
13523
diff
changeset
|
72 |
|
19970
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
73 |
output = new OutputAnalyzer(pb.start()); |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
74 |
output.shouldContain("Cannot reserve enough memory"); |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
75 |
} |
0acec4a1f32e
8016029: test runtime/6878713/Test6878713.sh failed
mseledtsov
parents:
16458
diff
changeset
|
76 |
} |
16428
1b55a8d558b8
7030610: runtime/6878713/Test6878713.sh fails Error. failed to clean up files after test
rdurbin
parents:
13523
diff
changeset
|
77 |