Commit Graph

1203 Commits

Author SHA1 Message Date
Evgeniy Stepanov 3e29c6bf22 [asan] Fix OSX tests.
llvm-svn: 195250
2013-11-20 14:21:56 +00:00
Evgeniy Stepanov 115ef14548 [asan] Test that LargeAllocator unpoisons memory before releasing it to the OS.
llvm-svn: 195243
2013-11-20 12:49:53 +00:00
Kostya Serebryany 3771a3dd73 [asan] remove a fixed FIXME; extend the comment around __sanitizer_annotate_contiguous_container
llvm-svn: 195131
2013-11-19 14:54:14 +00:00
Kostya Serebryany 7b664299f0 [asan] new shadow poison magic for contiguous-container-buffer-overflow, addressed Alexey Samsonov's comments for r195011
llvm-svn: 195117
2013-11-19 08:40:07 +00:00
Alexey Samsonov 59243333de [ASan] Run one of UAS tests in UAR mode as well
llvm-svn: 195015
2013-11-18 14:54:50 +00:00
Kostya Serebryany 60ecf38133 [asan] fix Windows build
llvm-svn: 195012
2013-11-18 14:26:13 +00:00
Kostya Serebryany 3d97c2040d [asan] introduce __sanitizer_annotate_contiguous_container
llvm-svn: 195011
2013-11-18 14:02:05 +00:00
Kostya Serebryany a92b07d684 [asan] support __hppa__ (by John David Anglin)
llvm-svn: 194995
2013-11-18 08:20:13 +00:00
Alexey Samsonov 5d3fda728d CMake: don't build sanitizer runtimes on 64-bit Windows (it's unsupported for now)
llvm-svn: 194958
2013-11-17 10:12:23 +00:00
Alexey Samsonov a6e8322fb1 [Sanitizer] Make slow unwinder on Linux more robust
llvm-svn: 194805
2013-11-15 10:57:56 +00:00
Bob Wilson a08e9ac927 Reapply asan coverage changes 194702-194704.
I still don't know what is causing our bootstrapped LTO buildbots to fail,
but llvm r194701 seems to be OK and I can't imagine that these changes could
cause the problem.

llvm-svn: 194790
2013-11-15 07:18:15 +00:00
Bob Wilson abc91eacac Speculatively revert asan coverage changes 194702-194704.
Apple's bootstrapped LTO builds have been failing, and these changes (along
with llvm 194701) are the only things on the blamelist.  I will either reapply
these changes or help debug the problem, depending on whether this fixes the
buildbots.

llvm-svn: 194779
2013-11-15 03:26:28 +00:00
Dmitry Vyukov 2e7e5801a7 asan: disable pthread_setname_np interceptor
it does not work anyway and can cause significant slowdown

llvm-svn: 194711
2013-11-14 16:48:22 +00:00
Kostya Serebryany 91c52d9552 [asan] Poor man's coverage that works with ASan (compiler-rt part)
llvm-svn: 194702
2013-11-14 13:28:17 +00:00
Alexey Samsonov 003c4bfc42 [ASan] Introduce a top-level target to collect all ASan runtimes and deps
llvm-svn: 194696
2013-11-14 12:24:12 +00:00
Alexey Samsonov 498e5906ad [Sanitizer] Add print_summary runtime flag to disable error summaries (UBSan doesn't need them)
llvm-svn: 194685
2013-11-14 08:56:59 +00:00
Alexander Potapenko 0706e5dd36 [ASan] Remove the stale dependency on the Foundation framework from the dynamic ASan runtime.
llvm-svn: 194583
2013-11-13 15:52:39 +00:00
Alexey Samsonov 9ff4598225 [ASan] Do not rely on malloc context in allocator reports.
Invoke a fatal stack trace unwinder when ASan prints allocator-relevant
error reports (double-free, alloc-dealloc-mismatch, invalid-free).
Thus we'll be able to print complete stack trace even if allocation/free
stacks are not stored (malloc_context_size=0).

Based on the patch by Yuri Gribov!

llvm-svn: 194579
2013-11-13 14:46:58 +00:00
Alexey Samsonov 41f7c404c9 [ASan] Use new feature of FileCheck: provide multiple --check-prefix args
llvm-svn: 194578
2013-11-13 14:16:40 +00:00
Alexander Potapenko fa82ba91f9 [ASan] Don't call __asan_init() from certain interceptors on Darwin.
Fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58994, which hadn't
manifested in LLVM because libclang_rt.asan_osx_dynamic.dylib used to depend on
the Foundation framework.
Without that dependency some interceptors may be called from the system
libraries before libSystem_initializer() is called, which lead to assertion
failures in sanitizer_mac.cc (_NSGetEnviron() returns NULL).

To fix the problem we fall back to the original functions in the common
libsanitizer interceptors and the __cxa_atexit() interceptor on Darwin.

This patch also prints a better error message in the case _NSGetEnviron()
returns NULL.

llvm-svn: 194573
2013-11-13 13:34:53 +00:00
Kostya Serebryany 04a1767a2e [asan] fix a leak in tds (https://code.google.com/p/address-sanitizer/issues/detail?id=233)
llvm-svn: 194572
2013-11-13 13:27:44 +00:00
Alexey Samsonov 6345150992 [Sanitizer] Specify a default value for each common runtime flag
llvm-svn: 194479
2013-11-12 13:59:08 +00:00
Evgeniy Stepanov b69699eb58 [sanitizer] Warn if interception fails.
This includes a clang-format pass over common interceptors.

llvm-svn: 194372
2013-11-11 11:28:30 +00:00
Evgeniy Stepanov 987f59b5c3 [asan] Bypass pthread_attr_getdetachstate interceptor in compiler_rt code.
llvm-svn: 194369
2013-11-11 08:56:49 +00:00
Alexander Potapenko 49034e3c33 [ASan] Add CMake configs for libclang_rt.asan_iossim_dynamic.dylib
CMake changes to build the ASan runtime for the iOS simulator. This is a universal library targeting the same architectures as the OSX ASan runtime does, thus the iossim version can't live in the same universal libclang_rt.asan_osx_dynamic.dylib

The difference between the OSX and iossim builds is in the -mios-simulator-version-min and -ios_simulator_version_min flags that tell Clang to compile and link iossim code.

The iossim runtime can only be built on a machine with both Xcode and the iOS Simulator SDK installed. If xcodebuild -version -sdk iphonesimulator Path returns a nonempty path, it is used when compiling and linking the iossim runtime.

llvm-svn: 194199
2013-11-07 10:08:19 +00:00
Alexander Potapenko 10e316a68e [ASan] Use OS-specific matches in the malloc_context_size.cc lit test.
The top stack frames for operator new and operator delete are different on Linux and Darwin.

llvm-svn: 194150
2013-11-06 14:00:37 +00:00
Alexey Samsonov fead612a02 [ASan] Disable back init-order checker. Make strict_init_order imply check_initialization_order
llvm-svn: 194125
2013-11-06 04:27:09 +00:00
Alexey Samsonov b0bad7b3b8 [ASan] Make sure slow stack unwinder doesn't return empty stacks.
llvm-svn: 194107
2013-11-05 23:29:12 +00:00
Alexey Samsonov c5e1b16d0c [ASan] Kill use_stack_depot runtime flag and stack trace compression routines.
llvm-svn: 193868
2013-11-01 17:23:22 +00:00
Alexey Samsonov 5dc6cff06a [Sanitizer] Unify summary reporting across all sanitizers.
This change unifies the summary printing across sanitizers:
now each tool uses specific version of ReportErrorSummary() method,
which deals with symbolization of the top frame and formatting a
summary message. This change modifies the summary line for ASan+LSan mode:
now the summary mentions "AddressSanitizer" instead of "LeakSanitizer".

llvm-svn: 193864
2013-11-01 17:02:14 +00:00
Alexey Samsonov 4708c5912b Consistently use StackTrace::PrintStack in ASan, LSan and MSan
llvm-svn: 193834
2013-11-01 00:19:46 +00:00
Alexander Potapenko d29853564d [ASan] Make asan_symbolize.py fall back to ASAN_SYMBOLIZER_PATH (which is used when ASAN_OPTIONS=symbolize=1) if LLVM_SYMBOLIZER_PATH is empty.
llvm-svn: 193758
2013-10-31 16:08:09 +00:00
Alexey Samsonov 85cee41633 [ASan] Turn on (non-strict) initialization order checker by default for all ASan users
llvm-svn: 193729
2013-10-31 00:40:15 +00:00
Evgeniy Stepanov e8cd2fad0e [asan] Maybe fix test failures on lld bots.
llvm-svn: 193647
2013-10-29 20:06:12 +00:00
Evgeniy Stepanov 7d24620b6d [asan] Fix build.
llvm-svn: 193635
2013-10-29 18:29:39 +00:00
Evgeniy Stepanov 02839ced75 [sanitizer] Fix build warnings.
llvm-svn: 193634
2013-10-29 18:24:06 +00:00
Kostya Serebryany 2a9b70cb4c [asan] increase the max malloc size from 8Gb to 64Gb
llvm-svn: 193615
2013-10-29 15:16:54 +00:00
Dmitry Vyukov 3e8432ee6c tsan/asan: support pthread_setname_np to set thread names
llvm-svn: 193602
2013-10-29 10:30:39 +00:00
Alexey Samsonov a687d2593f [Sanitizer] Simplify StackTrace::PrintStack interface: prefer common flags to turn on/off the symbolization
llvm-svn: 193587
2013-10-29 05:31:25 +00:00
Alexey Samsonov 590fe110f9 [Sanitizer] Revert r193501 and properly fix r193448
llvm-svn: 193522
2013-10-28 16:31:39 +00:00
Dmitry Vyukov cf7259c094 asan/msan: separate different report blocks with new lines
this makes the reports consistent with tsan, and much more readable.

llvm-svn: 193520
2013-10-28 13:05:32 +00:00
Timur Iskhodzhanov a1d048acb7 Work around ASan/Win breakage by r193448
llvm-svn: 193501
2013-10-27 13:37:23 +00:00
Peter Collingbourne cbdea323ac Add a CMake option COMPILER_RT_DEBUG for building runtimes with full debug info.
Differential Revision: http://llvm-reviews.chandlerc.com/D1984

llvm-svn: 193449
2013-10-25 23:03:34 +00:00
Peter Collingbourne 791e65dcfb Overhaul the symbolizer interface.
This moves away from creating the symbolizer object and initializing the
external symbolizer as separate steps.  Those steps now always take place
together.

Sanitizers with a legacy requirement to specify their own symbolizer path
should use InitSymbolizer to initialize the symbolizer with the desired
path, and GetSymbolizer to access the symbolizer.  Sanitizers with no
such requirement (e.g. UBSan) can use GetOrInitSymbolizer with no need for
initialization.

The symbolizer interface has been made thread-safe (as far as I can
tell) by protecting its member functions with mutexes.

Finally, the symbolizer interface no longer relies on weak externals, the
introduction of which was probably a mistake on my part.

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

llvm-svn: 193448
2013-10-25 23:03:29 +00:00
Evgeniy Stepanov c2b6cb0747 [sanitizer] Intercept pthread_attr_get*.
llvm-svn: 193405
2013-10-25 13:01:31 +00:00
Peter Collingbourne 50cb32e614 Introduce an operator new for LowLevelAllocator, and convert most users to it.
llvm-svn: 193308
2013-10-24 06:23:39 +00:00
Alexey Samsonov 857e3ece9b [ASan] ASan can be combined with LSan and UBSan, so export symbol from them as well.
llvm-svn: 193245
2013-10-23 15:36:22 +00:00
Nick Lewycky d27d668342 Make sure ASan always emits an error summary if it reports an error.
llvm-svn: 193229
2013-10-23 06:19:04 +00:00
Peter Collingbourne 90a0876ae7 Runtime support for the indirect function call checker.
Differential Revision: http://llvm-reviews.chandlerc.com/D1339

llvm-svn: 193060
2013-10-20 21:29:46 +00:00
Kostya Serebryany 8bb5d60235 [asan] fix stack trace printing on Mac
llvm-svn: 192990
2013-10-18 17:46:43 +00:00