Commit Graph

4373 Commits

Author SHA1 Message Date
Kostya Serebryany 94b6801839 [tsan] add a currently-failing test with a must-deadlock
llvm-svn: 212944
2014-07-14 14:27:21 +00:00
Timur Iskhodzhanov 9b8fa878ea [ASan] Fix a couple of nits in NULL deref tests
This is a follow-up to r212807

llvm-svn: 212943
2014-07-14 14:26:35 +00:00
Evgeniy Stepanov d73e7cc879 [sanitizer] Intercept getpass.
llvm-svn: 212937
2014-07-14 13:07:51 +00:00
Evgeniy Stepanov 465466e80c [msan] Stop demangling function name in the stack origin report.
This was done by calling __cxa_demangle directly, which is bad
when c++abi library is instrumented. The following line always
contains the demangled name (when running with a symbolizer) anyway.

llvm-svn: 212929
2014-07-14 09:35:27 +00:00
Evgeniy Stepanov 6c254aa70e [asan] Remove XFAIL:android from 2 newly passing tests.
Fixed in r212872.

llvm-svn: 212926
2014-07-14 08:54:10 +00:00
Alexey Samsonov 15c9669615 [ASan] Collect unmangled names of global variables in Clang to print them in error reports.
Currently ASan instrumentation pass creates a string with global name
for each instrumented global (to include global names in the error report). Global
name is already mangled at this point, and we may not be able to demangle it
at runtime (e.g. there is no __cxa_demangle on Android).

Instead, create a string with fully qualified global name in Clang, and pass it
to ASan instrumentation pass in llvm.asan.globals metadata. If there is no metadata
for some global, ASan will use the original algorithm.

This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=264.

llvm-svn: 212872
2014-07-12 00:42:52 +00:00
Alexey Samsonov ae9d59e8c4 [ASan] Improve ODR-violation error reports.
Demangle names of involved globals. Print a more consistent summary line.

llvm-svn: 212857
2014-07-11 23:34:26 +00:00
Kostya Serebryany 8e9a5b1899 [asan] fix x32 build, patch by H.J. Lu
llvm-svn: 212823
2014-07-11 15:22:45 +00:00
Timur Iskhodzhanov 03f1e408de [ASan/Win] Don't apply dllexport to __asan_init in the DLL thunk
This fixes '___asan_init_v4 already defined' errors when linking some of Chromium DLLs.
Looks like one of the DLL is using a .lib produced while linking another DLL and it exploded after r212699.
I'm trying to come up with a small testcase...

llvm-svn: 212815
2014-07-11 13:46:05 +00:00
Timur Iskhodzhanov f6827cef73 [ASan] Print register values in a consistent way
llvm-svn: 212809
2014-07-11 12:14:46 +00:00
Timur Iskhodzhanov 19853dd28c [ASan/Win] Catch NULL derefs and page faults
Reviewed at http://reviews.llvm.org/D4471

llvm-svn: 212807
2014-07-11 11:57:41 +00:00
Evgeniy Stepanov 9c62621c4b [msan] A comment for the chained-origin-depot hash function.
llvm-svn: 212801
2014-07-11 09:09:37 +00:00
Evgeniy Stepanov db298121e0 [msan] Use real memset/memcpy/memmove in interceptors.
Our versions are not exactly as fast as libc's, and
MSan uses them heavily (even compared to other sanitizers).

This will break if libc version of mem* are instrumented,
but they never are, and if they are, we should be able
to fix it on libc side.

llvm-svn: 212799
2014-07-11 08:57:57 +00:00
Evgeniy Stepanov 23e8dfd487 [msan] Make one test case less brittle.
llvm-svn: 212798
2014-07-11 08:47:51 +00:00
Diego Novillo 89360191c8 Fix expected column numbers in two tests.
This is a minor fix to two tsan tests that were expecting the wrong
column information. Now that clang emits column information by default
in its debugging output, the tests had started failing.

llvm-svn: 212779
2014-07-10 23:29:10 +00:00
Alexey Samsonov 3a2cb3ad41 [TSan] Fix a bug in libcxx-tsan build conditions spotted by Ryuta Suzuki
llvm-svn: 212749
2014-07-10 18:17:51 +00:00
Evgeniy Stepanov 8fc7e1fb13 [msan] Fix performance issue in fast_memset.
Fast path was never triggered when called from __msan_poison.

llvm-svn: 212715
2014-07-10 12:45:56 +00:00
Evgeniy Stepanov c2c435f95d [msan] Switch chained origins hash to murmur2.
llvm-svn: 212704
2014-07-10 11:02:33 +00:00
Timur Iskhodzhanov 3eb1f4bb90 [ASan/Win] Don't hardcode ASan runtime version in ASan dll thunk
Reviewed at http://reviews.llvm.org/D4459

llvm-svn: 212699
2014-07-10 10:33:48 +00:00
Tim Northover 9775cffe14 MachO: add dummy armv6m architecture directory so clang_macho_embedded builds things.
Without some mention of armv6m in a subdirectory of builtins, the make code
doesn't even know that armv6m exists and is something it should be looking for
in the platform-specific Makefiles. This means that none of the functions
listed actually get built and we end up with an almost entirely empty
libclang_rt.a for armv6m.

Unfortunately, the assembly code in the usual arm directory has no hope of
running on armv6m, which only supports Thumb-1 (not even ARM mode), so adding
it there won't work. Realistically, we probably *will* want to put any
optimised versions in a separate directory, so creating it now is harmless.

rdar://problem/17613576

llvm-svn: 212696
2014-07-10 10:06:42 +00:00
Viktor Kutuzov f294f25d3a Make sanitizers' interceptors non-weak on FreeBSD
Differential Revision: http://reviews.llvm.org/D4418

llvm-svn: 212693
2014-07-10 09:16:58 +00:00
Viktor Kutuzov 794d4dde48 Only use fast stack unwinding for sanitizers failure reports on FreeBSD
Differential Revision: http://reviews.llvm.org/D4420

llvm-svn: 212691
2014-07-10 09:11:15 +00:00
Viktor Kutuzov d0907ae222 Fix getting environment variables for sanitizers needs on FreeBSD
Differential Revision: http://reviews.llvm.org/D4229

llvm-svn: 212690
2014-07-10 08:53:29 +00:00
Alexey Samsonov 84e0223a9d Fix configure+make build of profile runtime library
llvm-svn: 212665
2014-07-10 00:53:20 +00:00
Alexey Samsonov 020ac94665 [ASan] Force the compiler to generate frame pointer in certain Mac-specific interceptors.
Patch by Kuba Brecka!

llvm-svn: 212664
2014-07-10 00:06:53 +00:00
Alexey Samsonov f723794da8 [Sanitizer] Remove SANITIZER_NEEDS_SEGV from shared sanitizer_common headers.
Otherwise, it can be accidentally redefined when we build specific sanitizer
runtime. This definition should be provided only once - when we build
sanitizer_common library.

llvm-svn: 212663
2014-07-09 23:59:40 +00:00
Alexey Samsonov cd0a4aaba3 Don't check lint for SpecialCaseList.cpp
llvm-svn: 212642
2014-07-09 19:29:10 +00:00
Dmitry Vyukov 67ccf9851c tsan: reapply 212531 and 212532 with a fix
don't reset s->addr as well

llvm-svn: 212565
2014-07-08 20:37:16 +00:00
Alexey Samsonov 047ea1717b [TSan] Revert r212531 and r212532.
They cause "check-tsan" command to hang. Details in r212532 review thread.

llvm-svn: 212562
2014-07-08 20:17:19 +00:00
Dmitry Vyukov 3f5ad1a98e tsan: allow memory overlap in __tsan_java_move
JVM actually moves memory between overlapping ranges.

llvm-svn: 212560
2014-07-08 20:01:12 +00:00
Evgeniy Stepanov eb893a1fd6 [msan] Fix out of bounds access in origin copying.
llvm-svn: 212534
2014-07-08 14:15:23 +00:00
Kostya Serebryany 6136aae323 [tsan] Enable tsan's deadlock detector by default.
The tsan's deadlock detector has been used in Chromium for a while;
it found a few real bugs and reported no false positives.
So, it's time to give it a bit more exposure.

llvm-svn: 212533
2014-07-08 13:40:08 +00:00
Dmitry Vyukov edbb54d60c tsan: fix a potential hang
idx0 is not updated in the branch,
so if we take that branch idx0 will stay updated forever

llvm-svn: 212532
2014-07-08 13:36:59 +00:00
Dmitry Vyukov a480d3013a tsan: fix a bug in metamap
The bug happens in the following case:
Mutex is located at heap block beginning,
when we call MutexDestroy, s->next is set to 0,
so free can't find the MBlock related to the block.

llvm-svn: 212531
2014-07-08 13:28:01 +00:00
Kostya Serebryany 3d570b960e [tsan] fix deadlock detector's interoperation with java locks (https://code.google.com/p/thread-sanitizer/issues/detail?id=67)
llvm-svn: 212529
2014-07-08 13:16:03 +00:00
Dmitry Vyukov b0250948c6 tsan: remove unnecessary line split
llvm-svn: 212527
2014-07-08 13:07:23 +00:00
Kostya Serebryany 7e49b06446 [tsan] fix pthread_rwlock_tryrdlock interceptor, don't try to detect deadlocks when reporting bad unlock
llvm-svn: 212526
2014-07-08 12:46:30 +00:00
Viktor Kutuzov cc02abbb20 Support building floating-point facilities on FreeBSD 9.2 in 32-bit mode
Differential Revision: http://reviews.llvm.org/D3909

llvm-svn: 212518
2014-07-08 08:52:57 +00:00
Alexey Samsonov 1ce0929465 [MSan] Make one more test standalone
llvm-svn: 212487
2014-07-07 20:59:10 +00:00
Alexey Samsonov efe7828c69 [MSan] Use a single file for dso-origin test
llvm-svn: 212484
2014-07-07 20:37:12 +00:00
Alexey Samsonov c1856835d1 [Sanitizer] Move test for malloc/free hooks under test/sanitizer_common
llvm-svn: 212474
2014-07-07 18:47:29 +00:00
Alexey Samsonov 58a046fe56 [ASan] Clean up leftovers from assembly instrumentation helpers
llvm-svn: 212471
2014-07-07 18:11:24 +00:00
Alexey Samsonov 91bb8e0e3a Generalize sanitizer allocator public interface.
Introduce new public header <sanitizer/allocator_interface.h> and a set
of functions __sanitizer_get_ownership(), __sanitizer_malloc_hook() etc.
that will eventually replace their tool-specific equivalents
(__asan_get_ownership(), __msan_get_ownership() etc.). Tool-specific
functions are now deprecated and implemented as stubs redirecting
to __sanitizer_ versions (which are implemented differently in each tool).

Replace all uses of __xsan_ versions with __sanitizer_ versions in unit
and lit tests.

llvm-svn: 212469
2014-07-07 17:39:31 +00:00
Timur Iskhodzhanov 575180dbd2 [ASan/Win] Unbreak the build after r211216
llvm-svn: 212465
2014-07-07 16:22:04 +00:00
Evgeniy Stepanov 86c077b3a2 [asan] Remove runtime assembly helpers.
Remove helper functions that were used in assembly instrumentation.

Patch by Yuri Gorshenin.

llvm-svn: 212456
2014-07-07 13:59:12 +00:00
Evgeniy Stepanov f0831ee8d2 [msan] Increase hash table size for chained origins.
llvm-svn: 212448
2014-07-07 10:45:15 +00:00
Evgeniy Stepanov 037f77092e [msan] Better hash function for chained origins.
llvm-svn: 212440
2014-07-07 08:31:55 +00:00
Evgeniy Stepanov 50498e114f [msan] Reformat one source file.
llvm-svn: 212329
2014-07-04 10:07:39 +00:00
Kostya Serebryany 7c163a44aa [sanitizer] support c11 aligned_alloc, Linux only for now
llvm-svn: 212322
2014-07-04 07:30:34 +00:00
Evgeniy Stepanov 4af9c0ea80 [asan] i686-linux-android support.
Large part of this change is required due to
  https://code.google.com/p/android/issues/detail?id=61799
dlsym() crashes when symbol resolution fails, which means
we have to limit the interceptor list instead of relying on
runtime detection.

There are minor differencies in system headers, too.

llvm-svn: 212273
2014-07-03 14:20:56 +00:00