[compiler-rt] r210106 - [asan] enable detect_odr_violation=2; https://code.google.com/p/address-sanitizer/wiki/OneDefinitionRuleViolation . This feature has been working quite well so far, found a few bugs and zero false positives. The main problem is that there could be lots of true positives and users will have to disable this checking until the bugs are fixed.

Kostya Serebryany kcc at google.com
Tue Jun 3 08:06:14 PDT 2014


Author: kcc
Date: Tue Jun  3 10:06:13 2014
New Revision: 210106

URL: http://llvm.org/viewvc/llvm-project?rev=210106&view=rev
Log:
[asan] enable detect_odr_violation=2; https://code.google.com/p/address-sanitizer/wiki/OneDefinitionRuleViolation . This feature has been working quite well so far, found a few bugs and zero false positives. The main problem is that there could be lots of true positives and users will have to disable this checking until the bugs are fixed.

Modified:
    compiler-rt/trunk/lib/asan/asan_rtl.cc
    compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc

Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=210106&r1=210105&r2=210106&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Tue Jun  3 10:06:13 2014
@@ -279,6 +279,7 @@ void InitializeFlags(Flags *f, const cha
   f->start_deactivated = false;
   f->detect_invalid_pointer_pairs = 0;
   f->detect_container_overflow = true;
+  f->detect_odr_violation = 2;
 
   // Override from compile definition.
   ParseFlagsFromString(f, MaybeUseAsanDefaultOptionsCompileDefinition());

Modified: compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc?rev=210106&r1=210105&r2=210106&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc Tue Jun  3 10:06:13 2014
@@ -7,12 +7,13 @@
 // RUN: ASAN_OPTIONS=detect_odr_violation=1 not %run %t 2>&1 | FileCheck %s
 // RUN: ASAN_OPTIONS=detect_odr_violation=2 not %run %t 2>&1 | FileCheck %s
 // RUN: ASAN_OPTIONS=detect_odr_violation=0     %run %t 2>&1 | FileCheck %s --check-prefix=DISABLED
-// RUN:                                         %run %t 2>&1 | FileCheck %s --check-prefix=DISABLED
+// RUN:                                     not %run %t 2>&1 | FileCheck %s
 //
 // Same size: report a bug only if detect_odr_violation>=2.
 // RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared %s -o %t.so -DSZ=100
 // RUN: ASAN_OPTIONS=detect_odr_violation=1     %run %t 2>&1 | FileCheck %s --check-prefix=DISABLED
 // RUN: ASAN_OPTIONS=detect_odr_violation=2 not %run %t 2>&1 | FileCheck %s
+// RUN:                                     not %run %t 2>&1 | FileCheck %s
 
 // GNU driver doesn't handle .so files properly.
 // REQUIRES: Clang





More information about the llvm-commits mailing list