author | ccheung |
Fri, 04 Oct 2013 21:00:43 -0700 | |
changeset 20384 | 49bfb2ec8f8f |
parent 16438 | 245d5c0a8dd8 |
permissions | -rw-r--r-- |
16438
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
1 |
/* |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
2 |
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
4 |
* |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
8 |
* |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
13 |
* accompanied this code). |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
14 |
* |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
18 |
* |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
21 |
* questions. |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
22 |
*/ |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
23 |
|
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
24 |
import java.io.File; |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
25 |
|
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
26 |
/* |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
27 |
* @test |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
28 |
* @key regression |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
29 |
* @bug 8010389 |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
30 |
* @run main/othervm -Djava.library.path=. VMThreadDlopen |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
31 |
*/ |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
32 |
|
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
33 |
public class VMThreadDlopen { |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
34 |
public static void main(String[] args) throws Exception { |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
35 |
File file = new File("libbroken.so"); |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
36 |
file.createNewFile(); |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
37 |
try { |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
38 |
System.loadLibrary("broken"); |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
39 |
} catch (UnsatisfiedLinkError e) { |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
40 |
e.printStackTrace(); |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
41 |
// expected |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
42 |
} |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
43 |
} |
245d5c0a8dd8
8010389: After fix for 7107135 a failed dlopen() call results in a VM crash
iklam
parents:
diff
changeset
|
44 |
} |