Index: lib/asan/asan_interceptors.cc =================================================================== --- lib/asan/asan_interceptors.cc +++ lib/asan/asan_interceptors.cc @@ -351,7 +351,7 @@ #if SANITIZER_ANDROID INTERCEPTOR(void*, bsd_signal, int signum, void *handler) { if (!IsHandledDeadlySignal(signum) || - common_flags()->allow_user_segv_handler) { + common_flags()->allow_user_signal_handler) { return REAL(bsd_signal)(signum, handler); } return 0; @@ -360,7 +360,7 @@ INTERCEPTOR(void*, signal, int signum, void *handler) { if (!IsHandledDeadlySignal(signum) || - common_flags()->allow_user_segv_handler) { + common_flags()->allow_user_signal_handler) { return REAL(signal)(signum, handler); } return nullptr; @@ -369,7 +369,7 @@ INTERCEPTOR(int, sigaction, int signum, const struct sigaction *act, struct sigaction *oldact) { if (!IsHandledDeadlySignal(signum) || - common_flags()->allow_user_segv_handler) { + common_flags()->allow_user_signal_handler) { return REAL(sigaction)(signum, act, oldact); } return 0; Index: lib/asan/asan_win.cc =================================================================== --- lib/asan/asan_win.cc +++ lib/asan/asan_win.cc @@ -80,8 +80,10 @@ INTERCEPTOR_WINAPI(LPTOP_LEVEL_EXCEPTION_FILTER, SetUnhandledExceptionFilter, LPTOP_LEVEL_EXCEPTION_FILTER ExceptionFilter) { CHECK(REAL(SetUnhandledExceptionFilter)); - if (ExceptionFilter == &SEHHandler || common_flags()->allow_user_segv_handler) + if (ExceptionFilter == &SEHHandler || + common_flags()->allow_user_signal_handler) { return REAL(SetUnhandledExceptionFilter)(ExceptionFilter); + } // We record the user provided exception handler to be called for all the // exceptions unhandled by asan. Swap(ExceptionFilter, user_seh_handler); Index: lib/sanitizer_common/sanitizer_flags.inc =================================================================== --- lib/sanitizer_common/sanitizer_flags.inc +++ lib/sanitizer_common/sanitizer_flags.inc @@ -88,8 +88,8 @@ "If set, registers the tool's custom SIGILL handler.") COMMON_FLAG(bool, handle_sigfpe, true, "If set, registers the tool's custom SIGFPE handler.") -COMMON_FLAG(bool, allow_user_segv_handler, true, - "If set, allows user to register a SEGV handler even if the tool " +COMMON_FLAG(bool, allow_user_signal_handler, true, + "If set, allows user to register a signal handler even if the tool " "registers one.") COMMON_FLAG(bool, use_sigaltstack, true, "If set, uses alternate stack for signal handling.") Index: test/asan/TestCases/Posix/allow_user_segv.cc =================================================================== --- test/asan/TestCases/Posix/allow_user_segv.cc +++ test/asan/TestCases/Posix/allow_user_segv.cc @@ -1,8 +1,8 @@ // Regression test for // https://code.google.com/p/address-sanitizer/issues/detail?id=180 -// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=allow_user_segv_handler=true not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_asan -O2 %s -o %t && %env_asan_opts=allow_user_segv_handler=true not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=allow_user_signal_handler=true not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -O2 %s -o %t && %env_asan_opts=allow_user_signal_handler=true not %run %t 2>&1 | FileCheck %s #include #include Index: test/sanitizer_common/TestCases/Linux/signal_segv_handler.cc =================================================================== --- test/sanitizer_common/TestCases/Linux/signal_segv_handler.cc +++ test/sanitizer_common/TestCases/Linux/signal_segv_handler.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx -O1 %s -o %t && TSAN_OPTIONS="flush_memory_ms=1 memory_limit_mb=1" ASAN_OPTIONS="handle_segv=0 allow_user_segv_handler=1" %run %t 2>&1 | FileCheck %s +// RUN: %clangxx -O1 %s -o %t && TSAN_OPTIONS="flush_memory_ms=1 memory_limit_mb=1" ASAN_OPTIONS="handle_segv=0 allow_user_signal_handler=1" %run %t 2>&1 | FileCheck %s // JVM uses SEGV to preempt threads. All threads do a load from a known address // periodically. When runtime needs to preempt threads, it unmaps the page.