[PATCH] D46277: [libFuzzer] Report at most one crash per input.

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 1 12:27:29 PDT 2018


morehouse added inline comments.


================
Comment at: compiler-rt/lib/asan/asan_report.cc:137
   ~ScopedInErrorReport() {
+    if (!__sanitizer_acquire_crash_state()) {
+      asanThreadRegistry().Unlock();
----------------
kcc wrote:
> Will check-asan pass with this? 
> __sanitizer_acquire_crash_state is weak, and is not defined w/o libFuzzer, so you should get a null deref here. No? 
check-asan passes.  This is defined weakly in sanitizer_common.cc, so it shouldn't be a nullptr.


================
Comment at: compiler-rt/lib/fuzzer/FuzzerTracePC.cpp:382
+ATTRIBUTE_NO_SANITIZE_ALL
+bool __sanitizer_acquire_crash_state() {
+  static std::atomic<bool> InCrashState(false);
----------------
kcc wrote:
> I was thinking about implementing this function in sanitizer_common, and not making it weak. 
I defined it weakly in sanitizer_common.cc so that recovery mode shouldn't be affected.


https://reviews.llvm.org/D46277





More information about the llvm-commits mailing list