[compiler-rt] r207099 - [asan] enable use_sigaltstack by default (this will provide verbose reports on stack-overflow instead of silently crashing with SEGV)

Kostya Serebryany kcc at google.com
Thu Apr 24 04:55:18 PDT 2014


Author: kcc
Date: Thu Apr 24 06:55:17 2014
New Revision: 207099

URL: http://llvm.org/viewvc/llvm-project?rev=207099&view=rev
Log:
[asan] enable use_sigaltstack by default (this will provide verbose reports on stack-overflow instead of silently crashing with SEGV)

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc
    compiler-rt/trunk/test/asan/TestCases/stack-overflow.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc?rev=207099&r1=207098&r2=207099&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc Thu Apr 24 06:55:17 2014
@@ -48,7 +48,7 @@ void SetCommonFlagsDefaults(CommonFlags
   // TODO(glider): tools may want to set different defaults for handle_segv.
   f->handle_segv = SANITIZER_NEEDS_SEGV;
   f->allow_user_segv_handler = false;
-  f->use_sigaltstack = false;
+  f->use_sigaltstack = true;
   f->detect_deadlocks = false;
   f->clear_shadow_mmap_threshold = 64 * 1024;
   f->color = "auto";

Modified: compiler-rt/trunk/test/asan/TestCases/stack-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/stack-overflow.cc?rev=207099&r1=207098&r2=207099&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/stack-overflow.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/stack-overflow.cc Thu Apr 24 06:55:17 2014
@@ -13,6 +13,7 @@
 // RUN: %clangxx_asan -O3 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan -O0 %s -DTHREAD -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %t 2>&1 | FileCheck %s
 // RUN: %clangxx_asan -O3 %s -DTHREAD -lpthread -o %t && ASAN_OPTIONS=use_sigaltstack=1 not %t 2>&1 | FileCheck %s
+// RUN: not %t 2>&1 | FileCheck %s
 
 #include <assert.h>
 #include <stdlib.h>





More information about the llvm-commits mailing list