[compiler-rt] r201557 - [asan] Override default sigaltstack setting on Android.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Tue Feb 18 03:14:31 PST 2014


Author: eugenis
Date: Tue Feb 18 05:14:30 2014
New Revision: 201557

URL: http://llvm.org/viewvc/llvm-project?rev=201557&view=rev
Log:
[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.

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc?rev=201557&r1=201556&r2=201557&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix_libcdep.cc Tue Feb 18 05:14:30 2014
@@ -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()).





More information about the llvm-commits mailing list