[PATCH] D15080: [asan] Reports suppressions for ASan recovery mode (compiler-rt part).
Kostya Serebryany via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 1 14:30:31 PST 2015
kcc added inline comments.
================
Comment at: lib/asan/asan_flags.inc:141
@@ -140,1 +140,3 @@
"(WARNING: USE AT YOUR OWN RISK!)")
+ASAN_FLAG(bool, deduplicate_reports, true,
+ "Deduplicate multiple reports for single source location in "
----------------
maybe use names similar to ones in tsan?
e.g. suppress_equal_pcs?
================
Comment at: lib/asan/asan_rtl.cc:117
@@ +116,3 @@
+ if (!flags()->deduplicate_reports) return false;
+ static u32 pc_num;
+ // We have exceeded reasonable number of different reports, subsequent
----------------
can't you make it __sanitizer::atomic_uint32_t ?
================
Comment at: lib/asan/asan_rtl.cc:121
@@ +120,3 @@
+ if (pc_num >= kAsanBuggyPcPoolSize) {
+ if (!flags()->sleep_before_dying)
+ SleepForMillis(100);
----------------
Bad.
We should not duplicate this kind of functionality.
Why not call Die() here?
================
Comment at: lib/asan/asan_rtl.cc:129
@@ +128,3 @@
+
+ AsanBuggyPcPool[pc_num] = pc;
+ atomic_fetch_add((__sanitizer::atomic_uint32_t *)&pc_num, 1,
----------------
this is actually racy, isn't it? :)
================
Comment at: test/asan/TestCases/halt_on_error-2.c:6
@@ +5,3 @@
+// RUN: FileCheck %s < 2.txt
+// RUN: [ $(grep -c 'ERROR: AddressSanitizer: stack-buffer-overflow' 2.txt) -eq 3 ]
+
----------------
I would just add
CHECK-NOT: ERROR
as a 4-th CHECK line
Also, add a run-line that actually produces 30 error messages and checks for that.
http://reviews.llvm.org/D15080
More information about the llvm-commits
mailing list