diff options
author | Dave Allison <dallison@google.com> | 2014-07-25 16:15:27 -0700 |
---|---|---|
committer | Dave Allison <dallison@google.com> | 2014-08-13 09:01:41 -0700 |
commit | 648d7112609dd19c38131b3e71c37bcbbd19d11e (patch) | |
tree | 54062831327c660acb309e877e8d8df9ba0c2d5d /test | |
parent | 99c251bbd225dd97d0deece29559a430b12a0b66 (diff) | |
download | art-648d7112609dd19c38131b3e71c37bcbbd19d11e.zip art-648d7112609dd19c38131b3e71c37bcbbd19d11e.tar.gz art-648d7112609dd19c38131b3e71c37bcbbd19d11e.tar.bz2 |
Reduce stack usage for overflow checks
This reduces the stack space reserved for overflow checks to 12K, split
into an 8K gap and a 4K protected region. GC needs over 8K when running
in a stack overflow situation.
Also prevents signal runaway by detecting a signal inside code that
resulted from a signal handler invokation. And adds a max signal count to
the SignalTest to prevent it running forever.
Also reduces the number of iterations for the InterfaceTest as this was
taking (almost) forever with the --trace option on run-test.
Bug: 15435566
Change-Id: Id4fd46f22d52d42a9eb431ca07948673e8fda694
Diffstat (limited to 'test')
-rw-r--r-- | test/004-InterfaceTest/src/Main.java | 4 | ||||
-rw-r--r-- | test/004-SignalTest/signaltest.cc | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/test/004-InterfaceTest/src/Main.java b/test/004-InterfaceTest/src/Main.java index 9ebac59..297cbb0 100644 --- a/test/004-InterfaceTest/src/Main.java +++ b/test/004-InterfaceTest/src/Main.java @@ -23,7 +23,7 @@ public class Main { Integer intobj = new Integer(0); String s = "asdf"; long start = System.currentTimeMillis(); - for (int i = 0; i < 1000000; i++) { + for (int i = 0; i < 10000; i++) { map.put(intobj, s); } long end = System.currentTimeMillis(); @@ -34,7 +34,7 @@ public class Main { Integer intobj = new Integer(0); String s = "asdf"; long start = System.currentTimeMillis(); - for (int i = 0; i < 1000000; i++) { + for (int i = 0; i < 10000; i++) { map.put(intobj, s); } long end = System.currentTimeMillis(); diff --git a/test/004-SignalTest/signaltest.cc b/test/004-SignalTest/signaltest.cc index a2dd664..c05dc22 100644 --- a/test/004-SignalTest/signaltest.cc +++ b/test/004-SignalTest/signaltest.cc @@ -16,6 +16,7 @@ #include <signal.h> #include <stdio.h> +#include <stdlib.h> #include <unistd.h> #include "jni.h" @@ -24,8 +25,15 @@ #include <sys/ucontext.h> #endif +static int signal_count; +static const int kMaxSignal = 2; + static void signalhandler(int sig, siginfo_t* info, void* context) { printf("signal caught\n"); + ++signal_count; + if (signal_count > kMaxSignal) { + abort(); + } #ifdef __arm__ // On ARM we do a more exhaustive test to make sure the signal // context is OK. |