Timur Iskhodzhanov
dc8caada51
[ASan/Win] Add /DEBUG to the MD RTL link flags
...
llvm-svn: 216387
2014-08-25 16:45:53 +00:00
Timur Iskhodzhanov
2311f4dfaa
[ASan] Replace CMake if/APPEND/endif with append_if
...
llvm-svn: 216386
2014-08-25 16:40:39 +00:00
Timur Iskhodzhanov
0a88b25c43
[ASan/Win] Intercept memory allocation functions in the MD CRT
...
llvm-svn: 216382
2014-08-25 13:19:05 +00:00
Timur Iskhodzhanov
ea3ce790dc
[ASan] Rename the ASan dynamic RT
...
Reviewed at http://reviews.llvm.org/D5026
llvm-svn: 216380
2014-08-25 11:44:06 +00:00
Alexey Samsonov
2ccbc621df
[UBSan] Add support for printing backtraces to all UBSan handlers
...
llvm-svn: 216289
2014-08-22 21:42:04 +00:00
Alexander Potapenko
ea2402ebf4
[ubsan] Follow-up for r216263: fix the expected line number.
...
llvm-svn: 216266
2014-08-22 12:44:16 +00:00
Timur Iskhodzhanov
220ddacf8d
[ASan/Win] Land the trivial bits of -MD RTL support (PR20214)
...
llvm-svn: 216265
2014-08-22 12:38:07 +00:00
Timur Iskhodzhanov
f2d24473fe
[ASan] Use check_library_exists to determine if libc/libstdc++ are available
...
llvm-svn: 216264
2014-08-22 12:26:34 +00:00
Alexander Potapenko
66ae9712c5
[ubsan] Do not run Function/function.cpp on Darwin where -fsanitize=function is not supported.
...
llvm-svn: 216263
2014-08-22 11:09:10 +00:00
Alexander Potapenko
373863d31e
Follow-up for r215436: use SIZE_T for strlen and wcslen interceptors.
...
llvm-svn: 216184
2014-08-21 16:12:46 +00:00
Timur Iskhodzhanov
a14ef30443
[ASan] Turns out we should always intercept __cxa_throw
...
At least check-asan works with this change.
If the change breaks anything, we'll need to add:
a) a comment describing why we have to use INTERCEPT_FUNCTION rather than
ASAN_INTERCEPT_FUNC
and
b) a test case.
llvm-svn: 216177
2014-08-21 13:33:39 +00:00
Alexey Samsonov
6d2022b2e0
Fix latent bug in try_compile macro and use CMAKE_EXE_LINKER_FLAGS
...
when testing for supported architectures, as suggested by Andy Gibbs.
llvm-svn: 216083
2014-08-20 17:12:58 +00:00
Peter Collingbourne
82ff058cf9
DFSan's set label function should avoid writing to the shadow memory when the write would not change the value in memory.
...
When writing a label to shadow memory, don't write if the value is already set to the value being written. This dramatically reduces real memory consumption in programs with sparse use of labels.
Test Plan: It would be nice to test that unnecessary writes are skipped, but I do not see how a unit test could do this.
Patch by Sam Kerner!
Differential Revision: http://reviews.llvm.org/D4894
llvm-svn: 215961
2014-08-19 01:47:33 +00:00
Alexey Samsonov
2e39027931
[LSan] Parse common flags from LSAN_OPTIONS even if LSan is combined with
...
another sanitizer.
A user may run both LSan and LSan+ASan. It is weird to pass path to leak
suppression file (or other common sanitizer flags, like "verbosity") in
"LSAN_OPTIONS" in the first case and in "ASAN_OPTIONS" in the second case.
llvm-svn: 215949
2014-08-18 23:39:47 +00:00
Alexey Samsonov
00c02b297a
Add regression test for PR15823
...
llvm-svn: 215941
2014-08-18 22:11:14 +00:00
Alexey Samsonov
591d15272e
[TSan] Add -lpthread to the test which uses pthread_ functions
...
llvm-svn: 215939
2014-08-18 22:09:17 +00:00
Justin Bogner
8da47ac82e
profile: Improve error messages on bad GCDA files
...
llvm-svn: 215933
2014-08-18 20:47:32 +00:00
Hans Wennborg
4834653872
sanitizer_printf.cc: guard the va_copy hack on _MSC_VER
...
llvm-svn: 215932
2014-08-18 20:23:16 +00:00
Hans Wennborg
a2d4b09a55
Revert "[ASan/Win] Remove a hack that seems not to be required with VS2013 anymore" (r215708)
...
This is still needed for VS2012.
llvm-svn: 215930
2014-08-18 19:55:35 +00:00
Alexey Samsonov
cd21e2f7e4
[TSan] Initialize flags as early as possible. Disables back coredump, accidentally enabled in r215479. Add a test.
...
llvm-svn: 215763
2014-08-15 19:53:51 +00:00
Timur Iskhodzhanov
48e21c07c1
Follow-up to r215724: fix a lint warning
...
llvm-svn: 215725
2014-08-15 16:10:02 +00:00
Timur Iskhodzhanov
5c84264194
[ASan/Win] Introduce a new macro for malloc-like function attributes; also, clang-format the definitions of these functions
...
llvm-svn: 215724
2014-08-15 16:08:53 +00:00
Timur Iskhodzhanov
3e00116dc1
[ASan/Win] Remove one more reference to __interception::GetRealFunctionAddress (follow-up to r215707)
...
llvm-svn: 215722
2014-08-15 15:41:03 +00:00
Timur Iskhodzhanov
f8b1cd210d
[ASan/Win] We don't really need to use .CRT to call __asan_init when using -MD
...
llvm-svn: 215719
2014-08-15 14:44:17 +00:00
Timur Iskhodzhanov
cc01fad1d9
[ASan/Win] Remove a hack that seems not to be required with VS2013 anymore
...
llvm-svn: 215708
2014-08-15 13:45:23 +00:00
Timur Iskhodzhanov
750f1cf9e4
[ASan/Win] Remove old, unused and non-functional code that will be re-written soon
...
llvm-svn: 215707
2014-08-15 12:56:52 +00:00
Timur Iskhodzhanov
893beb96a2
[ASan/Win] Slightly update&relax test expectations to work with both -MT and -MD (in progress, PR20214) CRTs
...
llvm-svn: 215641
2014-08-14 13:11:39 +00:00
Timur Iskhodzhanov
7040f13639
[ASan/Win] Mark tests that require -MT asan_dll_thunk as such
...
llvm-svn: 215638
2014-08-14 13:02:51 +00:00
Dmitry Vyukov
5f86aaa27b
tsan: fix unaligned memory access routine
...
It was possimitically handling an aligned 8-byte access as 2 4-byte accesses.
llvm-svn: 215546
2014-08-13 13:20:23 +00:00
Alexey Samsonov
de443c5002
[UBSan] Add returns-nonnull sanitizer.
...
Summary:
This patch adds a runtime check verifying that functions
annotated with "returns_nonnull" attribute do in fact return nonnull pointers.
It is based on suggestion by Jakub Jelinek:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140623/223693.html .
Test Plan: regression test suite
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4849
llvm-svn: 215485
2014-08-13 00:26:40 +00:00
Alexey Samsonov
5a32f79af3
[MSan] Disable coredump for 64-bit binaries.
...
llvm-svn: 215482
2014-08-12 22:37:47 +00:00
Alexey Samsonov
34e2b280da
[TSan] Share the code the setup code calling getrlim/setrlim with sanitizer_common
...
llvm-svn: 215481
2014-08-12 22:31:19 +00:00
Alexey Samsonov
d2d2457823
[Sanitizer] Make disable_coredump a common flag and use it in TSan
...
llvm-svn: 215479
2014-08-12 22:07:48 +00:00
Alexey Samsonov
b9ec65cd4d
[Sanitizer] Kill deprecated allocator interfaces in ASan, MSan and TSan in favor of
...
a unified interface in <sanitizer/allocator_interface.h>.
llvm-svn: 215469
2014-08-12 20:28:20 +00:00
Hans Wennborg
a03feadeb2
Fix the CMake build when setting MACOSX_DEPLOYMENT_TARGET
...
If we don't reset CMAKE_OSX_DEPLOYMENT_TARGET, it will end up in
CFLAGS together with the -mmacosx-version-min that we set,
and the compiler errors about the conflict.
llvm-svn: 215468
2014-08-12 20:03:33 +00:00
Timur Iskhodzhanov
6963686c47
[ASan] Use more appropriate return types for strlen/wcslen to avoid MSVC warnings
...
llvm-svn: 215436
2014-08-12 11:02:53 +00:00
Timur Iskhodzhanov
de1718d355
[ASan/Win] Fix PR18987: warning about overriding '/MD' with '/MT'
...
llvm-svn: 215435
2014-08-12 09:44:56 +00:00
Alexey Samsonov
968a358974
[ASan] Add new options for asan_symbolize.py script.
...
The patch adds new features in asan-symbolizer script which are helpful for using ASan on embedded systems:
1) add cross-compile prefix for binutils
2) define path to sysroot with sanitized binaries
Features are enabled by command line options.
The patch also extends command line interface with help option.
Reviewed in http://reviews.llvm.org/D4703 .
Patch by Maria Guseva!
llvm-svn: 215381
2014-08-11 20:02:49 +00:00
Alexey Samsonov
266ba5586d
Fix build on some architectures caused by r215247.
...
llvm-svn: 215380
2014-08-11 19:57:56 +00:00
Saleem Abdulrasool
a0d65971d4
builtins: add signature to some assembly routines
...
Add a helpful description and a signature for the functions implemented in
assembly for the integral math routines. NFC.
llvm-svn: 215296
2014-08-09 20:17:43 +00:00
Saleem Abdulrasool
6063983c30
builtins: correct __umodsi3, __udivsi3 on ARM
...
When building the builtins for a modern CPU (idiv support), __umodsi3 was
completely incorrect as it would behave as __udivmosi3, which takes a tertiary
parameter which is a pointer.
__udivsi3 was also incorrect, returning the remainder in r1. Although this
would not result in any crash or invalid behaviour as r1 is a caller saved
register in AAPCS, this is unnecessary. Simply perform the division ignoring
the remainder.
llvm-svn: 215295
2014-08-09 20:17:37 +00:00
Alexey Samsonov
408d2152c4
Fixup Android tests build rules
...
llvm-svn: 215264
2014-08-09 00:23:11 +00:00
Alexey Samsonov
68b9e74592
[CMake] Determine which compiler-rt libraries are supported on
...
a given platform in a top-level CMakeLists.txt to use it both
in lib/ and in test/ subdirectories. Move architecture/platform
checks to config-ix.
llvm-svn: 215247
2014-08-08 22:01:20 +00:00
Timur Iskhodzhanov
255958391d
[ASan/Win] Print out a big warning and continue without checking for success if SymInitialize() fails
...
llvm-svn: 215203
2014-08-08 13:25:55 +00:00
Viktor Kutuzov
7a27160780
Support getting process maps for sanitizers needs on FreeBSD in 32-bit mode
...
Differential Revision: http://reviews.llvm.org/D4807
llvm-svn: 215185
2014-08-08 06:21:09 +00:00
Evgeniy Stepanov
f5c1f8ac84
[sanitizer] Intercept timerfd_settime, timerfd_gettime.
...
llvm-svn: 215112
2014-08-07 14:21:42 +00:00
Evgeniy Stepanov
37e069c2ac
[msan] Fix fcvt interceptor.
...
fcvt() result can be heap-allocated and must be unpoisoned.
llvm-svn: 215106
2014-08-07 12:45:55 +00:00
Viktor Kutuzov
c68a37c531
Add FreeBSD support to the address sanitizer's malloc_context_size.cc test case
...
Differential Revision: http://reviews.llvm.org/D4665
llvm-svn: 215081
2014-08-07 04:58:41 +00:00
Alexey Samsonov
71b471fa09
[TSan] Try to fix Go runtime build
...
llvm-svn: 215000
2014-08-06 23:13:23 +00:00
Viktor Kutuzov
a37ad099e8
Segregate FreeBSD-specific parts from sanitizer_procmaps_linux.cc
...
Differential Revision: http://reviews.llvm.org/D4555
llvm-svn: 214955
2014-08-06 10:16:52 +00:00