[PATCH] D12318: [ASan] Enable optional ASan recovery
Alexey Samsonov via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 13:44:26 PDT 2015
samsonov added inline comments.
================
Comment at: include/clang/Basic/Sanitizers.h:82
@@ +81,3 @@
+/// Returns a non-zero SanitizerMask, or \c 0 if \p Value is not known.
+const char *getSanitizerName(SanitizerKind::SanitizerOrdinal SO);
+
----------------
Do you actually use it anywhere?
================
Comment at: lib/CodeGen/BackendUtil.cpp:214
@@ -209,3 +213,3 @@
legacy::PassManagerBase &PM) {
PM.add(createAddressSanitizerFunctionPass(/*CompileKernel*/true));
PM.add(createAddressSanitizerModulePass(/*CompileKernel*/true));
----------------
Is recovery supposed to work for -fsanitize=kernel-address? Should you mark it as Unrecoverable?
================
Comment at: lib/asan/asan_flags.inc:144
@@ +143,3 @@
+
+ASAN_FLAG(bool, recover, false,
+ "If true, continue execution after error. "
----------------
This is really sad, but we tend to use `halt_on_error` runtime flag for that. This name is already used in TSan, MSan and UBSan.
================
Comment at: lib/asan/asan_interface_internal.h:134
@@ -133,2 +133,3 @@
SANITIZER_INTERFACE_ATTRIBUTE
void __asan_report_error(uptr pc, uptr bp, uptr sp,
+ uptr addr, int is_write, uptr access_size, u32 exp,
----------------
This function is also declared in public header: include/sanitizer/asan_interface.h (which is kind of stupid), so you have to fix it in both places. Looks like it's not an ABI break, though.
================
Comment at: lib/asan/asan_internal.h:129
@@ +128,3 @@
+ // This is racy but we don't need 100% correctness.
+ if (is_error) ++num_reported_errors;
+ }
----------------
We have atomic_fetch_add
Repository:
rL LLVM
http://reviews.llvm.org/D12318
More information about the llvm-commits
mailing list