Commit Graph

3099 Commits

Author SHA1 Message Date
Peter Collingbourne 01b337dc2d [dfsan] Tweaks for the ABI list
- Add a bunch of glibc functions to the ABI list
- Group similar functions in the ABI

Patch by Lorenzo Martignoni!

Differential Revision: http://llvm-reviews.chandlerc.com/D2185

llvm-svn: 195110
2013-11-19 06:33:13 +00:00
Alexey Samsonov 59243333de [ASan] Run one of UAS tests in UAR mode as well
llvm-svn: 195015
2013-11-18 14:54:50 +00:00
Kostya Serebryany 60ecf38133 [asan] fix Windows build
llvm-svn: 195012
2013-11-18 14:26:13 +00:00
Kostya Serebryany 3d97c2040d [asan] introduce __sanitizer_annotate_contiguous_container
llvm-svn: 195011
2013-11-18 14:02:05 +00:00
Alexey Samsonov 1011fe6a6e CMake: make sure compiler-rt headers are copied to build tree if 'compilrer-rt' target is built
llvm-svn: 195002
2013-11-18 10:57:36 +00:00
Kostya Serebryany a92b07d684 [asan] support __hppa__ (by John David Anglin)
llvm-svn: 194995
2013-11-18 08:20:13 +00:00
Alexey Samsonov be9d20b7a9 [ASan] Build ASan on Windows only if MSVC is used
llvm-svn: 194963
2013-11-17 12:18:35 +00:00
Alexey Samsonov 5d3fda728d CMake: don't build sanitizer runtimes on 64-bit Windows (it's unsupported for now)
llvm-svn: 194958
2013-11-17 10:12:23 +00:00
Alexey Samsonov 4985d5274a [DFSan] Don't include public headers in dfsan runtime code
Summary:
Definitions we use in public sanitizer headers may
slightly conflict with the ones we use in private sanitizer runtimes.
Moreover, we generally forbid to include any system headers (like <stdint.h>)
in sanitizer runtime headers. This leads to inevitable duplication of selected
interface function declarations, but we decided to live with it.

Reviewers: pcc

Reviewed By: pcc

CC: kcc, llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2179

llvm-svn: 194955
2013-11-17 09:41:47 +00:00
Tim Northover 3ae5a369d8 Revert premature instructions to build __sync_fetch_*
My commits got a bit twisted when I was working on both embedded support and
__sync stuff on the same branch. Sorry about that.

llvm-svn: 194886
2013-11-15 23:26:29 +00:00
Tim Northover 084647d4c0 Add clang_darwin_embedded platform for embedded projects
This should build a separate set of embedded runtime libraries, supporting the
option product:

    {PIC, static} x { Hard-float, soft-float }

The emphasis is on ARM platforms (Cortex-M4F, Cortex-M3, Cortex-M0) but X86
variants are also built where possible.

rdar://problem/10817205

llvm-svn: 194873
2013-11-15 23:00:42 +00:00
Bob Wilson 99d8fa92c3 Remove #include of net/ip_mroute.h for SANITIZER_MAC.
This header has not been supported at all for the last 2 major OS X releases.
Removed its include and the capture of related symbols.

<rdar://problem/15303348>

llvm-svn: 194841
2013-11-15 19:13:08 +00:00
Dmitry Vyukov 4bbe6dc8a9 tsan: add support for robust mutexes
llvm-svn: 194823
2013-11-15 16:58:12 +00:00
Alexander Potapenko bf50fbfc21 [ASan] Add the configure+make rules for building the ASan runtime for iOS simulator.
llvm-svn: 194813
2013-11-15 13:13:01 +00:00
Kostya Serebryany b41503253b [asan] helper script to dump/merge coverage data
llvm-svn: 194809
2013-11-15 11:51:08 +00:00
Alexey Samsonov a6e8322fb1 [Sanitizer] Make slow unwinder on Linux more robust
llvm-svn: 194805
2013-11-15 10:57:56 +00:00
Dmitry Vyukov 0b76e408b4 tsan: add proper cfi directives to assembly code
this allows gdb to unwind through our hacky call

llvm-svn: 194803
2013-11-15 10:25:53 +00:00
Chandler Carruth 65fd238772 LLVM's GoogleTest copy has moved its source code back to the default
location, update this reference to reflect that.

llvm-svn: 194802
2013-11-15 10:21:15 +00:00
Alexey Samsonov 352d0e52f5 Don't build unsupported compiler-rt pieces on Windows
llvm-svn: 194796
2013-11-15 09:09:23 +00:00
Bob Wilson a08e9ac927 Reapply asan coverage changes 194702-194704.
I still don't know what is causing our bootstrapped LTO buildbots to fail,
but llvm r194701 seems to be OK and I can't imagine that these changes could
cause the problem.

llvm-svn: 194790
2013-11-15 07:18:15 +00:00
Bob Wilson abc91eacac Speculatively revert asan coverage changes 194702-194704.
Apple's bootstrapped LTO builds have been failing, and these changes (along
with llvm 194701) are the only things on the blamelist.  I will either reapply
these changes or help debug the problem, depending on whether this fixes the
buildbots.

llvm-svn: 194779
2013-11-15 03:26:28 +00:00
Dmitry Vyukov 2e7e5801a7 asan: disable pthread_setname_np interceptor
it does not work anyway and can cause significant slowdown

llvm-svn: 194711
2013-11-14 16:48:22 +00:00
Kostya Serebryany c46f281f83 [asan] unbreak dfsan, which includes sanitizer/common_interface_defs.h into internal sources (although it shoudn't)
llvm-svn: 194704
2013-11-14 13:44:43 +00:00
Kostya Serebryany 599f0c1309 [asan] disable CovDump on Windows for now (fails to compile)
llvm-svn: 194703
2013-11-14 13:37:54 +00:00
Kostya Serebryany 91c52d9552 [asan] Poor man's coverage that works with ASan (compiler-rt part)
llvm-svn: 194702
2013-11-14 13:28:17 +00:00
Evgeniy Stepanov 5912fa4c4b [msan] A test for r194697.
llvm-svn: 194699
2013-11-14 12:31:18 +00:00
Alexey Samsonov 164841036d [UBSan] Make sure ASan and UBSan interact properly by running each test from UBSan test suite with and without ASan
llvm-svn: 194698
2013-11-14 12:30:09 +00:00
Alexey Samsonov 003c4bfc42 [ASan] Introduce a top-level target to collect all ASan runtimes and deps
llvm-svn: 194696
2013-11-14 12:24:12 +00:00
Alexey Samsonov 84dbdc0d8e [UBSan] Update UBSan location rendering to match r194686
llvm-svn: 194687
2013-11-14 09:54:10 +00:00
Alexey Samsonov 4d369187ec [Sanitizer] Print symbolized stack frame using a single Printf() call.
This reduces the number of "write" syscalls performed to print a single
stack frame description, and makes sanitizer output less intermixed with
program output. Also, add a number of unit tests.

llvm-svn: 194686
2013-11-14 09:41:24 +00:00
Alexey Samsonov 498e5906ad [Sanitizer] Add print_summary runtime flag to disable error summaries (UBSan doesn't need them)
llvm-svn: 194685
2013-11-14 08:56:59 +00:00
Alexander Potapenko 0706e5dd36 [ASan] Remove the stale dependency on the Foundation framework from the dynamic ASan runtime.
llvm-svn: 194583
2013-11-13 15:52:39 +00:00
Alexey Samsonov cf6ac12e23 [Sanitizer] Use same PC threshold in slow unwinder on all platforms
llvm-svn: 194580
2013-11-13 15:20:10 +00:00
Alexey Samsonov 9ff4598225 [ASan] Do not rely on malloc context in allocator reports.
Invoke a fatal stack trace unwinder when ASan prints allocator-relevant
error reports (double-free, alloc-dealloc-mismatch, invalid-free).
Thus we'll be able to print complete stack trace even if allocation/free
stacks are not stored (malloc_context_size=0).

Based on the patch by Yuri Gribov!

llvm-svn: 194579
2013-11-13 14:46:58 +00:00
Alexey Samsonov 41f7c404c9 [ASan] Use new feature of FileCheck: provide multiple --check-prefix args
llvm-svn: 194578
2013-11-13 14:16:40 +00:00
Alexander Potapenko fa82ba91f9 [ASan] Don't call __asan_init() from certain interceptors on Darwin.
Fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58994, which hadn't
manifested in LLVM because libclang_rt.asan_osx_dynamic.dylib used to depend on
the Foundation framework.
Without that dependency some interceptors may be called from the system
libraries before libSystem_initializer() is called, which lead to assertion
failures in sanitizer_mac.cc (_NSGetEnviron() returns NULL).

To fix the problem we fall back to the original functions in the common
libsanitizer interceptors and the __cxa_atexit() interceptor on Darwin.

This patch also prints a better error message in the case _NSGetEnviron()
returns NULL.

llvm-svn: 194573
2013-11-13 13:34:53 +00:00
Kostya Serebryany 04a1767a2e [asan] fix a leak in tds (https://code.google.com/p/address-sanitizer/issues/detail?id=233)
llvm-svn: 194572
2013-11-13 13:27:44 +00:00
Yuchen Wu 61a1bfcd61 Added summary info to GCDAProfiling.
This function will be called by GCOVProfiling to write and update object
and program summaries to be read in by llvm-cov.

llvm-svn: 194499
2013-11-12 18:45:50 +00:00
Alexey Samsonov 6345150992 [Sanitizer] Specify a default value for each common runtime flag
llvm-svn: 194479
2013-11-12 13:59:08 +00:00
Evgeniy Stepanov 90e12a6cb2 [sanitizer] Avoid needless use of stringification (#symver) in INTERCEPT_FUNCTION_VER.
This is a workaround for clang-format bug (PR17874).

llvm-svn: 194468
2013-11-12 10:21:52 +00:00
Tim Northover 38a0cb5201 ARM: make assembly files compile Thumb2 with nop IT block.
ARM's UAL syntax allows the same assembly file to be compiled in both ARM and
Thumb mode. Conditional execution is handled by requiring the Thumb IT blocks,
but essentially ignoring them when compiling for ARM.

llvm-svn: 194429
2013-11-11 22:50:13 +00:00
Evgeniy Stepanov 5a29068b97 [msan] One more test for r194374.
llvm-svn: 194375
2013-11-11 13:38:24 +00:00
Evgeniy Stepanov b69699eb58 [sanitizer] Warn if interception fails.
This includes a clang-format pass over common interceptors.

llvm-svn: 194372
2013-11-11 11:28:30 +00:00
Evgeniy Stepanov bfdb9b2ec6 [msan] Sanity check for non-PIE.
llvm-svn: 194370
2013-11-11 09:27:20 +00:00
Evgeniy Stepanov 987f59b5c3 [asan] Bypass pthread_attr_getdetachstate interceptor in compiler_rt code.
llvm-svn: 194369
2013-11-11 08:56:49 +00:00
Timur Iskhodzhanov e87f5701bb Remove a FIXME now that I can't reproduce the problem
llvm-svn: 194331
2013-11-09 15:01:23 +00:00
Timur Iskhodzhanov 1f1c7ec400 [Sanitizers] Share some stack walking code between Windows and Linux
Reviewed at http://llvm-reviews.chandlerc.com/D2126

llvm-svn: 194326
2013-11-09 13:59:12 +00:00
Alexander Potapenko 49034e3c33 [ASan] Add CMake configs for libclang_rt.asan_iossim_dynamic.dylib
CMake changes to build the ASan runtime for the iOS simulator. This is a universal library targeting the same architectures as the OSX ASan runtime does, thus the iossim version can't live in the same universal libclang_rt.asan_osx_dynamic.dylib

The difference between the OSX and iossim builds is in the -mios-simulator-version-min and -ios_simulator_version_min flags that tell Clang to compile and link iossim code.

The iossim runtime can only be built on a machine with both Xcode and the iOS Simulator SDK installed. If xcodebuild -version -sdk iphonesimulator Path returns a nonempty path, it is used when compiling and linking the iossim runtime.

llvm-svn: 194199
2013-11-07 10:08:19 +00:00
Alexey Samsonov b3d939902a [Sanitizer] Make StackTrace::Unwind the only public way to unwind a stack trace.
llvm-svn: 194196
2013-11-07 07:28:33 +00:00
Alexey Samsonov 5d350b2ab6 [Sanitizer] Presumable fix stack trace unwinding on Windows
llvm-svn: 194195
2013-11-07 06:53:41 +00:00