summaryrefslogtreecommitdiffstats
path: root/runtime/thread_linux.cc
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-08-13 14:37:26 -0700
committerIan Rogers <irogers@google.com>2014-08-13 14:37:26 -0700
commitc24a1e00b13a7ebf10dd896f6a18b1ad09617ec7 (patch)
tree51ba2eb0a5c77ad8c347544be58f3512a827f30c /runtime/thread_linux.cc
parente39a5e1ced3d2b87974c646678dd719c02a9a010 (diff)
downloadart-c24a1e00b13a7ebf10dd896f6a18b1ad09617ec7.tar.gz
art-c24a1e00b13a7ebf10dd896f6a18b1ad09617ec7.tar.bz2
art-c24a1e00b13a7ebf10dd896f6a18b1ad09617ec7.zip
Ensure alternate signal stack is minimum size.
On Mac a sigaltstack may need to be 32KB, setting it to 16KB causes sigaltstack to fail. Change-Id: I87f315ae2fb6be4db40a34b350ad5789ff76c113
Diffstat (limited to 'runtime/thread_linux.cc')
-rw-r--r--runtime/thread_linux.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/thread_linux.cc b/runtime/thread_linux.cc
index 9aacb301ec..125405625b 100644
--- a/runtime/thread_linux.cc
+++ b/runtime/thread_linux.cc
@@ -33,8 +33,11 @@ static void SigAltStack(stack_t* new_stack, stack_t* old_stack) {
}
// The default SIGSTKSZ on linux is 8K. If we do any logging in a signal
-// handler this is too small. We allocate 16K instead.
-static constexpr int kHostAltSigStackSize = 16*1024; // 16K signal stack.
+// handler this is too small. We allocate 16K instead or the minimum signal
+// stack size.
+// TODO: We shouldn't do logging (with locks) in signal handlers.
+static constexpr int kHostAltSigStackSize =
+ 16 * KB < MINSIGSTKSZ ? MINSIGSTKSZ : 16 * KB;
void Thread::SetUpAlternateSignalStack() {
// Create and set an alternate signal stack.