Mercurial > hg > graal-compiler
annotate test/runtime/XCheckJniJsig/XCheckJSig.java @ 14474:de7f1b016d55
7014526: "java -version" crash on sparc with some values of HeapBaseMinAddress
Summary: Make default HeapBaseMinAddress the minimum that can be specified.
Reviewed-by: minqi, kvn, tschatzl, dholmes
author | coleenp |
---|---|
date | Wed, 19 Feb 2014 02:58:13 +0000 |
parents | a9683a647c9f |
children | 4ca6dc0799b6 |
rev | line source |
---|---|
12096
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
1 /* |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
4 * |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
8 * |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
13 * accompanied this code). |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
14 * |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
18 * |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
21 * questions. |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
22 */ |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
23 |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
24 /* |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
25 * @test |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
26 * @bug 7051189 8023393 |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
27 * @summary Need to suppress info message if -Xcheck:jni is used with libjsig.so |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
28 * @library /testlibrary |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
29 * @run main XCheckJSig |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
30 */ |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
31 |
14185
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
32 import java.io.File; |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
33 import java.util.Map; |
12096
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
34 import com.oracle.java.testlibrary.*; |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
35 |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
36 public class XCheckJSig { |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
37 public static void main(String args[]) throws Throwable { |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
38 |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
39 System.out.println("Regression test for bugs 7051189 and 8023393"); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
40 if (!Platform.isSolaris() && !Platform.isLinux() && !Platform.isOSX()) { |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
41 System.out.println("Test only applicable on Solaris, Linux, and Mac OSX, skipping"); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
42 return; |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
43 } |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
44 |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
45 String jdk_path = System.getProperty("test.jdk"); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
46 String os_arch = Platform.getOsArch(); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
47 String libjsig; |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
48 String env_var; |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
49 if (Platform.isOSX()) { |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
50 env_var = "DYLD_INSERT_LIBRARIES"; |
14185
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
51 libjsig = jdk_path + "/jre/lib/libjsig.dylib"; // jdk location |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
52 if (!(new File(libjsig).exists())) { |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
53 libjsig = jdk_path + "/lib/libjsig.dylib"; // jre location |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
54 } |
12096
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
55 } else { |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
56 env_var = "LD_PRELOAD"; |
14185
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
57 libjsig = jdk_path + "/jre/lib/" + os_arch + "/libjsig.so"; // jdk location |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
58 if (!(new File(libjsig).exists())) { |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
59 libjsig = jdk_path + "/lib/" + os_arch + "/libjsig.so"; // jre location |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
60 } |
12096
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
61 } |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
62 // If this test fails, these might be useful to know. |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
63 System.out.println("libjsig: " + libjsig); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
64 System.out.println("osArch: " + os_arch); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
65 |
14185
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
66 // Make sure the libjsig file exists. |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
67 if (!(new File(libjsig).exists())) { |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
68 System.out.println("File " + libjsig + " not found, skipping"); |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
69 return; |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
70 } |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
71 |
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
72 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xcheck:jni", "-version"); |
12096
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
73 Map<String, String> env = pb.environment(); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
74 env.put(env_var, libjsig); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
75 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
76 output.shouldNotContain("libjsig is activated"); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
77 output.shouldHaveExitValue(0); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
78 |
14185
a9683a647c9f
8023735: [TESTBUG] runtime/XCheckJniJsig/XCheckJSig.java fails on MacOS X
hseigel
parents:
13402
diff
changeset
|
79 pb = ProcessTools.createJavaProcessBuilder("-Xcheck:jni", "-verbose:jni", "-version"); |
12096
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
80 env = pb.environment(); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
81 env.put(env_var, libjsig); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
82 output = new OutputAnalyzer(pb.start()); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
83 output.shouldContain("libjsig is activated"); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
84 output.shouldHaveExitValue(0); |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
85 } |
3a57fa7a4cd0
7121403: [TESTBUG] runtime/7051189/Xchecksig.sh fails on 64bit solaris
hseigel
parents:
diff
changeset
|
86 } |