Mercurial > hg > truffle
annotate test/runtime/InitialThreadOverflow/testme.sh @ 12690:c3bdd186e6cf
fix possible NPE in TruffleCompiler with TraceTruffleCompilation and background compilation enabled.
With background compilation, the installed code can already be invalidated when compiledMethod.getCode() is called, in which case it returns null.
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Wed, 06 Nov 2013 13:31:28 +0100 |
parents | 0f648fbe4404 |
children | e567d5afd4dd |
rev | line source |
---|---|
12144
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
1 #!/bin/sh |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
2 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
3 # Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
5 # |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
6 # This code is free software; you can redistribute it and/or modify it |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
7 # under the terms of the GNU General Public License version 2 only, as |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
8 # published by the Free Software Foundation. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
9 # |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
10 # This code is distributed in the hope that it will be useful, but WITHOUT |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
13 # version 2 for more details (a copy is included in the LICENSE file that |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
14 # accompanied this code). |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
15 # |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
16 # You should have received a copy of the GNU General Public License version |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
17 # 2 along with this work; if not, write to the Free Software Foundation, |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
19 # |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
21 # or visit www.oracle.com if you need additional information or have any |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
22 # questions. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
23 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
24 # @test testme.sh |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
25 # @bug 8009062 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
26 # @summary Poor performance of JNI AttachCurrentThread after fix for 7017193 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
27 # @compile DoOverflow.java |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
28 # @run shell testme.sh |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
29 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
30 set -x |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
31 if [ "${TESTSRC}" = "" ] |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
32 then |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
33 TESTSRC=${PWD} |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
34 echo "TESTSRC not set. Using "${TESTSRC}" as default" |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
35 fi |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
36 echo "TESTSRC=${TESTSRC}" |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
37 ## Adding common setup Variables for running shell tests. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
38 . ${TESTSRC}/../../test_env.sh |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
39 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
40 if [ "${VM_OS}" != "linux" ] |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
41 then |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
42 echo "Test only valid for Linux" |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
43 exit 0 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
44 fi |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
45 |
12202
0f648fbe4404
8024056: runtime/InitialThreadOverflow/testme.sh fails
dsamersoff
parents:
12144
diff
changeset
|
46 gcc_cmd=`which g++` |
0f648fbe4404
8024056: runtime/InitialThreadOverflow/testme.sh fails
dsamersoff
parents:
12144
diff
changeset
|
47 if [ "x$gcc_cmd" = "x" ]; then |
0f648fbe4404
8024056: runtime/InitialThreadOverflow/testme.sh fails
dsamersoff
parents:
12144
diff
changeset
|
48 echo "WARNING: g++ not found. Cannot execute test." 2>&1 |
12144
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
49 exit 0; |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
50 fi |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
51 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
52 CFLAGS="-m${VM_BITS}" |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
53 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
54 LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
55 export LD_LIBRARY_PATH |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
56 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
57 cp ${TESTSRC}${FS}invoke.cxx . |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
58 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
59 # Copy the result of our @compile action: |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
60 cp ${TESTCLASSES}${FS}DoOverflow.class . |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
61 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
62 echo "Compilation flag: ${COMP_FLAG}" |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
63 # Note pthread may not be found thus invoke creation will fail to be created. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
64 # Check to ensure you have a /usr/lib/libpthread.so if you don't please look |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
65 # for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation. |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
66 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
67 $gcc_cmd -DLINUX ${CFLAGS} -o invoke \ |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
68 -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \ |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
69 -L${COMPILEJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \ |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
70 -ljvm -lpthread invoke.cxx |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
71 |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
72 ./invoke |
d8e99408faad
8009062: poor performance of JNI AttachCurrentThread after fix for 7017193
dsamersoff
parents:
diff
changeset
|
73 exit $? |