Mercurial > hg > graal-compiler
annotate test/runtime/6888954/vmerrors.sh @ 12116:1624a68007bd
Merge
author | jmasa |
---|---|
date | Tue, 27 Aug 2013 18:55:33 -0700 |
parents | 59b052799158 |
children | cc4f5f8d885e |
rev | line source |
---|---|
1490 | 1 # @test |
2 # @bug 6888954 | |
11092
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
3 # @bug 8015884 |
1490 | 4 # @summary exercise HotSpot error handling code |
5 # @author John Coomes | |
6 # @run shell vmerrors.sh | |
7 | |
8 # Repeatedly invoke java with a command-line option that causes HotSpot to | |
9 # produce an error report and terminate just after initialization. Each | |
10 # invocation is identified by a small integer, <n>, which provokes a different | |
11 # error (assertion failure, guarantee failure, fatal error, etc.). The output | |
12 # from stdout/stderr is written to <n>.out and the hs_err_pidXXX.log file is | |
13 # renamed to <n>.log. | |
14 # | |
15 # The automated checking done by this script is minimal. When updating the | |
16 # fatal error handler it is more useful to run it manually or to use the -retain | |
17 # option with the jtreg so that test directories are not removed automatically. | |
18 # To run stand-alone: | |
19 # | |
20 # TESTJAVA=/java/home/dir | |
21 # TESTVMOPTS=... | |
22 # export TESTJAVA TESTVMOPTS | |
23 # sh test/runtime/6888954/vmerrors.sh | |
24 | |
25 ulimit -c 0 # no core files | |
26 | |
27 i=1 | |
28 rc=0 | |
29 | |
30 assert_re='(assert|guarantee)[(](str|num).*failed: *' | |
11092
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
31 # for bad_data_ptr_re: |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
32 # EXCEPTION_ACCESS_VIOLATION - Win-* |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
33 # SIGILL - MacOS X |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
34 # SIGSEGV - Linux-*, Solaris SPARC-*, Solaris X86-* |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
35 # |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
36 bad_data_ptr_re='(SIGILL|SIGSEGV|EXCEPTION_ACCESS_VIOLATION).* at pc=' |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
37 # |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
38 # for bad_func_ptr_re: |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
39 # EXCEPTION_ACCESS_VIOLATION - Win-* |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
40 # SIGBUS - Solaris SPARC-64 |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
41 # SIGSEGV - Linux-*, Solaris SPARC-32, Solaris X86-* |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
42 # |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
43 # Note: would like to use "pc=0x00*0f," in the pattern, but Solaris SPARC-* |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
44 # gets its signal at a PC in test_error_handler(). |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
45 # |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
46 bad_func_ptr_re='(SIGBUS|SIGSEGV|EXCEPTION_ACCESS_VIOLATION).* at pc=' |
1490 | 47 guarantee_re='guarantee[(](str|num).*failed: *' |
48 fatal_re='fatal error: *' | |
49 tail_1='.*expected null' | |
50 tail_2='.*num=' | |
51 | |
52 for re in \ | |
53 "${assert_re}${tail_1}" "${assert_re}${tail_2}" \ | |
54 "${guarantee_re}${tail_1}" "${guarantee_re}${tail_2}" \ | |
55 "${fatal_re}${tail_1}" "${fatal_re}${tail_2}" \ | |
56 "${fatal_re}.*truncated" "ChunkPool::allocate" \ | |
57 "ShouldNotCall" "ShouldNotReachHere" \ | |
11092
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
58 "Unimplemented" "$bad_data_ptr_re" \ |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
59 "$bad_func_ptr_re" |
59b052799158
8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace
dcubed
parents:
1592
diff
changeset
|
60 |
1490 | 61 do |
62 i2=$i | |
63 [ $i -lt 10 ] && i2=0$i | |
64 | |
65 "$TESTJAVA/bin/java" $TESTVMOPTS -XX:+IgnoreUnrecognizedVMOptions \ | |
66 -XX:ErrorHandlerTest=${i} -version > ${i2}.out 2>&1 | |
67 | |
68 # If ErrorHandlerTest is ignored (product build), stop. | |
69 # | |
70 # Using the built-in variable $! to get the pid does not work reliably on | |
71 # windows; use a wildcard instead. | |
72 mv hs_err_pid*.log ${i2}.log || exit $rc | |
73 | |
74 for f in ${i2}.log ${i2}.out | |
75 do | |
76 egrep -- "$re" $f > $$ | |
77 if [ $? -ne 0 ] | |
78 then | |
79 echo "ErrorHandlerTest=$i failed ($f)" | |
80 rc=1 | |
81 fi | |
82 done | |
83 rm -f $$ | |
84 | |
1592
5b77884bd4b7
6956472: test/runtime/6888954/vmerrors.sh uses ksh-specific syntax
jcoomes
parents:
1490
diff
changeset
|
85 i=`expr $i + 1` |
1490 | 86 done |
87 | |
88 exit $rc |