Commit Graph

1010 Commits

Author SHA1 Message Date
Kostya Serebryany 66a37f3aef [asan] one more fix for windows build
llvm-svn: 162762
2012-08-28 15:25:07 +00:00
Kostya Serebryany 3a6af66a0e [asan] fix the cmake build (hopefully)
llvm-svn: 162760
2012-08-28 14:48:28 +00:00
Kostya Serebryany 327d0a5666 [asan] actually doing 'svn add' helps
llvm-svn: 162759
2012-08-28 14:27:06 +00:00
Kostya Serebryany 27dcb2379f [asan] fix Windows build
llvm-svn: 162758
2012-08-28 14:14:30 +00:00
Kostya Serebryany 7575968aa4 [asan] actually move StackTrace to sanitizer_common
llvm-svn: 162757
2012-08-28 14:11:57 +00:00
Kostya Serebryany a57b4e823a [asan] even more refactoring to move StackTrace to sanitizer_common
llvm-svn: 162754
2012-08-28 13:49:49 +00:00
Kostya Serebryany ee92877f17 [asan] more refactoring to move StackTrace to sanitizer_common
llvm-svn: 162752
2012-08-28 13:25:55 +00:00
Alexey Samsonov 50e8a6a7df [ASan] CMake build: share more compile flags between instrumented and non-instrumented tests
llvm-svn: 162750
2012-08-28 12:38:17 +00:00
Kostya Serebryany ccc470c499 [asan] some renaming before we move StackTrace into sanitizer_common (part 2)
llvm-svn: 162748
2012-08-28 11:54:51 +00:00
Kostya Serebryany 6b0d775229 [asan] some renaming before we move StackTrace into sanitizer_common
llvm-svn: 162747
2012-08-28 11:54:30 +00:00
Kostya Serebryany bb6f165952 [asan] get rid of AsanPrintf in favor of Printf from sanitizer_common
llvm-svn: 162746
2012-08-28 11:34:40 +00:00
Kostya Serebryany 4bfe954d14 [asan] improve SetErrorReportCallbackTest to actually catch missing functionality in __asan_set_error_report_callback
llvm-svn: 162745
2012-08-28 11:21:01 +00:00
Alexey Samsonov 384de7c9c9 [Sanitizer] Allow to create stub MemoryMappingLayout on Windows
llvm-svn: 162742
2012-08-28 08:27:08 +00:00
Alexey Samsonov cae486c063 [Sanitizer] One more method stub for Windows
llvm-svn: 162739
2012-08-28 07:22:24 +00:00
Alexey Samsonov d1d1a814b7 [Sanitizer] align allocation sizes in low level allocator
llvm-svn: 162676
2012-08-27 14:51:36 +00:00
Evgeniy Stepanov f72f08affc CMake build rules for ASan/Android runtime.
llvm-svn: 162675
2012-08-27 14:28:27 +00:00
Alexey Samsonov 28d8be2d86 [Sanitizer] One more try to fix Windows build
llvm-svn: 162674
2012-08-27 14:08:53 +00:00
Alexey Samsonov e67a5dd8e1 [Sanitizer] Use low-level allocator in flag parsing to avoid calling malloc() before ASan/TSan initialization is done
llvm-svn: 162673
2012-08-27 14:04:54 +00:00
Alexey Samsonov cc62211fbf [Sanitizer] Rename ProcessMaps to MemoryMappingLayout and fix Windows build by providing stub implementation
llvm-svn: 162671
2012-08-27 13:48:48 +00:00
Alexey Samsonov c74289db2b [ASan] add missing build dependency on sanitizer_common headers
llvm-svn: 162670
2012-08-27 13:47:28 +00:00
Evgeniy Stepanov be01398612 A few tweaks for building ASanRT against Android NDK.
llvm-svn: 162666
2012-08-27 11:15:55 +00:00
Alexey Samsonov dc8d1f1039 [Sanitizer] move low-level (mmap-based) allocator to sanitizer_common
llvm-svn: 162663
2012-08-27 09:30:58 +00:00
Dmitry Vyukov 7d3d94454c tsan: improve memory allocator a bit
llvm-svn: 162561
2012-08-24 15:53:14 +00:00
Alexander Potapenko 00492cab3e Revert the erroneous changes made to Makefile.old in r162547
Remove a spare newline from asan_rtl.cc

llvm-svn: 162548
2012-08-24 09:31:53 +00:00
Alexander Potapenko fefc1e989c If the program is linked to a dynamic ASan runtime which is not present in DYLD_INSERT_LIBRARIES
(which, in turn, is required for our interceptors to take effect), re-exec the program with
DYLD_INSERT_LIBRARIES set.

llvm-svn: 162547
2012-08-24 09:22:05 +00:00
Alexander Potapenko d79d80b4a0 Add add_clang_runtime_shared_library() CMake function and use it to put the shared ASan runtime in the appropriate place.
llvm-svn: 162546
2012-08-24 07:49:22 +00:00
Dmitry Vyukov 0481ae4722 tsan: allow to override per-thread event trace size
useful if you don't see the second stack trace

llvm-svn: 162456
2012-08-23 18:26:03 +00:00
Dmitry Vyukov 7e6347402d tsan: fix new memory allocator
Deallocate: drain blocks to central cache if cached too much (instead of never drain).
Allocate: batch allocate fixed amount of blocks (instead of all blocks).
This significantly reduces memory consumption of large heavy-multithreaded programs.

llvm-svn: 162447
2012-08-23 17:16:07 +00:00
Alexey Samsonov 563fb4113c [Sanitizer] Add external symbolizer binary. Next steps - include it in CMake build (produce 32-bit and 64-bit version of it, make sure we can compile LLVM sources with our own flags) and add tests for it.
llvm-svn: 162442
2012-08-23 12:39:35 +00:00
Alexander Potapenko 2ebe619340 Re-implement the wrappers for libdispatch functions using blocks where appropriate
(kudos to Anna Zaks for a good example).
This simplifies the code much and lets us not implement internal parts of libdispatch.

All ASan tests from t32 and t64 should pass with the dylib runtime now.

llvm-svn: 162439
2012-08-23 09:34:40 +00:00
Alexey Samsonov 419f610a74 [Sanitizer] Switch the symbolization strategy that would be used by sanitizer tools family: as compiling in-process symbolizer into runtime involves certain difficulties, we may instead launch an external symbolizer program (fork + execl) in a subprocess and communicate with it via pipe.
llvm-svn: 162437
2012-08-23 07:32:06 +00:00
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