Mercurial > hg > truffle
annotate test/runtime/7107135/Test7107135.sh @ 8787:fa08949fe0cb
8009536: G1: Apache Lucene hang during reference processing
Summary: In CMTask::do_marking_step(), Skip offering termination and entering the first and second synchronization barriers if called from a serial context, i.e. the VM thread.
Reviewed-by: brutisso, tschatzl
author | johnc |
---|---|
date | Mon, 18 Mar 2013 11:05:27 -0700 |
parents | 9058789475af |
children | 04d6d4322c6a |
rev | line source |
---|---|
8710
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
1 #!/bin/sh |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
2 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
3 # |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
4 # Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
5 # Copyright (c) 2011 SAP AG. All Rights Reserved. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
6 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
7 # |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
8 # This code is free software; you can redistribute it and/or modify it |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
9 # under the terms of the GNU General Public License version 2 only, as |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
10 # published by the Free Software Foundation. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
11 # |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
12 # This code is distributed in the hope that it will be useful, but WITHOUT |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
15 # version 2 for more details (a copy is included in the LICENSE file that |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
16 # accompanied this code). |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
17 # |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
18 # You should have received a copy of the GNU General Public License version |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
19 # 2 along with this work; if not, write to the Free Software Foundation, |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
21 # |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
22 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
23 # or visit www.oracle.com if you need additional information or have any |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
24 # questions. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
25 # |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
26 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
27 ## |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
28 ## @test Test7107135.sh |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
29 ## @bug 7107135 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
30 ## @summary Stack guard pages lost after loading library with executable stack. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
31 ## @run shell Test7107135.sh |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
32 ## |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
33 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
34 if [ "${TESTSRC}" = "" ] |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
35 then TESTSRC=. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
36 fi |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
37 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
38 if [ "${TESTJAVA}" = "" ] |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
39 then |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
40 PARENT=`dirname \`which java\`` |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
41 TESTJAVA=`dirname ${PARENT}` |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
42 echo "TESTJAVA not set, selecting " ${TESTJAVA} |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
43 echo "If this is incorrect, try setting the variable manually." |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
44 fi |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
45 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
46 BIT_FLAG="" |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
47 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
48 # set platform-dependent variables |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
49 OS=`uname -s` |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
50 case "$OS" in |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
51 Linux) |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
52 NULL=/dev/null |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
53 PS=":" |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
54 FS="/" |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
55 ;; |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
56 *) |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
57 NULL=NUL |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
58 PS=";" |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
59 FS="\\" |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
60 echo "Test passed; only valid for Linux" |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
61 exit 0; |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
62 ;; |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
63 esac |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
64 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
65 ARCH=`uname -m` |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
66 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
67 THIS_DIR=`pwd` |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
68 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
69 cp ${TESTSRC}${FS}*.java ${THIS_DIR} |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
70 ${TESTJAVA}${FS}bin${FS}javac *.java |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
71 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
72 gcc -fPIC -shared -c -o test.o -I${TESTJAVA}${FS}include -I${TESTJAVA}${FS}include${FS}linux ${TESTSRC}${FS}test.c |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
73 ld -shared -z execstack -o libtest-rwx.so test.o |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
74 ld -shared -z noexecstack -o libtest-rw.so test.o |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
75 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
76 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
77 LD_LIBRARY_PATH=${THIS_DIR} |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
78 echo LD_LIBRARY_PATH = ${LD_LIBRARY_PATH} |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
79 export LD_LIBRARY_PATH |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
80 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
81 # This should not fail. |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
82 echo Check testprogram. Expected to pass: |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
83 echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
84 ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
85 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
86 echo |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
87 echo Test changing of stack protection: |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
88 echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
89 ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rwx |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
90 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
91 if [ "$?" == "0" ] |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
92 then |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
93 echo |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
94 echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} TestMT test-rwx |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
95 ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} TestMT test-rwx |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
96 fi |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
97 |
9058789475af
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
diff
changeset
|
98 exit $? |