summaryrefslogtreecommitdiffstats
path: root/test/ThreadStress
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2011-12-15 17:27:34 -0800
committerElliott Hughes <enh@google.com>2011-12-15 17:27:34 -0800
commit831afe4c2334f3d96df39538023f122101c89384 (patch)
tree980cb1b75ba10ed3462c99ed827e75b23a5ffe0d /test/ThreadStress
parentdbf05b722af99ba2fd2f4c4fc7eb6c3e9880e5d1 (diff)
downloadart-831afe4c2334f3d96df39538023f122101c89384.zip
art-831afe4c2334f3d96df39538023f122101c89384.tar.gz
art-831afe4c2334f3d96df39538023f122101c89384.tar.bz2
Improve the ThreadStress test to send SIGQUIT, and fix the bug that finds.
I'd heard complaints of a system_server deadlock on crespo, but wasn't seeing it on mysid. I did see it soon after trying to use crespo, but system_server has way too many threads and adb is too damn unreliable for me to effectively debug that. This improves ThreadStress so we exercise that path lots, and catch the deadlock relatively quickly with relatively few threads. The fix is explained in a code comment that's larger than the fix. Change-Id: I593bc94cf1239065a604703568420986a03ce628
Diffstat (limited to 'test/ThreadStress')
-rw-r--r--test/ThreadStress/ThreadStress.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/ThreadStress/ThreadStress.java b/test/ThreadStress/ThreadStress.java
index c294a38..1f8fb2d 100644
--- a/test/ThreadStress/ThreadStress.java
+++ b/test/ThreadStress/ThreadStress.java
@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import libcore.io.*;
// Run on host with:
// javac ThreadTest.java && java ThreadStress && rm *.class
@@ -29,7 +30,8 @@ class ThreadStress implements Runnable {
enum Operation {
OOM(1),
- ALLOC(99),
+ SIGQUIT(19),
+ ALLOC(80),
EXIT(50),
WAIT(50);
@@ -194,6 +196,12 @@ class ThreadStress implements Runnable {
case EXIT: {
return;
}
+ case SIGQUIT: {
+ try {
+ Libcore.os.kill(Libcore.os.getpid(), OsConstants.SIGQUIT);
+ } catch (ErrnoException ex) {
+ }
+ }
case WAIT: {
synchronized (lock) {
try {