comparison test/runtime/7158988/TestFieldMonitor.sh @ 5995:19e197e2a1af

7158988: jvm crashes while debugging on x86_32 and x86_64 Summary: Object pointer is pushed more than once on stack, where GC doesn't expect it. Reviewed-by: coleenp, kvn Contributed-by: axel.siebenborn@sap.com
author coleenp
date Thu, 05 Apr 2012 12:17:52 -0400
parents
children 037973617842
comparison
equal deleted inserted replaced
5983:749b1464aa81 5995:19e197e2a1af
1 #!/bin/sh
2
3 if [ "${TESTSRC}" = "" ]
4 then TESTSRC=.
5 fi
6
7 if [ "${TESTJAVA}" = "" ]
8 then
9 PARENT=`dirname \`which java\``
10 TESTJAVA=`dirname ${PARENT}`
11 echo "TESTJAVA not set, selecting " ${TESTJAVA}
12 echo "If this is incorrect, try setting the variable manually."
13 fi
14
15 if [ "${TESTCLASSES}" = "" ]
16 then
17 echo "TESTCLASSES not set. Test cannot execute. Failed."
18 exit 1
19 fi
20
21 BIT_FLAG=""
22
23 # set platform-dependent variables
24 OS=`uname -s`
25 case "$OS" in
26 SunOS | Linux )
27 NULL=/dev/null
28 PS=":"
29 FS="/"
30 ## for solaris, linux it's HOME
31 FILE_LOCATION=$HOME
32 if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" -a `uname -p`='sparc' ]
33 then
34 BIT_FLAG="-d64"
35 fi
36 ;;
37 Windows_95 | Windows_98 | Windows_ME )
38 NULL=NUL
39 PS=";"
40 FS="\\"
41 echo "Test skipped, only for WinNT"
42 exit 0
43 ;;
44 Windows_NT )
45 NULL=NUL
46 PS=";"
47 FS="\\"
48 ;;
49 * )
50 echo "Unrecognized system!"
51 exit 1;
52 ;;
53 esac
54
55 #CLASSPATH=.${PS}${TESTCLASSES} ; export CLASSPATH
56
57 cp ${TESTSRC}${FS}*.java .
58
59 ${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -fullversion
60
61 ${TESTJAVA}${FS}bin${FS}javac -classpath .${PS}$TESTJAVA${FS}lib${FS}tools.jar *.java
62
63 ${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -classpath .${PS}$TESTJAVA${FS}lib${FS}tools.jar FieldMonitor > test.out 2>&1 &
64
65 P_PID=$!
66
67 sleep 60
68 STATUS=0
69
70 case "$OS" in
71 SunOS | Linux )
72 ps -ef | grep $P_PID | grep -v grep > ${NULL}
73 if [ $? = 0 ]; then
74 kill -9 $P_PID
75 STATUS=1
76 fi
77 ;;
78 * )
79 ps | grep -i "FieldMonitor" | grep -v grep > ${NULL}
80 if [ $? = 0 ]; then
81 C_PID=`ps | grep -i "FieldMonitor" | awk '{print $1}'`
82 kill -s 9 $C_PID
83 STATUS=1
84 fi
85 ;;
86 esac
87
88 grep "A fatal error has been detected" test.out > ${NULL}
89 if [ $? = 0 ]; then
90 cat test.out
91 STATUS=1
92 fi
93
94 exit $STATUS