Age | Commit message (Collapse) | Author |
|
asan to sanitizer_common.
Reviewers: eugenis
Subscribers: kubabrecka, dberris, llvm-commits
Differential Revision: https://reviews.llvm.org/D28074
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@290626 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Handling SIGILL on Darwin works fine, so let's just make this feature work and re-enable the ill.cc testcase.
Differential Revision: https://reviews.llvm.org/D27141
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@287959 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This patch prints out all CPU registers after a SIGSEGV. These are available in the signal handler context. Only implemented for Darwin. Can be turned off with the dump_registers flag.
Differential Revision: https://reviews.llvm.org/D11365
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@287957 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Currently we either define SANITIZER_GO for Go or don't define it at all for C++.
This works fine with preprocessor (ifdef/ifndef/defined), but does not work
for C++ if statements (e.g. if (SANITIZER_GO) {...}). Also this is different
from majority of SANITIZER_FOO macros which are always defined to either 0 or 1.
Always define SANITIZER_GO to either 0 or 1.
This allows to use SANITIZER_GO in expressions and in flag default values.
Also remove kGoMode and kCppMode, which were meant to be used in expressions,
but they are not defined in sanitizer_common code, so SANITIZER_GO become prevalent.
Also convert some preprocessor checks to C++ if's or ternary expressions.
Majority of this change is done mechanically with:
sed "s#ifdef SANITIZER_GO#if SANITIZER_GO#g"
sed "s#ifndef SANITIZER_GO#if \!SANITIZER_GO#g"
sed "s#defined(SANITIZER_GO)#SANITIZER_GO#g"
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@285443 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Address lint comments.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@283378 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset.
Differential Revision: https://reviews.llvm.org/D25218
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@283375 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This reverts commit b2af965b7924ad793b313996a96633bb72daf629.
Revert as these changes broke a Chromium buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@283349 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset.
Differential Revision: https://reviews.llvm.org/D25218
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@283240 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Avoid redefining the weak stub when building gotsan.cc
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281576 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
'weak' doesn't behave like it does on linux.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281567 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
r280885 added a testcase for handle_abort, which is broken on macOS, let’s add this support into sanitizer_mac.cc.
Differential Revision: https://reviews.llvm.org/D24344
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280945 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276346 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269310 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
add an internal_sleep.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269296 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
We're using forkpty to spawn the atos symbolizer. In some cases, login_tty (part of forkpty) can fail due to security measures (sandboxing). In this case, we should exit with a status code instead of completely crashing the spawned process. Even processing a failed CHECK() is problematic here, because we're post-fork and pre-exec where a lot of things don't work (for multithreaded processes, for OS X GUI apps, etc.).
Differential Revision: http://reviews.llvm.org/D20048
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269289 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Recent TSan changes (r267678) which factor out parts of ThreadState into a Processor structure broke worker threads on OS X. This fixes it by properly calling ProcCreate for GCD worker threads and by replacing some CHECKs with RAW_CHECK in early process initialization. CHECK() in TSan calls the allocator, which requires a valid Processor.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267864 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary: Resubmit of http://reviews.llvm.org/D19495 enabled only on intel.
Subscribers: kubabrecka
Differential Revision: http://reviews.llvm.org/D19561
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267750 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
os_trace turns out to be a macro that creates static object.
Function-static objects use __cxa_atexit and __dso_handle
which are not present in Go runtime.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267720 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
syslog_lock is not defined in Go build.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267714 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Ifdef out global variables with destructors.
This requires runtime support that is not provided by Go runtime
(in particular _dso_handle symbol).
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267709 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This reverts commit r267477.
It broke our bots that enables the AArch64 backends, it seems that
this code is using a Darwin *X86 specific* field.
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267526 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Subscribers: kubabrecka
Differential Revision: http://reviews.llvm.org/D19495
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267477 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Let's use pthread_threadid_np which returns a more reasonable ID than pthread_self (which is actually a stack pointer). The numbers from pthread_threadid_np are already used in other tools, e.g. in LLDB, and often appear in logs, so it's much more useful than pthread_self.
Differential Revision: http://reviews.llvm.org/D18951
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266991 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
old Darwin systems.
This patch fixes https://github.com/google/sanitizers/issues/669. On older Darwin systems (in particular, Darwin 10),
dyld doesn't export '_dyldVersionNumber' symbol so we would have 'undefined reference' error in sanitzer library. Although
sanitizers support was added to LLVM on OS X 10.7+ where '_dyldVersionNumber' symbol is already exported, GCC users still
may want use them on older systems.
Differential Revision: http://reviews.llvm.org/D19218
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266868 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
On OS X, internal_mmap just uses mmap, which can invoke callbacks into libmalloc (e.g. when MallocStackLogging is enabled). This can subsequently call other intercepted functions, and this breaks our Darwin-specific ThreadState initialization. Let's use direct syscalls in internal_mmap and internal_munmap. Added a testcase.
Differential Revision: http://reviews.llvm.org/D18431
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264259 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263698 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
On OS X 10.11+, we have "automatic interceptors", so we don't need to use DYLD_INSERT_LIBRARIES when launching instrumented programs. However, non-instrumented programs that load TSan late (e.g. via dlopen) are currently broken, as TSan will still try to initialize, but the program will crash/hang at random places (because the interceptors don't work). This patch adds an explicit check that interceptors are working, and if not, it aborts and prints out an error message suggesting to explicitly use DYLD_INSERT_LIBRARIES.
TSan unit tests run with a statically linked runtime, where interceptors don't work. To avoid aborting the process in this case, the patch replaces `DisableReexec()` with a weak `ReexecDisabled()` function which is defined to return true in unit tests.
Differential Revision: http://reviews.llvm.org/D18212
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263695 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263553 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
On OS X 10.11+, we have "automatic interceptors", so we don't need to use DYLD_INSERT_LIBRARIES when launching instrumented programs. However, non-instrumented programs that load TSan late (e.g. via dlopen) are currently broken, as TSan will still try to initialize, but the program will crash/hang at random places (because the interceptors don't work). This patch adds an explicit check that interceptors are working, and if not, it aborts and prints out an error message suggesting to explicitly use DYLD_INSERT_LIBRARIES.
Differential Revision: http://reviews.llvm.org/D18121
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263551 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
GetListOfModules().
Summary:
This removes the hard limit on the number of loaded modules (used to be
16K), and makes it easier to use LoadedModules w/o causing a memory
leak: ListOfModules owns the modules, and makes sure to properly clean
them in destructor.
Remove filtering functionality that is only needed in one place (LSan).
Reviewers: aizatsky
Subscribers: llvm-commits, kcc
Differential Revision: http://reviews.llvm.org/D17470
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261554 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260163 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
READ or a WRITE. This touches win/mac files which I have not tested, if a win/mac bot fails I'll try to quick-fix
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259741 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259451 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258874 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This reverts commit e5b34d5a2bf4c882bc647dd26a8cea2adc76f63c.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258713 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Differential Revision: http://reviews.llvm.org/D16542
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258710 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Differential Revision: http://reviews.llvm.org/D16070
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258037 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Log all of sanitizers' output (not just ASan bug reports) to CrashReport,
which simplifies diagnosing failed checks as well as other errors. This
also allows to strip the color sequences early from the printed buffer,
which is more efficient than what we had perviously.
Differential Revision: http://reviews.llvm.org/D15396
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256988 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254738 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
`MaybeReexec` contains a 1024-byte long local array, which produces a warning about frame size:
.../lib/sanitizer_common/sanitizer_mac.cc:548:6: warning: stack frame size of 1132 bytes in function '__sanitizer::MaybeReexec' [-Wframe-larger-than=]
Let's replace it with InternalScopedString.
Differential Revision: http://reviews.llvm.org/D15181
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254619 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
In AddressSanitizer, we have the MaybeReexec method to detect when we're running without DYLD_INSERT_LIBRARIES (in which case interceptors don't work) and re-execute with the environment variable set. On OS X 10.11+, this is no longer necessary, but to have ThreadSanitizer supported on older versions of OS X, let's use the same method as well. This patch moves the implementation from `asan/` into `sanitizer_common/`.
Differential Revision: http://reviews.llvm.org/D15123
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254600 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The Crash Report is going to add app specific info if it is stored in the magical buffer.
Differential Revision: http://reviews.llvm.org/D14791
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253691 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
os_trace" commit
[asan] On OS X, log reports to syslog and os_trace, has been reverted in r252076 due to deadlocks on earlier versions of OS X. Alexey has also noticed deadlocks in some corner cases on Linux. This patch, if applied on top of the logging patch (http://reviews.llvm.org/D13452), addresses the known deadlock issues.
(This also proactively removes the color escape sequences from the error report buffer since we have to copy the buffer anyway.)
Differential Revision: http://reviews.llvm.org/D14470
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253689 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
When ASan currently detects a bug, by default it will only print out the text
of the report to stderr. This patch changes this behavior and writes the full
text of the report to syslog before we terminate the process. It also calls
os_trace (Activity Tracing available on OS X and iOS) with a message saying
that the report is available in syslog. This is useful, because this message
will be shown in the crash log.
For this to work, the patch makes sure we store the full report into
error_message_buffer unconditionally, and it also strips out ANSI escape
sequences from the report (they are used when producing colored reports).
I've initially tried to log to syslog during printing, which is done on Android
right now. The advantage is that if we crash during error reporting or the
produced error does not go through ScopedInErrorReport, we would still get a
(partial) message in the syslog. However, that solution is very problematic on
OS X. One issue is that the logging routine uses GCD, which may spawn a new
thread on its behalf. In many cases, the reporting logic locks threadRegistry,
which leads to deadlocks.
Reviewed at http://reviews.llvm.org/D13452
(In addition, add sanitizer_common_libcdep.cc to buildgo.sh to avoid
build failures on Linux.)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253688 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
On Linux, we have internal_fork that forks without invoking user's pthread_atfork handlers, which is important for spawning external symbolizers. Let's implement this for OS X as well (using __fork). This patch also adds internal_forkpty which re-implements forkpty and uses __fork in it as well.
Differential Revision: http://reviews.llvm.org/D14869
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253666 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary: Depends on D9637
Test Plan:
Reviewers: kcc, glider, samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9638
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252696 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Looks like this commit is deadlocking the ASAN tests on the green dragon bot
(http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA/).
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252076 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
When ASan currently detects a bug, by default it will only print out the text
of the report to stderr. This patch changes this behavior and writes the full
text of the report to syslog before we terminate the process. It also calls
os_trace (Activity Tracing available on OS X and iOS) with a message saying
that the report is available in syslog. This is useful, because this message
will be shown in the crash log.
For this to work, the patch makes sure we store the full report into
error_message_buffer unconditionally, and it also strips out ANSI escape
sequences from the report (they are used when producing colored reports).
I've initially tried to log to syslog during printing, which is done on Android
right now. The advantage is that if we crash during error reporting or the
produced error does not go through ScopedInErrorReport, we would still get a
(partial) message in the syslog. However, that solution is very problematic on
OS X. One issue is that the logging routine uses GCD, which may spawn a new
thread on its behalf. In many cases, the reporting logic locks threadRegistry,
which leads to deadlocks.
Reviewed at http://reviews.llvm.org/D13452
(In addition, add sanitizer_common_libcdep.cc to buildgo.sh to avoid
build failures on Linux.)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251577 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This reverts commit 251447.
(Which caused failures on a Linux bot.)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251467 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
When ASan currently detects a bug, by default it will only print out the text
of the report to stderr. This patch changes this behavior and writes the full
text of the report to syslog before we terminate the process. It also calls
os_trace (Activity Tracing available on OS X and iOS) with a message saying
that the report is available in syslog. This is useful, because this message
will be shown in the crash log.
For this to work, the patch makes sure we store the full report into
error_message_buffer unconditionally, and it also strips out ANSI escape
sequences from the report (they are used when producing colored reports).
I've initially tried to log to syslog during printing, which is done on Android
right now. The advantage is that if we crash during error reporting or the
produced error does not go through ScopedInErrorReport, we would still get a
(partial) message in the syslog. However, that solution is very problematic on
OS X. One issue is that the logging routine uses GCD, which may spawn a new
thread on its behalf. In many cases, the reporting logic locks threadRegistry,
which leads to deadlocks.
Reviewed at http://reviews.llvm.org/D13452
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251447 91177308-0d34-0410-b5e6-96231b3b80d8
|