asan: fix signal handling during stoptheworld
authorDmitry Vyukov <dvyukov@google.com>
Mon, 2 Mar 2015 17:36:02 +0000 (17:36 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Mon, 2 Mar 2015 17:36:02 +0000 (17:36 +0000)
commitb79ac88155e805015af1b5691e25a325c9eeda57
tree6c7230ddf4028a86514d85b338d4970c27496332
parentd61f7d8c39189120affc30c9b03f731592d8972c
asan: fix signal handling during stoptheworld

The problem is that without SA_RESTORER flag, kernel ignores the handler. So tracer actually did not setup any handler.
Add SA_RESTORER flag when setting up handlers.
Add a test that causes SIGSEGV in stoptheworld callback.
Move SignalContext from asan to sanitizer_common to print better diagnostics about signal in the tracer thread.

http://reviews.llvm.org/D8005

llvm-svn: 230978
12 files changed:
compiler-rt/lib/asan/asan_internal.h
compiler-rt/lib/asan/asan_linux.cc
compiler-rt/lib/asan/asan_mac.cc
compiler-rt/lib/asan/asan_posix.cc
compiler-rt/lib/sanitizer_common/sanitizer_common.h
compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
compiler-rt/lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc
compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
compiler-rt/lib/tsan/rtl/tsan_rtl.h