[compiler-rt] r341500 - [hwasan] Don't handle signals on Android.
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 5 15:46:19 PDT 2018
Author: eugenis
Date: Wed Sep 5 15:46:19 2018
New Revision: 341500
URL: http://llvm.org/viewvc/llvm-project?rev=341500&view=rev
Log:
[hwasan] Don't handle signals on Android.
Sigtrap is used for error reporting, but all other signals are better
left for the platform.
In particular, sanitizer signal handlers do not dump registers or
memory which makes debugging harder for no good reason.
Modified:
compiler-rt/trunk/lib/hwasan/hwasan.cc
Modified: compiler-rt/trunk/lib/hwasan/hwasan.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/hwasan/hwasan.cc?rev=341500&r1=341499&r2=341500&view=diff
==============================================================================
--- compiler-rt/trunk/lib/hwasan/hwasan.cc (original)
+++ compiler-rt/trunk/lib/hwasan/hwasan.cc Wed Sep 5 15:46:19 2018
@@ -87,7 +87,18 @@ static void InitializeFlags() {
cf.check_printf = false;
cf.intercept_tls_get_addr = true;
cf.exitcode = 99;
+ // Sigtrap is used in error reporting.
cf.handle_sigtrap = kHandleSignalExclusive;
+
+#if SANITIZER_ANDROID
+ // Let platform handle other signals. It is better at reporting them then we
+ // are.
+ cf.handle_segv = kHandleSignalNo;
+ cf.handle_sigbus = kHandleSignalNo;
+ cf.handle_abort = kHandleSignalNo;
+ cf.handle_sigill = kHandleSignalNo;
+ cf.handle_sigfpe = kHandleSignalNo;
+#endif
OverrideCommonFlags(cf);
}
More information about the llvm-commits
mailing list