Index: lib/asan/asan_flags.inc =================================================================== --- lib/asan/asan_flags.inc +++ lib/asan/asan_flags.inc @@ -78,7 +78,7 @@ ASAN_FLAG(bool, unmap_shadow_on_exit, false, "If set, explicitly unmaps the (huge) shadow at exit.") ASAN_FLAG( - bool, abort_on_error, false, + bool, abort_on_error, true, "If set, the tool calls abort() instead of _exit() after printing the " "error report.") ASAN_FLAG(bool, print_stats, false, Index: test/asan/TestCases/abort_on_error.cc =================================================================== --- test/asan/TestCases/abort_on_error.cc +++ test/asan/TestCases/abort_on_error.cc @@ -0,0 +1,16 @@ +// Check that with empty ASAN_OPTIONS, ASan reports actually crash the process +// (abort_on_error=1). + +// RUN: %clangxx_asan %s -o %t + +// Intentionally don't inherit the default ASAN_OPTIONS. +// RUN: ASAN_OPTIONS="" not --crash %run %t 2>&1 | FileCheck %s + +#include +int main() { + char *x = (char*)malloc(10 * sizeof(char)); + free(x); + return x[5]; + // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}} + // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}} +} Index: test/asan/Unit/lit.site.cfg.in =================================================================== --- test/asan/Unit/lit.site.cfg.in +++ test/asan/Unit/lit.site.cfg.in @@ -28,3 +28,6 @@ # Set LD_LIBRARY_PATH to pick dynamic runtime up properly. push_ld_library_path(config, config.compiler_rt_libdir) + +# Let's run tests with abort_on_error=0 to avoid generating crashlogs. +config.environment["ASAN_OPTIONS"] = "abort_on_error=0" Index: test/asan/lit.cfg =================================================================== --- test/asan/lit.cfg +++ test/asan/lit.cfg @@ -148,6 +148,9 @@ # Default test suffixes. config.suffixes = ['.c', '.cc', '.cpp'] +# Let's run tests with abort_on_error=0 to avoid generating crashlogs. +config.environment["ASAN_OPTIONS"] = "abort_on_error=0" + if config.host_os == 'Darwin': config.suffixes.append('.mm')