summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2018-06-20 15:18:14 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-06-20 15:18:14 +0000
commit5c9715e0bafe58d28e24ad957db4f3adfe367bd4 (patch)
treecdb1387ffcf2db9b75d9e66caff845d1ac09fec7
parentfaf742fe798038cd314ad06165017c9719cbce6e (diff)
parent7a55ce0fed42310e6ff71e3fd648ea715c40aa83 (diff)
Merge "ART: Ensure minimum stack size under ASAN"
-rw-r--r--runtime/thread.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc
index 388c69e6aa..3c5569fe05 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -504,6 +504,13 @@ static size_t FixStackSize(size_t stack_size) {
// so include that here to support apps that expect large native stacks.
stack_size += 1 * MB;
+ // Under sanitization, frames of the interpreter may become bigger, both for C code as
+ // well as the ShadowFrame. Ensure a larger minimum size. Otherwise initialization
+ // of all core classes cannot be done in all test circumstances.
+ if (kMemoryToolIsAvailable) {
+ stack_size = std::max(2 * MB, stack_size);
+ }
+
// It's not possible to request a stack smaller than the system-defined PTHREAD_STACK_MIN.
if (stack_size < PTHREAD_STACK_MIN) {
stack_size = PTHREAD_STACK_MIN;