test/runtime/6888954/vmerrors.sh

Wed, 20 May 2015 09:07:36 -0400

author
skovalev
date
Wed, 20 May 2015 09:07:36 -0400
changeset 7871
3820a7d64760
parent 7574
a51071796915
child 7994
04ff2f6cd0eb
permissions
-rw-r--r--

8078834: [TESTBUG] Tests fails on ARM64 due to unknown hardware
Reviewed-by: dholmes, adinn

goetz@7574 1 # Copyright (c) 2013, 2015, 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-*
goetz@7574 64 # SIGILL - Aix
dcubed@5365 65 #
dcubed@5365 66 # Note: would like to use "pc=0x00*0f," in the pattern, but Solaris SPARC-*
dcubed@5365 67 # gets its signal at a PC in test_error_handler().
dcubed@5365 68 #
goetz@7574 69 bad_func_ptr_re='(SIGBUS|SIGSEGV|SIGILL|EXCEPTION_ACCESS_VIOLATION).* at pc='
jcoomes@1845 70 guarantee_re='guarantee[(](str|num).*failed: *'
jcoomes@1845 71 fatal_re='fatal error: *'
jcoomes@1845 72 tail_1='.*expected null'
jcoomes@1845 73 tail_2='.*num='
jcoomes@1845 74
jcoomes@1845 75 for re in \
jcoomes@1845 76 "${assert_re}${tail_1}" "${assert_re}${tail_2}" \
jcoomes@1845 77 "${guarantee_re}${tail_1}" "${guarantee_re}${tail_2}" \
jcoomes@1845 78 "${fatal_re}${tail_1}" "${fatal_re}${tail_2}" \
jcoomes@1845 79 "${fatal_re}.*truncated" "ChunkPool::allocate" \
jcoomes@1845 80 "ShouldNotCall" "ShouldNotReachHere" \
dcubed@5365 81 "Unimplemented" "$bad_data_ptr_re" \
dcubed@5365 82 "$bad_func_ptr_re"
dcubed@5365 83
jcoomes@1845 84 do
jcoomes@1845 85 i2=$i
jcoomes@1845 86 [ $i -lt 10 ] && i2=0$i
jcoomes@1845 87
jcoomes@1845 88 "$TESTJAVA/bin/java" $TESTVMOPTS -XX:+IgnoreUnrecognizedVMOptions \
mseledtsov@5847 89 -XX:-TransmitErrorReport \
jcoomes@1845 90 -XX:ErrorHandlerTest=${i} -version > ${i2}.out 2>&1
jcoomes@1845 91
jcoomes@1845 92 # If ErrorHandlerTest is ignored (product build), stop.
jcoomes@1845 93 #
jcoomes@1845 94 # Using the built-in variable $! to get the pid does not work reliably on
jcoomes@1845 95 # windows; use a wildcard instead.
jcoomes@1845 96 mv hs_err_pid*.log ${i2}.log || exit $rc
jcoomes@1845 97
jcoomes@1845 98 for f in ${i2}.log ${i2}.out
jcoomes@1845 99 do
jcoomes@1845 100 egrep -- "$re" $f > $$
jcoomes@1845 101 if [ $? -ne 0 ]
jcoomes@1845 102 then
jcoomes@1845 103 echo "ErrorHandlerTest=$i failed ($f)"
jcoomes@1845 104 rc=1
jcoomes@1845 105 fi
jcoomes@1845 106 done
jcoomes@1845 107 rm -f $$
jcoomes@1845 108
jcoomes@1947 109 i=`expr $i + 1`
jcoomes@1845 110 done
jcoomes@1845 111
jcoomes@1845 112 exit $rc

mercurial