[PATCH] [compiler-rt] Implement AddressSanitizer suppressions

Alexey Samsonov vonosmas at gmail.com
Thu Dec 4 16:37:51 PST 2014


>>! In D6280#21, @kubabrecka wrote:
> Addressing review comments.
> 
>> > // Check that reports from instrumented code cannot be suppressed.
>> Wait, how do you enforce that? By assuming that memset() in user code will be
>> turned into __asan_memset() call? In fact, I see little harm in suppressing
>> reports from memset() from instrumented code if the user explicitly added
>> interceptor_name:memset to suppression file. After all, this would work for
>> another interceptors (like strcpy), won't it?
> 
> I meant memset/memcpy/memmove only. Since these can easily be inlined, the suppression will not work reliably on them, and so it sounds like a good idea to just disallow suppressions for these functions (when used from instrumented code).

But wait, how do you *enforce* that suppressions don't kick in if these functions are called from instrumented code? IIRC if the user writes memset() and we build it with Clang, it may or may not be turned into intrinsic and replaced with __asan_memfoo().

earthdok@: I really have no preference here. If you feel strong about consistency and sticking with abbreviated name - feel free to enforce it :)

================
Comment at: test/asan/TestCases/suppressions-function.cc:8
@@ +7,3 @@
+// RUN: %clangxx_asan -O1 %s -o %t && ASAN_OPTIONS=suppressions=%t.supp %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
+// RUN: %clangxx_asan -O2 %s -o %t && ASAN_OPTIONS=suppressions=%t.supp %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
+// RUN: %clangxx_asan -O3 %s -o %t && ASAN_OPTIONS=suppressions=%t.supp %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
----------------
just -O0 and -O3

http://reviews.llvm.org/D6280






More information about the llvm-commits mailing list