summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
diff options
context:
space:
mode:
authorJulian Lettner <jlettner@apple.com>2019-01-31 01:24:01 +0000
committerJulian Lettner <jlettner@apple.com>2019-01-31 01:24:01 +0000
commit15df273eb45dc53669739bb33388a12c1dfce962 (patch)
treea5b70c3815b4d1f07763e37580bf461e19ccae70 /compiler-rt/lib/fuzzer/FuzzerLoop.cpp
parent46138cdb0d9cef9aef3573914c8ec35ea39d28f8 (diff)
downloadbcm5719-llvm-15df273eb45dc53669739bb33388a12c1dfce962.tar.gz
bcm5719-llvm-15df273eb45dc53669739bb33388a12c1dfce962.zip
[libFuzzer] Set default sanitizer options in fuzzer tests
Summary: Set default `ASAN_OPTIONS` when running libFuzzer tests. This allows us to remove special casing in code for Darwin where we usually pass `abort_on_error=0` to override platform defaults for tests. A previous commit changed the code to make the tests pass: https://github.com/llvm/llvm-project/commit/7764a04af007eca68eafcf5caaea560ed05e35a9 Adapted a few tests to use `%env_asan_opts=` instead of directly setting the environment variable. rdar://problem/47515276 Reviewers: kcc, george.karpenkov Differential Revision: https://reviews.llvm.org/D57465 llvm-svn: 352711
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerLoop.cpp')
-rw-r--r--compiler-rt/lib/fuzzer/FuzzerLoop.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerLoop.cpp b/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
index 959d5a23559..bf600169c4c 100644
--- a/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerLoop.cpp
@@ -232,8 +232,9 @@ void Fuzzer::StaticFileSizeExceedCallback() {
}
void Fuzzer::CrashCallback() {
- if (EF->__sanitizer_acquire_crash_state)
- EF->__sanitizer_acquire_crash_state();
+ if (EF->__sanitizer_acquire_crash_state &&
+ !EF->__sanitizer_acquire_crash_state())
+ return;
Printf("==%lu== ERROR: libFuzzer: deadly signal\n", GetPid());
PrintStackTrace();
Printf("NOTE: libFuzzer has rudimentary signal handlers.\n"
OpenPOWER on IntegriCloud