diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-02-18 11:14:30 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-02-18 11:14:30 +0000 |
| commit | 50bef914a60f5667d619a48ce1bcf105e69efedc (patch) | |
| tree | 3bf694a18cc32f2cef29b2c1191e22b46c6c1605 /compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc | |
| parent | 63a4af7346fd2bb9c13ab34d721b22be0d19dce0 (diff) | |
| download | bcm5719-llvm-50bef914a60f5667d619a48ce1bcf105e69efedc.tar.gz bcm5719-llvm-50bef914a60f5667d619a48ce1bcf105e69efedc.zip | |
[asan] Override default sigaltstack setting on Android.
Android libc always sets altstack on non-main threads, but it is too small for
our unwinder. With use_sigaltstack=1, override this setting with a larger one.
llvm-svn: 201557
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc index 97a732f7fed..58f343d164a 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc @@ -100,7 +100,8 @@ void SetAlternateSignalStack() { stack_t altstack, oldstack; CHECK_EQ(0, sigaltstack(0, &oldstack)); // If the alternate stack is already in place, do nothing. - if ((oldstack.ss_flags & SS_DISABLE) == 0) return; + // Android always sets an alternate stack, but it's too small for us. + if (!SANITIZER_ANDROID && !(oldstack.ss_flags & SS_DISABLE)) return; // TODO(glider): the mapped stack should have the MAP_STACK flag in the // future. It is not required by man 2 sigaltstack now (they're using // malloc()). |

