diff options
author | Andreas Gampe <agampe@google.com> | 2015-01-13 19:48:14 -0800 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2015-01-14 14:08:47 -0800 |
commit | 038bb2252ed1d7132f45006507e389b7ba1617ce (patch) | |
tree | 3f087fcb6c6a50c860882258c90193c44c2194ec /test/etc | |
parent | 07ab4ec97221d882322a1ce064557202150f44ea (diff) | |
download | art-038bb2252ed1d7132f45006507e389b7ba1617ce.zip art-038bb2252ed1d7132f45006507e389b7ba1617ce.tar.gz art-038bb2252ed1d7132f45006507e389b7ba1617ce.tar.bz2 |
ART: Dump all threads on test timeout
Use SIGRTMIN+2 as a special signal to dump all threads similar to
SIGQUIT. Use nested timeouts to enforce a test timeout and dump
the threads in a deadlock.
Bug: 18933933
Change-Id: I4209047eeca07ff360d7c19922d5b5da64fd69a5
Diffstat (limited to 'test/etc')
-rwxr-xr-x | test/etc/run-test-jar | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index 5c0f83f..2710df8 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -37,7 +37,8 @@ QUIET="n" RELOCATE="y" SECONDARY_DEX="" TIME_OUT="y" -TIME_OUT_VALUE=5m +# Value in minutes. +TIME_OUT_VALUE=5 USE_GDB="n" USE_JVM="n" VERIFY="y" @@ -377,7 +378,13 @@ else if [ "$TIME_OUT" = "y" ]; then # Add timeout command if time out is desired. - cmdline="timeout $TIME_OUT_VALUE $cmdline" + # + # Note: We use nested timeouts. The inner timeout sends SIGRTMIN+2 (usually 36) to ART, which + # will induce a full thread dump before abort. However, dumping threads might deadlock, + # so the outer timeout sends the regular SIGTERM after an additional minute to ensure + # termination (without dumping all threads). + TIME_PLUS_ONE=$(($TIME_OUT_VALUE + 1)) + cmdline="timeout ${TIME_PLUS_ONE}m timeout -s SIGRTMIN+2 ${TIME_OUT_VALUE}m $cmdline" fi if [ "$DEV_MODE" = "y" ]; then |