Commit Graph

829 Commits

Author SHA1 Message Date
Alexey Samsonov 4d520640ba [ASan] use write instead of puts in malloc hooks test for ASan, as puts calls malloc on Mac
llvm-svn: 162359
2012-08-22 13:32:37 +00:00
Alexey Samsonov a85b6b8154 [ASan] get rid of ASAN_USE_EXTERNAL_SYMBOLIZER compiler def in favor of __asan_set_symbolize_callback interface function. Now the user doesn't have to recompile ASan runtime to provide its own symbolizer
llvm-svn: 162358
2012-08-22 13:31:37 +00:00
Alexey Samsonov de17f86655 [ASan] make ASan malloc/free hooks weak interface functions, overridable by user. Now the user can control malloc/free hooks without recompiling ASan runtime
llvm-svn: 162355
2012-08-22 10:12:47 +00:00
Alexey Samsonov 9b4e440c44 [ASan] fix CMake build: make sure that all ASan runtimes are built at correct directory
llvm-svn: 162353
2012-08-22 09:19:32 +00:00
Alexey Samsonov 75e5fc3e57 [TSan] switch tsan to using InternalScopedBuffer from sanitizer_common
llvm-svn: 162351
2012-08-22 07:25:52 +00:00
Kostya Serebryany 68d9c9da40 [asan] fix mac build
llvm-svn: 162279
2012-08-21 14:43:36 +00:00
Kostya Serebryany 676bcdb838 [asan] run-time part of the initialization order checker. Patch by Reid Watson with some bits from kcc. The sub-pass is off by default for now. On simple tests it works fine.
llvm-svn: 162278
2012-08-21 14:10:25 +00:00
Alexey Samsonov b92488a549 [Sanitizer] implement internal_strcspn
llvm-svn: 162272
2012-08-21 09:26:26 +00:00
Kostya Serebryany 55b4dd314f [asan] update asan-rt to match the interface change in LLVm (r162268)
llvm-svn: 162269
2012-08-21 08:24:35 +00:00
Alexey Samsonov e6704ee109 [Sanitizer] define InternalScopedBuffer to replace large arrays on stack. It is defined analogous to similar class in tsan and should replace it.
llvm-svn: 162262
2012-08-21 08:13:37 +00:00
Kostya Serebryany 6b745b5281 [asan] fix lint
llvm-svn: 162258
2012-08-21 06:43:44 +00:00
Alexander Potapenko 02e6f03236 Dynamic interceptors for dispatch_async and dispatch_after.
llvm-svn: 162202
2012-08-20 11:59:26 +00:00
Alexander Potapenko 1233d558dc Minor refactoring: reduce code duplication by introducing a macro for dispatch_sync_f, dispatch_async_f, dispatch_barrier_async_f bodies.
llvm-svn: 162199
2012-08-20 09:25:10 +00:00
Alexander Potapenko 4a156c1b80 Fix a leftover #if defined(DYNAMIC_MAC_WRAPPERS).
llvm-svn: 162197
2012-08-20 08:49:49 +00:00
Dmitry Vyukov e59bed4e8a tsan: proper handling of linker initialized mutexes
llvm-svn: 162169
2012-08-18 11:49:00 +00:00
Dmitry Vyukov e2b5b5c4ac tsan: Non-executable stack for hand-coded assembly
llvm-svn: 162112
2012-08-17 18:05:28 +00:00
Alexander Potapenko dffbb3b330 Intercept siglongjmp and _longjmp under "#if ASAN_INTERCEPT_*"
llvm-svn: 162103
2012-08-17 16:27:38 +00:00
Alexander Potapenko 5f487de8a3 Fix lint warnings.
llvm-svn: 162092
2012-08-17 10:08:51 +00:00
Alexander Potapenko c62210e3ff Commit the source and CMake changes that will allow to build ASan runtime
as a shared library on Mac OS. This will provide an alternative to
mach_override.

llvm-svn: 162091
2012-08-17 09:00:08 +00:00
Dmitry Vyukov 9f143c5c5f tsan: improve Go report format + fix build
llvm-svn: 162042
2012-08-16 19:36:45 +00:00
Dmitry Vyukov 77196efb1e tsan: add flag to disable reporting of destruction of locked mutexes (some programs use that on a regular basis)
llvm-svn: 162024
2012-08-16 15:12:35 +00:00
Dmitry Vyukov 3482ec3bc8 tsan: better diagnostics for destroy of a locked mutex + a test
llvm-svn: 162022
2012-08-16 15:08:49 +00:00
Dmitry Vyukov 19ae9f3b2e tsan: support for linker initializer mutexes with static storage duration
llvm-svn: 162021
2012-08-16 14:21:09 +00:00
Dmitry Vyukov 5c45dab649 tsan: fix COMPAT shadow mapping once again
llvm-svn: 162020
2012-08-16 14:20:45 +00:00
Dmitry Vyukov 4723e6b1e5 tsan: implement RWLOCK annotations
llvm-svn: 162019
2012-08-16 13:29:41 +00:00
Dmitry Vyukov f77c6ea7ea tsan: fix COMPAT shadow mapping for new memory allocator
llvm-svn: 162018
2012-08-16 13:27:25 +00:00
Dmitry Vyukov 912f3bf279 tsan: refactor cur_thread() -> thr
llvm-svn: 162017
2012-08-16 13:26:54 +00:00
Dmitry Vyukov 1c0b3c6b84 tsan: store sync objects in memory block headers + delete them when the block is freed
llvm-svn: 161959
2012-08-15 17:27:20 +00:00
Dmitry Vyukov 9f1509fe44 tsan: provide function that imitates write to a region but does not detect races
llvm-svn: 161957
2012-08-15 16:52:19 +00:00
Alexander Potapenko cfb2a6b074 Remove the extra semicolon reported by the buildbot.
llvm-svn: 161954
2012-08-15 15:59:18 +00:00
Dmitry Vyukov 954fc8c3e4 tsan: switch to new allocator
llvm-svn: 161953
2012-08-15 15:35:15 +00:00
Alexander Potapenko f6344ffe39 Introduce asan_intercepted_functions.h which contains the declarations wrapped functions and their wrappers.
Those declarations are going to be shared between asan_interceptors.cc and the dynamic runtime library on Mac OS.

llvm-svn: 161952
2012-08-15 15:24:48 +00:00
Alexey Samsonov 5b2c6ea38f [ASan] lit tests: use nm instead of llvm-nm, until llvm-nm becomes usable on Mac. Port output test change in r161948 to lit
llvm-svn: 161951
2012-08-15 14:33:30 +00:00
Dmitry Vyukov 4b5ec3145a tsan: add some more tests for memory allocator
llvm-svn: 161950
2012-08-15 14:25:33 +00:00
Dmitry Vyukov c693689bb1 tsan: fix several integer overflows
llvm-svn: 161949
2012-08-15 14:25:08 +00:00
Alexander Potapenko 6c1de8faa7 Check for filenames and numbers to detect possible problems with asan_symbolize.py on -fPIE binaries.
llvm-svn: 161948
2012-08-15 14:00:09 +00:00
Alexander Potapenko 1800362758 Pass offset of the frame address within the binary to addr2line instead of the absolute address.
Fixes the problem with -PIE binaries.

llvm-svn: 161947
2012-08-15 13:58:24 +00:00
Alexander Potapenko 07ea07c3ca Patch the frame address regardless of the frame number.
llvm-svn: 161946
2012-08-15 13:23:03 +00:00
Alexander Potapenko 20f9fcc285 Move the prototype of __CFInitialize to asan_mac.h so that asan_malloc_mac.cc may use it in the dynamic library mode.
llvm-svn: 161945
2012-08-15 12:23:36 +00:00
Alexander Potapenko 9a168a7405 Use SANITIZER_INTERFACE_ATTRIBUTE instead of __attribute__((visibility("default")))
Export CheckFailed, asan_malloc, asan_free, asan_memalign, AsanStackTrace::CompressStack, AsanStackTrace::UncompressStack from the dynamic runtime library.

llvm-svn: 161943
2012-08-15 11:57:52 +00:00
Alexander Potapenko 55df945db2 Make __asan::asan_{malloc,free,memalign} globally visible, so that the dynamic version of the runtime will export them.
llvm-svn: 161942
2012-08-15 11:32:15 +00:00
Alexey Samsonov 9fe914b099 [ASan] Port (the last one) tricky interface_test to lit, and a *huge* chunks of boilerplate to run tests for 32/64 bits and all optimization levels. Alas, lit doesn't support for loops in RUN-lines...
llvm-svn: 161941
2012-08-15 11:26:57 +00:00
Alexander Potapenko 81a1ec8ea6 Do not attempt to intercept mlock and friends on Windows.
llvm-svn: 161939
2012-08-15 09:46:45 +00:00
Alexander Potapenko 785f8bc4ec Use the common interception machinery for mlock/munlock/mlockall/munlockall.
llvm-svn: 161938
2012-08-15 09:22:57 +00:00
Alexey Samsonov 0e056762ef [ASan] use clangxx_asan instead of clang_asan for C++ lit tests
llvm-svn: 161936
2012-08-15 08:54:14 +00:00
Alexey Samsonov 6016486a16 [ASan] port remaining output and feature tests to lit. TODO: we should in fact run most of the tests for 32/64 bits and for all optimization levels
llvm-svn: 161935
2012-08-15 08:29:17 +00:00
Alexey Samsonov 5717f4c1eb [ASan] port interception and shared library tests to lit
llvm-svn: 161933
2012-08-15 07:13:51 +00:00
Alexey Samsonov 682a07cbe1 [ASan] move declaration of __asan_default_options to interface header
llvm-svn: 161932
2012-08-15 07:11:14 +00:00
Kostya Serebryany ad855e9438 [asan] better diagnostics for mmap failure
llvm-svn: 161874
2012-08-14 15:18:40 +00:00
Alexey Samsonov 517842b2fc [ASan] make sure __asan_default_options symbol is exported
llvm-svn: 161873
2012-08-14 15:03:24 +00:00