Merge "Increase the size of the signal stack on 64-bit." am: 8fd93e6ea5
am: a8ac6272c2
Change-Id: I38661574ba316b52be1f13116fd8252560b72b92
diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h
index 6dd2f9c..91913e8 100644
--- a/libc/bionic/pthread_internal.h
+++ b/libc/bionic/pthread_internal.h
@@ -167,9 +167,14 @@
// SIGSTKSZ (8KiB) is not big enough.
// An snprintf to a stack buffer of size PATH_MAX consumes ~7KiB of stack.
-// Also, on 64-bit, logging uses more than 8KiB by itself:
-// https://code.google.com/p/android/issues/detail?id=187064
+// On 64-bit, logging uses more than 8KiB by itself, ucontext is comically
+// large on aarch64, and we have effectively infinite address space, so double
+// the signal stack size.
+#if defined(__LP64__)
+#define SIGNAL_STACK_SIZE_WITHOUT_GUARD (32 * 1024)
+#else
#define SIGNAL_STACK_SIZE_WITHOUT_GUARD (16 * 1024)
+#endif
// Traditionally we gave threads a 1MiB stack. When we started
// allocating per-thread alternate signal stacks to ease debugging of