[PATCH] [ASan] Move the SIGSEGV/SIGBUS handling to sanitizer_common

Alexander Potapenko glider at google.com
Fri Jan 31 05:15:07 PST 2014



================
Comment at: asan/asan_interceptors.cc:206
@@ +205,3 @@
+
+extern "C" SANITIZER_WEAK_ATTRIBUTE int
+__sanitizer_sigaction_f(int signum, const void *act, void *oldact) {
----------------
Alexey Samsonov wrote:
> You don't need WEAK here.
Done

================
Comment at: asan/asan_internal.h:74
@@ -73,2 +73,3 @@
 void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp);
+void ASAN_OnSIGSEGV(int, void *siginfo, void *context);
 
----------------
Alexey Samsonov wrote:
> AsanOnSIGSEGV
Done

================
Comment at: sanitizer_common/sanitizer_posix_libcdep.cc:123
@@ +122,3 @@
+typedef void (*sa_sigaction_t)(int, siginfo_t *, void *);
+void MaybeInstallSigaction(int signum,
+                           SignalHandlerType handler) {
----------------
Alexey Samsonov wrote:
> static void MaybeInstallSigaction
Done

================
Comment at: sanitizer_common/sanitizer_posix_libcdep.cc:140
@@ +139,3 @@
+  // will be actually set only once.
+  if (common_flags()->use_sigaltstack) __sanitizer::SetAlternateSignalStack();
+  MaybeInstallSigaction(SIGSEGV, handler);
----------------
Alexey Samsonov wrote:
> remove __sanitizer::
Done


http://llvm-reviews.chandlerc.com/D2640



More information about the llvm-commits mailing list