[compiler-rt] r206872 - [sanitizer] enable check_printf by default for asan and tsan. We've been using this flag for a while and it seems to be stable enough for the rest of the world.
Kostya Serebryany
kcc at google.com
Tue Apr 22 02:17:09 PDT 2014
Author: kcc
Date: Tue Apr 22 04:17:08 2014
New Revision: 206872
URL: http://llvm.org/viewvc/llvm-project?rev=206872&view=rev
Log:
[sanitizer] enable check_printf by default for asan and tsan. We've been using this flag for a while and it seems to be stable enough for the rest of the world.
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc
compiler-rt/trunk/test/asan/TestCases/printf-2.c
compiler-rt/trunk/test/asan/TestCases/printf-3.c
compiler-rt/trunk/test/asan/TestCases/printf-4.c
compiler-rt/trunk/test/asan/TestCases/printf-5.c
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=206872&r1=206871&r2=206872&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_flags.cc Tue Apr 22 04:17:08 2014
@@ -44,7 +44,7 @@ void SetCommonFlagsDefaults(CommonFlags
f->leak_check_at_exit = true;
f->allocator_may_return_null = false;
f->print_summary = true;
- f->check_printf = false;
+ f->check_printf = true;
// TODO(glider): tools may want to set different defaults for handle_segv.
f->handle_segv = SANITIZER_NEEDS_SEGV;
f->allow_user_segv_handler = false;
Modified: compiler-rt/trunk/test/asan/TestCases/printf-2.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/printf-2.c?rev=206872&r1=206871&r2=206872&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/printf-2.c (original)
+++ compiler-rt/trunk/test/asan/TestCases/printf-2.c Tue Apr 22 04:17:08 2014
@@ -3,7 +3,7 @@
// strlen() and memcpy() called by printf().
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=1 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
-// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
+// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
#include <stdio.h>
#include <stdlib.h>
Modified: compiler-rt/trunk/test/asan/TestCases/printf-3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/printf-3.c?rev=206872&r1=206871&r2=206872&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/printf-3.c (original)
+++ compiler-rt/trunk/test/asan/TestCases/printf-3.c Tue Apr 22 04:17:08 2014
@@ -1,7 +1,7 @@
// RUN: %clang_asan -O2 %s -o %t
// RUN: ASAN_OPTIONS=check_printf=1 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: ASAN_OPTIONS=check_printf=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
-// RUN: %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
+// RUN: not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
#include <stdio.h>
int main() {
Modified: compiler-rt/trunk/test/asan/TestCases/printf-4.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/printf-4.c?rev=206872&r1=206871&r2=206872&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/printf-4.c (original)
+++ compiler-rt/trunk/test/asan/TestCases/printf-4.c Tue Apr 22 04:17:08 2014
@@ -3,7 +3,7 @@
// strlen() and memcpy() called by puts().
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=1 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
-// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
+// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
#include <stdio.h>
int main() {
Modified: compiler-rt/trunk/test/asan/TestCases/printf-5.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/printf-5.c?rev=206872&r1=206871&r2=206872&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/printf-5.c (original)
+++ compiler-rt/trunk/test/asan/TestCases/printf-5.c Tue Apr 22 04:17:08 2014
@@ -2,7 +2,7 @@
// We need replace_intrin=0 to avoid reporting errors in memcpy.
// RUN: ASAN_OPTIONS=replace_intrin=0:check_printf=1 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: ASAN_OPTIONS=replace_intrin=0:check_printf=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
-// RUN: ASAN_OPTIONS=replace_intrin=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
+// RUN: ASAN_OPTIONS=replace_intrin=0 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
#include <stdio.h>
#include <string.h>
More information about the llvm-commits
mailing list