author | aeriksso |
Tue, 27 Oct 2015 10:35:14 +0100 | |
changeset 33371 | b6f6281b4c07 |
parent 24661 | 27e82ef5a006 |
child 39974 | f76ca6458acb |
permissions | -rw-r--r-- |
24661
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
1 |
#!/bin/sh |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
2 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
3 |
# |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
4 |
# @test testme.sh |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
5 |
# @summary Stack guard pages should be installed correctly and removed when thread is detached |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
6 |
# @run shell testme.sh |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
7 |
# |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
8 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
9 |
if [ "${TESTSRC}" = "" ] |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
10 |
then |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
11 |
TESTSRC=${PWD} |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
12 |
echo "TESTSRC not set. Using "${TESTSRC}" as default" |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
13 |
fi |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
14 |
echo "TESTSRC=${TESTSRC}" |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
15 |
## Adding common setup Variables for running shell tests. |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
16 |
. ${TESTSRC}/../../test_env.sh |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
17 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
18 |
if [ "${VM_OS}" != "linux" ] |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
19 |
then |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
20 |
echo "Test only valid for Linux" |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
21 |
exit 0 |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
22 |
fi |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
23 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
24 |
gcc_cmd=`which gcc` |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
25 |
if [ "x$gcc_cmd" = "x" ]; then |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
26 |
echo "WARNING: gcc not found. Cannot execute test." 2>&1 |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
27 |
exit 0; |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
28 |
fi |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
29 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
30 |
CFLAGS=-m${VM_BITS} |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
31 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
32 |
LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:${TESTJAVA}/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
33 |
export LD_LIBRARY_PATH |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
34 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
35 |
echo "Architecture: ${VM_CPU}" |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
36 |
echo "Compilation flag: ${CFLAGS}" |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
37 |
echo "VM type: ${VM_TYPE}" |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
38 |
echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}" |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
39 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
40 |
# Note pthread may not be found thus invoke creation will fail to be created. |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
41 |
# Check to ensure you have a /usr/lib/libpthread.so if you don't please look |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
42 |
# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation. |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
43 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
44 |
cp ${TESTSRC}/DoOverflow.java . |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
45 |
${COMPILEJAVA}/bin/javac DoOverflow.java |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
46 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
47 |
$gcc_cmd -DLINUX -g3 ${CFLAGS} -o invoke \ |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
48 |
-I${TESTJAVA}/include -I${TESTJAVA}/include/linux \ |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
49 |
-L${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \ |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
50 |
-L${TESTJAVA}/lib/${VM_CPU}/${VM_TYPE} \ |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
51 |
${TESTSRC}/invoke.c -ljvm -lpthread |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
52 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
53 |
if [ $? -ne 0 ] ; then |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
54 |
echo "Compile failed, Ignoring failed compilation and forcing the test to pass" |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
55 |
exit 0 |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
56 |
fi |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
57 |
|
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
58 |
./invoke test_java_overflow |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
59 |
./invoke test_native_overflow |
27e82ef5a006
8042155: [TESTBUG] Tests for stack guard pages have to be cleaned up
dsamersoff
parents:
diff
changeset
|
60 |
exit $? |