test/runtime/6888954/vmerrors.sh

Mon, 28 Jul 2014 15:06:38 -0700

author
fzhinkin
date
Mon, 28 Jul 2014 15:06:38 -0700
changeset 6997
dbb05f6d93c4
parent 5847
cc4f5f8d885e
child 6876
710a3c8b516e
child 7574
a51071796915
permissions
-rw-r--r--

8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
Summary: call rtm_deopt() only if there were no compilation bailouts before.
Reviewed-by: kvn

mseledtsov@5847 1 # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
mseledtsov@5847 2 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mseledtsov@5847 3 #
mseledtsov@5847 4 # This code is free software; you can redistribute it and/or modify it
mseledtsov@5847 5 # under the terms of the GNU General Public License version 2 only, as
mseledtsov@5847 6 # published by the Free Software Foundation.
mseledtsov@5847 7 #
mseledtsov@5847 8 # This code is distributed in the hope that it will be useful, but WITHOUT
mseledtsov@5847 9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mseledtsov@5847 10 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mseledtsov@5847 11 # version 2 for more details (a copy is included in the LICENSE file that
mseledtsov@5847 12 # accompanied this code).
mseledtsov@5847 13 #
mseledtsov@5847 14 # You should have received a copy of the GNU General Public License version
mseledtsov@5847 15 # 2 along with this work; if not, write to the Free Software Foundation,
mseledtsov@5847 16 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mseledtsov@5847 17 #
mseledtsov@5847 18 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
mseledtsov@5847 19 # or visit www.oracle.com if you need additional information or have any
mseledtsov@5847 20 # questions.
mseledtsov@5847 21 #
mseledtsov@5847 22
jcoomes@1845 23 # @test
jcoomes@1845 24 # @bug 6888954
dcubed@5365 25 # @bug 8015884
jcoomes@1845 26 # @summary exercise HotSpot error handling code
jcoomes@1845 27 # @author John Coomes
jcoomes@1845 28 # @run shell vmerrors.sh
jcoomes@1845 29
jcoomes@1845 30 # Repeatedly invoke java with a command-line option that causes HotSpot to
jcoomes@1845 31 # produce an error report and terminate just after initialization. Each
jcoomes@1845 32 # invocation is identified by a small integer, <n>, which provokes a different
jcoomes@1845 33 # error (assertion failure, guarantee failure, fatal error, etc.). The output
jcoomes@1845 34 # from stdout/stderr is written to <n>.out and the hs_err_pidXXX.log file is
jcoomes@1845 35 # renamed to <n>.log.
jcoomes@1845 36 #
jcoomes@1845 37 # The automated checking done by this script is minimal. When updating the
jcoomes@1845 38 # fatal error handler it is more useful to run it manually or to use the -retain
jcoomes@1845 39 # option with the jtreg so that test directories are not removed automatically.
jcoomes@1845 40 # To run stand-alone:
jcoomes@1845 41 #
jcoomes@1845 42 # TESTJAVA=/java/home/dir
jcoomes@1845 43 # TESTVMOPTS=...
jcoomes@1845 44 # export TESTJAVA TESTVMOPTS
jcoomes@1845 45 # sh test/runtime/6888954/vmerrors.sh
jcoomes@1845 46
jcoomes@1845 47 ulimit -c 0 # no core files
jcoomes@1845 48
jcoomes@1845 49 i=1
jcoomes@1845 50 rc=0
jcoomes@1845 51
jcoomes@1845 52 assert_re='(assert|guarantee)[(](str|num).*failed: *'
dcubed@5365 53 # for bad_data_ptr_re:
dcubed@5365 54 # EXCEPTION_ACCESS_VIOLATION - Win-*
dcubed@5365 55 # SIGILL - MacOS X
dcubed@5365 56 # SIGSEGV - Linux-*, Solaris SPARC-*, Solaris X86-*
dcubed@5365 57 #
dcubed@5365 58 bad_data_ptr_re='(SIGILL|SIGSEGV|EXCEPTION_ACCESS_VIOLATION).* at pc='
dcubed@5365 59 #
dcubed@5365 60 # for bad_func_ptr_re:
dcubed@5365 61 # EXCEPTION_ACCESS_VIOLATION - Win-*
dcubed@5365 62 # SIGBUS - Solaris SPARC-64
dcubed@5365 63 # SIGSEGV - Linux-*, Solaris SPARC-32, Solaris X86-*
dcubed@5365 64 #
dcubed@5365 65 # Note: would like to use "pc=0x00*0f," in the pattern, but Solaris SPARC-*
dcubed@5365 66 # gets its signal at a PC in test_error_handler().
dcubed@5365 67 #
dcubed@5365 68 bad_func_ptr_re='(SIGBUS|SIGSEGV|EXCEPTION_ACCESS_VIOLATION).* at pc='
jcoomes@1845 69 guarantee_re='guarantee[(](str|num).*failed: *'
jcoomes@1845 70 fatal_re='fatal error: *'
jcoomes@1845 71 tail_1='.*expected null'
jcoomes@1845 72 tail_2='.*num='
jcoomes@1845 73
jcoomes@1845 74 for re in \
jcoomes@1845 75 "${assert_re}${tail_1}" "${assert_re}${tail_2}" \
jcoomes@1845 76 "${guarantee_re}${tail_1}" "${guarantee_re}${tail_2}" \
jcoomes@1845 77 "${fatal_re}${tail_1}" "${fatal_re}${tail_2}" \
jcoomes@1845 78 "${fatal_re}.*truncated" "ChunkPool::allocate" \
jcoomes@1845 79 "ShouldNotCall" "ShouldNotReachHere" \
dcubed@5365 80 "Unimplemented" "$bad_data_ptr_re" \
dcubed@5365 81 "$bad_func_ptr_re"
dcubed@5365 82
jcoomes@1845 83 do
jcoomes@1845 84 i2=$i
jcoomes@1845 85 [ $i -lt 10 ] && i2=0$i
jcoomes@1845 86
jcoomes@1845 87 "$TESTJAVA/bin/java" $TESTVMOPTS -XX:+IgnoreUnrecognizedVMOptions \
mseledtsov@5847 88 -XX:-TransmitErrorReport \
jcoomes@1845 89 -XX:ErrorHandlerTest=${i} -version > ${i2}.out 2>&1
jcoomes@1845 90
jcoomes@1845 91 # If ErrorHandlerTest is ignored (product build), stop.
jcoomes@1845 92 #
jcoomes@1845 93 # Using the built-in variable $! to get the pid does not work reliably on
jcoomes@1845 94 # windows; use a wildcard instead.
jcoomes@1845 95 mv hs_err_pid*.log ${i2}.log || exit $rc
jcoomes@1845 96
jcoomes@1845 97 for f in ${i2}.log ${i2}.out
jcoomes@1845 98 do
jcoomes@1845 99 egrep -- "$re" $f > $$
jcoomes@1845 100 if [ $? -ne 0 ]
jcoomes@1845 101 then
jcoomes@1845 102 echo "ErrorHandlerTest=$i failed ($f)"
jcoomes@1845 103 rc=1
jcoomes@1845 104 fi
jcoomes@1845 105 done
jcoomes@1845 106 rm -f $$
jcoomes@1845 107
jcoomes@1947 108 i=`expr $i + 1`
jcoomes@1845 109 done
jcoomes@1845 110
jcoomes@1845 111 exit $rc

mercurial