Commit Graph

3146 Commits

Author SHA1 Message Date
Dmitry Vyukov e63a09adb6 tsan: fix Go build
Go linker does not like function-static objects.

llvm-svn: 200534
2014-01-31 11:20:55 +00:00
Timur Iskhodzhanov 00aa75b774 Move /FS to SANITIZER_COMMON_CFLAGS
llvm-svn: 200485
2014-01-30 19:48:13 +00:00
Timur Iskhodzhanov 5b56093acc Quick-fix a typo
llvm-svn: 200483
2014-01-30 19:19:47 +00:00
Timur Iskhodzhanov 45849098eb Add an /FS flag to the lib/interception CMake to make it buildable with VS2013 too
llvm-svn: 200482
2014-01-30 19:19:29 +00:00
Timur Iskhodzhanov 272502656e Add an /FS flag to the sanitizer_common CMake to make it buildable with VS2013
llvm-svn: 200480
2014-01-30 18:56:06 +00:00
Joerg Sonnenberger dde2700cde Copy&paste errors. Found by Thomas Klausner.
llvm-svn: 200477
2014-01-30 18:41:32 +00:00
Timur Iskhodzhanov a1f31460d8 Add an /FS flag to the ASan RTL CMake to make it buildable with VS2013
llvm-svn: 200474
2014-01-30 18:08:41 +00:00
Evgeniy Stepanov 3f6af151df [sanitizer] Fix typo that breaks shmctl() interceptor.
https://code.google.com/p/address-sanitizer/issues/detail?id=259

llvm-svn: 200468
2014-01-30 14:31:26 +00:00
Sergey Matveev be68311660 [msan] Intercept *getxattr and *listxattr.
llvm-svn: 200464
2014-01-30 12:21:12 +00:00
Kostya Serebryany b22298af9a [asan] re-enable __tls_get_addr interceptor with a proper fix (use __attribute__((tls_model(initial-exec))))
llvm-svn: 200463
2014-01-30 09:25:48 +00:00
Kostya Serebryany 409d26ac5e [asan] disable __tls_get_addr interceptor while I am investigating why it causes trouble; few more debugging
llvm-svn: 200462
2014-01-30 09:00:42 +00:00
Joerg Sonnenberger ce0f2175d7 Support ARMv4 in the remaining non-VFP routines.
llvm-svn: 200397
2014-01-29 13:54:54 +00:00
Joerg Sonnenberger deeb8dc593 Move JMP/JMPc definition into assembly.h's ARM block.
llvm-svn: 200396
2014-01-29 13:54:16 +00:00
Joerg Sonnenberger d8f7fb94a7 Optimized implementation of __clzdi2 and __clzsi2 for ARM. Written in
collaboration with Matt Thomas.

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

llvm-svn: 200394
2014-01-29 13:46:28 +00:00
Kostya Serebryany 336d97146a [asan] increase the buffer size for printing asan legend, add a test for legend
llvm-svn: 200387
2014-01-29 11:12:09 +00:00
Kostya Serebryany cda06acd31 [asan] fix build on Mac (hopefully)
llvm-svn: 200386
2014-01-29 10:26:38 +00:00
Kostya Serebryany 71788fac2a [asan] experimental intercetor for __tls_get_addr. So far it does nothing interesting, actual usage will come later. See https://groups.google.com/forum/#!topic/address-sanitizer/BfwYD8HMxTM for background
llvm-svn: 200384
2014-01-29 09:29:16 +00:00
Evgeniy Stepanov 422944fdbd [asan] Fix asan_device_setup.sh failure on userdebug Android.
llvm-svn: 200382
2014-01-29 09:16:48 +00:00
Timur Iskhodzhanov 50672ac9cb Add support for more instruction prefixes so we can intercept functions in the VS2013 RTL
llvm-svn: 200366
2014-01-29 02:00:58 +00:00
Alexander Potapenko b0930f5c04 [ASan] Reinstate ASAN_LOW_MEMORY, which has nothing to do with signal handling and thus should not be moved to common.
llvm-svn: 200319
2014-01-28 14:17:16 +00:00
Alexander Potapenko 31e24962f4 [ASan] Remove an accidentally added include of signal.h
llvm-svn: 200318
2014-01-28 14:10:06 +00:00
Joerg Sonnenberger 05d8a22cf6 Cache invalidation for AARCH64. Disabled for Apple for now as requested
by Tim Northover. Written by Matt Thomas.

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

llvm-svn: 200317
2014-01-28 14:02:22 +00:00
Sergey Matveev 1394f2da85 [msan] Rewrite strto* interceptors and add a few more.
Express the strto* interceptors though macros. This removes a lot of
duplicate code and fixes a couple of copypasto bugs (where "res" was declared of
a different type than the actual return type). Also, add a few more interceptors
for strto*_l.

llvm-svn: 200316
2014-01-28 13:45:58 +00:00
Alexander Potapenko 77f5c20a5b [ASan] Fix compilation.
llvm-svn: 200312
2014-01-28 12:23:14 +00:00
Alexander Potapenko d8d490ed50 [ASan] Move the sigaltstack() bits to sanitizer_common.
This change is a part of refactoring intended to have common signal handling behavior in all tools.
Note that this particular change doesn't enable use_sigaltstack support in every tool.

llvm-svn: 200310
2014-01-28 11:12:29 +00:00
Dmitry Vyukov dc96a0fada tsan: remove interceptor stats
They seems to be unused, but cause maintenance pain.

llvm-svn: 200308
2014-01-28 11:02:04 +00:00
Dmitry Vyukov 7c9621c0be tsan: relax checking of errno spoiling in signal handlers
allow SIGABRT to spoil errno, because some real programs
reset SIGABRT handler in the handler, re-raise SIGABRT and return from the handler

llvm-svn: 200304
2014-01-28 09:49:48 +00:00
Alexander Potapenko cf4bef3161 [ASan] Move the signal handling-related flags to sanitizer_common.
This change is a part of refactoring intended to have common signal handling behavior in all tools.

llvm-svn: 200295
2014-01-28 09:28:57 +00:00
Evgeniy Stepanov 0b09c623c1 [msan] Replace assert() with GTest ASSERT_* in msan_test.
llvm-svn: 200293
2014-01-28 08:51:39 +00:00
Joerg Sonnenberger 92ce6e83fc Rename fabs to local_fabs to not conflict with the builtin.
llvm-svn: 200245
2014-01-27 20:09:03 +00:00
Kostya Serebryany 7fe86589f1 [sanitizer] revert r200197: the buggy kernel (https://bugzilla.kernel.org/show_bug.cgi?id=67651) is almost unusable with asan even with this workaround (too slow), so this workaround makes no sense. The asan/msan bootstrap bot was changed to use a non-buggy kernel
llvm-svn: 200217
2014-01-27 13:05:09 +00:00
Evgeniy Stepanov 067f54718f [msan] Disable mmap outside of application address range.
llvm-svn: 200200
2014-01-27 09:12:22 +00:00
Evgeniy Stepanov aecead9d4f [asan] Android setup: do "adb root" before "adb remount".
llvm-svn: 200199
2014-01-27 08:20:28 +00:00
Kostya Serebryany 0a5049b780 [sanitizer] increase the mmap granularity in sanitizer allocator from 2^16 to 2^18. This is a partial workaround for the fresh Kernel bug https://bugzilla.kernel.org/show_bug.cgi?id=67651
llvm-svn: 200197
2014-01-27 07:35:32 +00:00
Tim Northover 7449bda3d9 ARM: also remove useless .arm directive from other files
llvm-svn: 200044
2014-01-24 22:04:15 +00:00
Tim Northover 5386cae6b7 ARM: remove unnecessary .arm directive
It was redundant (since ARM mode is the default) and misleading since
(e.g.) Cortex-A15 would not satisfy the #ifdef but would be in ARM
mode regardless.

llvm-svn: 200043
2014-01-24 21:58:22 +00:00
Bob Wilson 1b39261990 Fix a typo "endi" -> "endif" in r200035.
llvm-svn: 200039
2014-01-24 21:04:05 +00:00
Joerg Sonnenberger 2fb149b901 Don't use .arm for ARMv7M, which will use the hwdiv path. Non-hwdiv
remains ARM mode only, supporting thumb requires explicit it prefixes
for the predicted adds/subs and adjusting the offset computation for the
different block sizes.

llvm-svn: 200035
2014-01-24 20:45:18 +00:00
Dmitry Vyukov 3ee32e7647 tsan: fix test for -O2
otherwise races are suppressed due to "same stack"

llvm-svn: 200015
2014-01-24 16:30:53 +00:00
Dmitry Vyukov 80240acd77 tsan: fix test for -O2
llvm-svn: 200012
2014-01-24 15:58:20 +00:00
Evgeniy Stepanov 9504304f2d [asan] Add an ASan-on-Android installation script.
llvm-svn: 200009
2014-01-24 15:24:24 +00:00
Joerg Sonnenberger db99eee490 Add end-of-function markers.
llvm-svn: 200007
2014-01-24 14:42:55 +00:00
Joerg Sonnenberger 2a10033ae7 Add end-of-function markers.
llvm-svn: 200006
2014-01-24 14:40:53 +00:00
Joerg Sonnenberger 171e9cfb0e Mechanically add end-of-function markers.
llvm-svn: 200005
2014-01-24 14:33:42 +00:00
Dmitry Vyukov 1b3862ab06 tsan: fix signal handling
We left ignore_interceptors>0 when calling signal handlers
from blocking interceptors, this leads to missing synchronization in such signal handler.

llvm-svn: 200003
2014-01-24 14:16:00 +00:00
Dmitry Vyukov 041510b290 tsan: fix test relying on assert
llvm-svn: 200002
2014-01-24 14:14:28 +00:00
Joerg Sonnenberger 59611a8b20 Provide support for ARMv4, lacking bx and clz. Unroll the
test-and-subtract loop and compute the initial block as address,
shaving off between 5% and 10% on Cortex A9 and 30%+ a Raspberry Pi.
Code written by Matt Thomas and Joerg Sonnenberger.

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

llvm-svn: 200001
2014-01-24 13:43:35 +00:00
Joerg Sonnenberger 1f8cb3ee67 Implement __ARM_ARCH if the compiler lacks it. Add feature tests for bx and clz.
llvm-svn: 199998
2014-01-24 13:39:51 +00:00
Tim Northover 5a8af3e136 Darwin: add x86_64h slice for Haswell.
llvm-svn: 199996
2014-01-24 13:10:55 +00:00
Dmitry Vyukov 16e7a758b0 tsan: do not deadlock on fork
Currently correct programs can deadlock after fork, because atomic operations and async-signal-safe calls are not async-signal-safe under tsan.
With this change:
- if a single-threaded program forks, the child continues running with verification enabled (the tsan background thread is recreated as well)
- if a multi-threaded program forks, then the child runs with verification disabled (memory accesses, atomic operations and interceptors are disabled); it's expected that it will exec soon anyway
- if the child tries to create more threads after multi-threaded fork, the program aborts with error message
- die_after_fork flag is added that allows to continue running, but all bets are off

http://llvm-reviews.chandlerc.com/D2614

llvm-svn: 199993
2014-01-24 12:33:35 +00:00