summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alex Light <allight@google.com> 2018-08-01 07:02:32 -0700
committer Alex Light <allight@google.com> 2018-08-01 17:02:10 +0000
commitb2a42f5f61213b74e9f581029e894ac2c08b846b (patch)
tree9e593952ef3c6452072ecc43409a39e9028acbda
parentd0c6ec392756fd038ebb8aeaad19aed94c5fd1a5 (diff)
Increase stack size for tests 1917 and 1934
Both these tests could fail under asan due to running out of stack space. We increase the stacks of the secondary threads to 10 mb to solve this problem. This partially reverts 30f3e9ce8150f24154db3fa06d11a3b43df9f77b. Test: SANITIZE_HOST=address art/test/testrunner/testrunner.py -b --host --interp-ac -t 1934 Test: SANITIZE_HOST=address art/test/testrunner/testrunner.py -b --host --interp-ac -t 1917 Bug: 111837501 Bug: 112071036 Change-Id: I22450565c02d88cfbf584f67748eaa470b4920fc
-rw-r--r--test/1917-get-stack-frame/src/art/Test1917.java11
-rw-r--r--test/1934-jvmti-signal-thread/src/art/Test1934.java22
-rw-r--r--test/knownfailures.json14
3 files changed, 22 insertions, 25 deletions
diff --git a/test/1917-get-stack-frame/src/art/Test1917.java b/test/1917-get-stack-frame/src/art/Test1917.java
index def7530bff..75af43bea3 100644
--- a/test/1917-get-stack-frame/src/art/Test1917.java
+++ b/test/1917-get-stack-frame/src/art/Test1917.java
@@ -134,13 +134,20 @@ public class Test1917 {
System.out.println("Recurring 5 times on another thread");
Thread thr = new Thread(
- new RecurCount(5, new StackTraceGenerator(makePrintStackFramesConsumer())));
+ Thread.currentThread().getThreadGroup(),
+ new RecurCount(5, new StackTraceGenerator(makePrintStackFramesConsumer())),
+ "Recurring Thread 1",
+ 10*1000000 /* 10 mb*/);
thr.start();
thr.join();
System.out.println("Recurring 5 times on another thread. Stack trace from main thread!");
ThreadPauser pause = new ThreadPauser();
- Thread thr2 = new Thread(new RecurCount(5, pause));
+ Thread thr2 = new Thread(
+ Thread.currentThread().getThreadGroup(),
+ new RecurCount(5, pause),
+ "Recurring Thread 2",
+ 10*1000000 /* 10 mb*/);
thr2.start();
pause.waitForOtherThreadToPause();
new StackTraceGenerator(thr2, makePrintStackFramesConsumer()).run();
diff --git a/test/1934-jvmti-signal-thread/src/art/Test1934.java b/test/1934-jvmti-signal-thread/src/art/Test1934.java
index 308f17b961..c71090b509 100644
--- a/test/1934-jvmti-signal-thread/src/art/Test1934.java
+++ b/test/1934-jvmti-signal-thread/src/art/Test1934.java
@@ -71,10 +71,14 @@ public class Test1934 {
ensureInitialized(java.util.concurrent.locks.LockSupport.class);
}
+ public static Thread createThread(Runnable r, String name) {
+ return new Thread(Thread.currentThread().getThreadGroup(), r, name, /* 10 mb */ 10 * 1000000);
+ }
+
public static void testStopBeforeStart() throws Exception {
final Throwable[] out_err = new Throwable[] { null, };
final Object tst = new Object();
- Thread target = new Thread(() -> { while (true) { } }, "waiting thread!");
+ Thread target = createThread(() -> { while (true) { } }, "waiting thread!");
target.setUncaughtExceptionHandler((t, e) -> { out_err[0] = e; });
System.out.println("stopping other thread before starting");
try {
@@ -93,7 +97,7 @@ public class Test1934 {
public static void testInterruptBeforeStart() throws Exception {
final Throwable[] out_err = new Throwable[] { null, };
final Object tst = new Object();
- Thread target = new Thread(() -> { while (true) { } }, "waiting thread!");
+ Thread target = createThread(() -> { while (true) { } }, "waiting thread!");
target.setUncaughtExceptionHandler((t, e) -> { out_err[0] = e; });
System.out.println("interrupting other thread before starting");
try {
@@ -113,7 +117,7 @@ public class Test1934 {
final Throwable[] out_err = new Throwable[] { null, };
final Object tst = new Object();
final Semaphore sem = new Semaphore(0);
- Thread target = new Thread(() -> {
+ Thread target = createThread(() -> {
sem.release();
while (true) {
try {
@@ -140,7 +144,7 @@ public class Test1934 {
final Throwable[] out_err = new Throwable[] { null, };
final Object tst = new Object();
final Semaphore sem = new Semaphore(0);
- Thread target = new Thread(() -> {
+ Thread target = createThread(() -> {
sem.release();
while (true) {
try {
@@ -172,7 +176,7 @@ public class Test1934 {
final Throwable[] out_err = new Throwable[] { null, };
final long native_monitor_id = allocNativeMonitor();
final Semaphore sem = new Semaphore(0);
- Thread target = new Thread(() -> {
+ Thread target = createThread(() -> {
sem.release();
nativeWaitForOtherThread(native_monitor_id);
// We need to make sure we do something that can get the exception to be actually noticed.
@@ -214,7 +218,7 @@ public class Test1934 {
public static void testStopRecur() throws Exception {
final Throwable[] out_err = new Throwable[] { null, };
final Semaphore sem = new Semaphore(0);
- Thread target = new Thread(() -> {
+ Thread target = createThread(() -> {
sem.release();
while (true) {
doRecurCnt(null, 50);
@@ -235,7 +239,7 @@ public class Test1934 {
public static void testInterruptRecur() throws Exception {
final Throwable[] out_err = new Throwable[] { null, };
final Semaphore sem = new Semaphore(0);
- Thread target = new Thread(() -> {
+ Thread target = createThread(() -> {
sem.release();
while (true) {
doRecurCnt(() -> {
@@ -258,7 +262,7 @@ public class Test1934 {
public static void testStopSpinning() throws Exception {
final Throwable[] out_err = new Throwable[] { null, };
final Semaphore sem = new Semaphore(0);
- Thread target = new Thread(() -> { sem.release(); while (true) {} }, "Spinning thread!");
+ Thread target = createThread(() -> { sem.release(); while (true) {} }, "Spinning thread!");
target.setUncaughtExceptionHandler((t, e) -> { out_err[0] = e; });
target.start();
sem.acquire();
@@ -273,7 +277,7 @@ public class Test1934 {
public static void testInterruptSpinning() throws Exception {
final Semaphore sem = new Semaphore(0);
- Thread target = new Thread(() -> {
+ Thread target = createThread(() -> {
sem.release();
while (!Thread.currentThread().isInterrupted()) { }
}, "Spinning thread!");
diff --git a/test/knownfailures.json b/test/knownfailures.json
index a7c71a5e8d..ce4ebd76a5 100644
--- a/test/knownfailures.json
+++ b/test/knownfailures.json
@@ -1031,19 +1031,5 @@
"variant": "jit & debuggable",
"bug": "b/109791792",
"description": ["Stack too big."]
- },
- {
- "tests": ["1934-jvmti-signal-thread"],
- "env_vars": {"SANITIZE_HOST": "address"},
- "variant": "interp-ac",
- "bug": "b/111837501",
- "description": ["Unexpected exception thrown"]
- },
- {
- "tests": ["1917-get-stack-frame"],
- "env_vars": {"SANITIZE_HOST": "address"},
- "variant": "interp-ac",
- "bug": "b/112071036",
- "description": ["Unexpected exception thrown"]
}
]