Commit Graph

3651 Commits

Author SHA1 Message Date
Dmitry Vyukov 512a18e518 tsan: add standalone deadlock detector
llvm-svn: 202505
2014-02-28 14:52:20 +00:00
Dmitry Vyukov 9cffc9550b tsan: allow to force use of __libc_malloc in sanitizer_common
llvm-svn: 202504
2014-02-28 14:46:53 +00:00
Dmitry Vyukov 7210cdd473 tsan: add include guards
llvm-svn: 202503
2014-02-28 14:46:05 +00:00
Dmitry Vyukov 811d16c953 tsan: prevent actual deadlock in deadlock detector test
llvm-svn: 202502
2014-02-28 14:34:25 +00:00
Kostya Serebryany eae464f911 [sanitizer] speedup deadlock detector for the case when we acquire the first lock in a thread
llvm-svn: 202492
2014-02-28 11:56:14 +00:00
Kostya Serebryany afc4f2af76 [sanitizer] speedup deadlock detector for the case when we destroy a mutex that has never been locked
llvm-svn: 202487
2014-02-28 10:59:33 +00:00
Dmitry Vyukov 6cfab724ec tsan: refactor deadlock detector
Introduce DDetector interface between the tool and the DD itself.
It will help to experiment with other DD implementation,
as well as reuse DD in other tools.

llvm-svn: 202485
2014-02-28 10:48:13 +00:00
Dmitry Vyukov 371639ea1f tsan: deflake test
llvm-svn: 202484
2014-02-28 10:47:07 +00:00
Kostya Serebryany 261993ad1a [sanitizer] a test for recursive rwlock and deadlock detector (currently fails)
llvm-svn: 202480
2014-02-28 10:03:51 +00:00
Kostya Serebryany b86b56c0db [tsan] one more test for deadlock detector
llvm-svn: 202476
2014-02-28 09:17:16 +00:00
Alexey Samsonov 6c282b4149 [CMake] Fix PR18987: discard /MD flag if we're adding /MT
llvm-svn: 202472
2014-02-28 08:04:30 +00:00
Dmitry Vyukov 6403c34c2a tsan: add new line at the end of error message
llvm-svn: 202470
2014-02-28 06:29:42 +00:00
Alexander Potapenko e8c311a40c [ASan] Make sure IOC_DIRMASK is undefined before redefining it.
llvm-svn: 202410
2014-02-27 16:46:06 +00:00
Dmitry Vyukov d8c2fbd57f tsan: another attempt to fix the tls_get_addr crash
llvm-svn: 202405
2014-02-27 15:07:45 +00:00
Dmitry Vyukov 46ebecc1fe tsan: work around known bug in libstdc++
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066

llvm-svn: 202403
2014-02-27 14:43:31 +00:00
Alexey Samsonov 247eb8e52e Rewrite compiler-rt.llvm.org to make it relevant
llvm-svn: 202402
2014-02-27 14:39:48 +00:00
Kostya Serebryany 2ff42d98fa [sanitizer] do not acquire a global mutex in deadlock detector when dealing with Unlock (it is essentially a thread-local operation)
llvm-svn: 202401
2014-02-27 14:38:42 +00:00
Dmitry Vyukov a12923e265 tsan: intercept vfork
this fixes obscure false positives
see the comments and the test for details

llvm-svn: 202400
2014-02-27 14:36:16 +00:00
Kostya Serebryany 796f6557bf [asan] *experimental* implementation of invalid-pointer-pair detector (finds when two unrelated pointers are compared or subtracted). This implementation has both false positives and false negatives and is not tuned for performance. A bug report for a proper implementation will follow.
llvm-svn: 202389
2014-02-27 12:45:36 +00:00
Timur Iskhodzhanov a0091be449 Add myself as a c-rt owner of ASan/Win
llvm-svn: 202380
2014-02-27 12:07:43 +00:00
Dmitry Vyukov 17ca4d06c7 tsan: 2 more deadlock detector benchmarks
llvm-svn: 202379
2014-02-27 12:05:17 +00:00
Alexey Samsonov 6482bfedf2 Fix Howard's e-mail
llvm-svn: 202378
2014-02-27 11:00:21 +00:00
Alexey Samsonov 929a3080e9 Add CODE_OWNERS.TXT
llvm-svn: 202377
2014-02-27 10:51:48 +00:00
Evgeniy Stepanov 037c271f41 [sanitizer] Fix iOS build.
llvm-svn: 202374
2014-02-27 10:09:21 +00:00
Dmitry Vyukov 8a0813d944 tsan: fix deadlock detector lit test output
llvm-svn: 202368
2014-02-27 09:18:08 +00:00
Dmitry Vyukov 511118c762 tsan: add another deadlock detector benchmark
llvm-svn: 202366
2014-02-27 09:05:07 +00:00
Dmitry Vyukov 6fd67f9c7a tsan: fix internal deadlock detector for external deadlock detector
we must go deeper!

llvm-svn: 202365
2014-02-27 09:02:58 +00:00
Evgeniy Stepanov a16f327c27 [sanitizer] Sizes and layouts for sanitizers on FreeBSD.
Patch by Viktor Kutuzov.

llvm-svn: 202364
2014-02-27 09:02:08 +00:00
Evgeniy Stepanov 322e89c4e2 [asan] Install asan_device_setup to bin/ when targetting Android.
asan_device_setup is a utility that prepares a device to run code built with
ASan. Essentially, it installs ASan runtime library into the system. For this
reason, it has to be at a predictable relative path from the runtime library
itself. We also plan to distribute this utility, packaged with runtime library
and maybe llvm-symbolizer, to the users.

llvm-svn: 202362
2014-02-27 08:41:40 +00:00
Dmitry Vyukov 794500ae4e tsan: add recursive deadlock detector benchmark
llvm-svn: 202361
2014-02-27 08:33:52 +00:00
Evgeniy Stepanov 6edfad4811 [asan] Don't disable SEGV handler on Android by default.
This is done mostly for consistency, because this setting is normally overridden in cmake.

llvm-svn: 202359
2014-02-27 08:23:00 +00:00
Dmitry Vyukov c546943b6a tsan: improve deadlock detector test
- allow to specify which test to run
- allow to specify number of iterations
- specify number of threads required in the test itself

llvm-svn: 202358
2014-02-27 08:04:20 +00:00
Alexey Samsonov 4cced3e19b [CMake] Make sure add_compiler_rt_resource_file doesn't do unnecessary work
llvm-svn: 202356
2014-02-27 07:22:59 +00:00
Alexey Samsonov 8c4c09786a Add accidentally removed -D
llvm-svn: 202355
2014-02-27 07:03:32 +00:00
Alexey Samsonov e3e2a11ad9 Move COMPILER_RT_HAS_FUNC check from r202303 to config-ix.cmake
llvm-svn: 202353
2014-02-27 06:52:41 +00:00
Reid Kleckner 0140ce483f Append -D__func__=__FUNCTION__ to SANITIZER_COMMON_CFLAGS
This way it gets picked up for all sanitizer libs, both sanitizer_common
and asan.  I believe those are the only libs that build with asan.
There should be no need to set the __func__ definition inside
clang_compile.

llvm-svn: 202303
2014-02-26 21:54:39 +00:00
Joerg Sonnenberger 3d7afbb945 Undef helper macros after using them.
llvm-svn: 202298
2014-02-26 20:38:24 +00:00
Joerg Sonnenberger 9d09e2fe90 Reapply r201910. MSVC gets __func__ defined explicitly, even though it
can't build anything here.

llvm-svn: 202297
2014-02-26 20:33:22 +00:00
Joerg Sonnenberger 2b41390c89 Emulate C99/C++11 __func__ for Visual C++.
llvm-svn: 202296
2014-02-26 20:31:17 +00:00
Dmitry Vyukov 0f34a3ba8c tsan: fix deadlock detector test so that it does not force contention in runtime
llvm-svn: 202278
2014-02-26 17:06:58 +00:00
Alexey Samsonov 14e061d7cc Support 'q' length modifier in scanf/printf interceptors
llvm-svn: 202268
2014-02-26 14:42:38 +00:00
Alexander Potapenko 4b1a7fe33a [ASan] Split interception-in-shared-lib-test.cc into two tests with platform-specific RUN commands.
Get rid of a TestCases/SharedLibs/shared-lib-test-so.cc dependency in these tests.

llvm-svn: 202267
2014-02-26 14:05:57 +00:00
Kostya Serebryany 78443cfda6 [asan] remove UB (comparison of two unrelated pointers) from a test
llvm-svn: 202266
2014-02-26 13:53:23 +00:00
Evgeniy Stepanov f4dcf77623 [asan] Fix printing of long reports to logcat on Android.
__android_log_write has an implicit message length limit.
Print one line at a time.

llvm-svn: 202250
2014-02-26 09:39:55 +00:00
Evgeniy Stepanov e23add20ae [sanitizer] Add a flag to enable/disable report colorization.
llvm-svn: 202249
2014-02-26 09:06:59 +00:00
Evgeniy Stepanov 3ff723f373 [asan] asan_device_setup: fix a typo in usage text
llvm-svn: 202246
2014-02-26 08:12:28 +00:00
Evgeniy Stepanov 84610ed7bf [asan] Remove .sh extension from asan_device_setup.
llvm-svn: 202245
2014-02-26 08:10:03 +00:00
Alexey Samsonov 10d0003a21 Revert r201783 until all FreeBSD fixes are submitted.
llvm-svn: 202244
2014-02-26 07:50:28 +00:00
NAKAMURA Takumi 9cd9ad6b9d [CMake] Introduce cmake_policy(CMP0022) for target_link_libraries(INTERFACE|PRIVATE).
For now, use both keywords, INTERFACE and PRIVATE via the variable,
  - ${cmake_2_8_12_INTERFACE}
  - ${cmake_2_8_12_PRIVATE}

They could be cleaned up when we introduce 2.8.12.

llvm-svn: 202239
2014-02-26 06:45:11 +00:00
Richard Trieu a170f08109 Remove 'tctx->name' from a logical statement since it is a pointer and always
is converted to a true value.  Detected by Clang's improved -Wbool-conversion

llvm-svn: 202223
2014-02-26 03:12:51 +00:00