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
The SDK is insufficient to really build much. The builtins can be built
standalone now which is what the stub SDK was meant to permit. Remove the
unnecessary files.
llvm-svn: 230869
On OS X, if you don't have a full Xcode installation, but just the Command Line Tools package, xcrun and xcodebuild don't return a valid SDK root path. In these cases, let's use "/" as the SDK root (which is where the headers and libraries are installed).
Reviewed at http://reviews.llvm.org/D7641
llvm-svn: 230847
The syscall function itself is declared in <unistd.h>
Compiling compiler-rt with -Werror-implicit-function-declaration will
cause a build failure. This change fixes it.
Differential Revision: http://reviews.llvm.org/D7949
llvm-svn: 230838
The ASanified executable could be launched from different locations. When we
cannot find the suppression file relative to the current directory, try to
see if the specified path is relative to the location of the executable.
llvm-svn: 230723
Wrap the StopTheWorld call in a dl_iterate_phdr() callback. This ensures that no
other threads are holding the libdl lock, and we can safely reenter it in the
tracer thread.
llvm-svn: 230631
This rule works like check-cfi, but fails if the tests are unsupported.
This is useful to run on bots if we want to be sure that the tests aren't
silently being skipped.
llvm-svn: 230536
Sorry, SVN had some weird problems so I had to revert and reapply the patch
locally a couple of times and didn't notice I've added file contents to the same
file....
llvm-svn: 230505
Sanitizers work on ancient kernels and were depending on types existing.
When those types were removed, the sanitizer build broke. See bug
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59009 for more information.
This patch fixes it by isolating the need for those types only when the
feature is actually needed, thus allowing one to compile the kernel with
or without that change, irrespective of its version.
Patch by Christophe Lyon.
llvm-svn: 230324
The buildbot failed to build with
error: variable ‘enable_fp’ set but not used [-Werror=unused-but-set-variable]
let's add a `(void)enable_fp;`.
llvm-svn: 230323
In debug mode (COMPILER_RT_DEBUG=On), we still build with -fomit-frame-pointer and wrap_ioctl doesn't set up a proper stack frame. In release mode it does, because ioctl_common_pre gets inlined into wrap_ioctl and it uses the COMMON_INTERCEPTOR_READ_RANGE macro which in the end calls GET_CURRENT_FRAME and that forces the compiler to generate a stack frame for the function.
Not having a proper stack frame breaks the unwinder. This patch forces to generate a frame pointer (via ENABLE_FRAME_POINTER macro).
Reviewed at http://reviews.llvm.org/D7815
llvm-svn: 230318
When AddressSanitizer only a single dynamic alloca and no static allocas, due to an early exit from FunctionStackPoisoner::poisonStack we forget to unpoison the dynamic alloca. This patch fixes that.
Reviewed at http://reviews.llvm.org/D7810
llvm-svn: 230317
Revise the fix to https://code.google.com/p/address-sanitizer/issues/detail?id=178:
always disable strict init-order checking the first time dlopen() is
called: at this point shared library is allowed to access globals
defined in the main executable, as they are guaranteed to be
initialized. Revise the test cases:
* simplify init-order-dlopen.cc test case: make it Linux-specific
(there's no strict init-order checking on other platforms anyway),
and single-threaded.
* reinforce init-order-pthread-create.cc test case: make sure that
init-order checker would produce a false positive unless we
turn it off at the moment we call pthread_create().
llvm-svn: 230288