[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
This commit is contained in:
Evgeniy Stepanov 2014-02-18 11:14:30 +00:00
parent 63a4af7346
commit 50bef914a6
1 changed files with 2 additions and 1 deletions

View File

@ -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()).