Commit Graph

2868 Commits

Author SHA1 Message Date
Timur Iskhodzhanov 3fdabf8965 [ASan/Win] Add the first version of the RTL thunk that should be linked with instrumented DLLs
llvm-svn: 188267
2013-08-13 13:47:03 +00:00
Timur Iskhodzhanov dd052cedf8 Add a FIXME to check_lint
llvm-svn: 188266
2013-08-13 13:44:02 +00:00
Timur Iskhodzhanov 82a6647755 [*San/RTL] One more minor fix
llvm-svn: 188263
2013-08-13 12:16:43 +00:00
Timur Iskhodzhanov 45e82d12b0 [*San/RTL] Fix minor breakage
Grumbling: this hasn't been caught by running 'make check-{a,l,t}san check-sanitizer'
llvm-svn: 188262
2013-08-13 12:03:51 +00:00
Timur Iskhodzhanov eee13914e2 Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where SANITIZER_INTERFACE_ATTRIBUTE or SANITIZER_ATTRIBUTE_WEAK are used
llvm-svn: 188261
2013-08-13 11:42:45 +00:00
Peter Collingbourne da71ea2598 [dfsan] Remove the unused __dfsan_memcpy function.
Differential Revision: http://llvm-reviews.chandlerc.com/D1350

llvm-svn: 188238
2013-08-13 00:16:18 +00:00
Peter Collingbourne a3dc875198 [dfsan] Begin a private header and move shadow_for there.
Differential Revision: http://llvm-reviews.chandlerc.com/D1348

llvm-svn: 188231
2013-08-12 23:51:33 +00:00
Peter Collingbourne 21b2929aca [dfsan] Introduce dfsan_union runtime function.
Differential Revision: http://llvm-reviews.chandlerc.com/D1347

llvm-svn: 188229
2013-08-12 23:47:37 +00:00
Rui Ueyama 633ec6848b Add "CHECK-" prefix to un-break buildbot failure.
After r188221, the prefix given by --check-prefix must match with the label
as a whole. Substring is not considered to be a correct label anymore.

llvm-svn: 188227
2013-08-12 23:43:19 +00:00
Evgeniy Stepanov 64cace0687 [sanitizer] Intercept poll/ppoll.
llvm-svn: 188177
2013-08-12 13:19:53 +00:00
Evgeniy Stepanov 98c39a184e [sanitizer] Intercept getgroups.
llvm-svn: 188167
2013-08-12 11:01:40 +00:00
Daniel Dunbar beadec4afd [tests] Add one more lit rename update I missed.
llvm-svn: 188117
2013-08-09 22:23:23 +00:00
Daniel Dunbar bc5dbc435e [tests] Update to use lit_config and lit package, as appropriate.
llvm-svn: 188116
2013-08-09 22:14:01 +00:00
Evgeniy Stepanov 7f915cf8a5 [sanitizer] Fix handling of %n in scanf interceptor.
%n does not increase the input item count. The new code emits writes to %n
arguments even if it has run out of input items.

llvm-svn: 188069
2013-08-09 12:58:35 +00:00
Evgeniy Stepanov 3bf5439a9d [sanitizer] Limit scandir interceptor to Linux.
Implementation uses __thread not available on certain platforms.

llvm-svn: 187983
2013-08-08 14:04:36 +00:00
Evgeniy Stepanov 564215d949 [sanitizer] Intercept scandir/scandir64.
llvm-svn: 187982
2013-08-08 13:57:15 +00:00
Dmitry Vyukov 87bf47894c tsan: better diagnostics for invalid addresses passed to free()
llvm-svn: 187980
2013-08-08 13:47:50 +00:00
Evgeniy Stepanov 233455cba8 [sanitizer] Intercept strerror and strerror_r.
llvm-svn: 187978
2013-08-08 11:44:05 +00:00
Evgeniy Stepanov 7ea4795ed3 [sanitizer] ASan/MSan tests for r187967.
r187967: Disable inlining between sanitized and non-sanitized functions.
llvm-svn: 187971
2013-08-08 09:23:19 +00:00
Alexey Samsonov f49c076ff7 Simplify (and fix) check-dfsan configs
llvm-svn: 187968
2013-08-08 08:26:39 +00:00
Peter Collingbourne 5cbab07d02 DataFlowSanitizer; compiler-rt changes.
DataFlowSanitizer is a generalised dynamic data flow analysis.

Unlike other Sanitizer tools, this tool is not designed to detect a
specific class of bugs on its own.  Instead, it provides a generic
dynamic data flow analysis framework to be used by clients to help
detect application-specific issues within their own code.

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

llvm-svn: 187924
2013-08-07 22:47:26 +00:00
Alexander Potapenko 0443f1ac72 [TSan] Fix free_race.c by removing `not` from the test invocation that doesn't fail.
llvm-svn: 187889
2013-08-07 13:54:27 +00:00
Alexander Potapenko ce32410097 [TSan] Let the users suppress use-after-free errors using the "race:" suppressions.
If there's a race between a memory access and a free() call in the client program,
it can be reported as a use-after-free (if the access occurs after the free()) or an ordinary race
(if free() occurs after the access).
We've decided to use a single "race:" prefix for both cases instead of introducing a "use-after-free:" one,
because in many cases this allows us to keep a single suppression for both the use-after-free and free-after-use.

This may be misleading if the use-after-free occurs in a non-racy way (e.g. in a single-threaded program).
But normally such bugs shall not be suppressed.

llvm-svn: 187885
2013-08-07 12:39:00 +00:00
Alexey Samsonov f502fd75ab ASan: fix one more test case for pipefail
llvm-svn: 187881
2013-08-07 10:41:49 +00:00
Alexey Samsonov 15d5eefc65 Distinguish 32-bit ASan from 64-bit ASan in lit configs
llvm-svn: 187878
2013-08-07 09:31:28 +00:00
Alexey Samsonov 4431d2d566 Enable pipefail for ASan tests
llvm-svn: 187877
2013-08-07 09:14:30 +00:00
Evgeniy Stepanov 04b7bff1fe [sanitizer] Intercept sched_getaffinity.
Re-applying with a more reliable test case.

llvm-svn: 187876
2013-08-07 09:10:16 +00:00
Alexey Samsonov b6c8b3de70 Enable pipefail for TSan tests
llvm-svn: 187875
2013-08-07 09:02:37 +00:00
Alexey Samsonov fd078b9405 Enable pipefail for LSan tests
llvm-svn: 187873
2013-08-07 08:46:09 +00:00
David Blaikie 787e2b6499 Revert "[sanitizer] Intercept sched_getaffinity."
This reverts commit r187788.

The test case is unreliable (as the test may be run in a situation in
which it has no affinity with cpu0). This can be recommitted with a more
reliable test - possibly using CPU_COUNT != 0 instead (I wasn't entirely
sure that a process was guaranteed to have at least one affinity, though
it seems reasonable, or I'd have made the change myself).

llvm-svn: 187841
2013-08-07 00:37:26 +00:00
Alexander Potapenko 8c6cd93123 [libsanitizer] Drive-by fix for -Wempty-body in sanitizer_common_syscalls.inc
This makes the file consistently use { } around the if statements containing the PRE_/POST_ macros.

llvm-svn: 187797
2013-08-06 14:07:46 +00:00
Evgeniy Stepanov 03c0281a17 [sanitizer] Fix NULL arg handling in setitimer/getitimer interceptors.
llvm-svn: 187789
2013-08-06 09:54:33 +00:00
Evgeniy Stepanov 9f05e5e533 [sanitizer] Intercept sched_getaffinity.
llvm-svn: 187788
2013-08-06 09:29:01 +00:00
Alexey Samsonov b42ea7ef21 Lint fixes
llvm-svn: 187726
2013-08-05 13:20:39 +00:00
Evgeniy Stepanov 44b77c26e4 [msan] Allocator statistics interface and malloc hooks.
llvm-svn: 187653
2013-08-02 14:26:58 +00:00
Evgeniy Stepanov 90daaf9132 [msan] Fix unused function warning in the tests.
llvm-svn: 187648
2013-08-02 09:09:02 +00:00
Sergey Matveev 6459a370a7 [lsan] Add leak_check_at_exit flag.
We needed a way to tell LSan to invoke leak checking only if __do_leak_check()
is called explicitly. This can now be achieved by setting
leak_check_at_exit=false.

llvm-svn: 187578
2013-08-01 14:57:07 +00:00
Evgeniy Stepanov 5dbedf6c2a [msan] Intercept setenv, putenv.
llvm-svn: 187575
2013-08-01 11:14:14 +00:00
Evgeniy Stepanov 1ea380f693 [msan] Fix msan tests with pipefail option.
llvm-svn: 187485
2013-07-31 09:14:55 +00:00
Evgeniy Stepanov 3feb17c452 [sanitizer] Tweak read syscall handler signature for consistency.
llvm-svn: 187417
2013-07-30 13:16:52 +00:00
Evgeniy Stepanov 9fbd981f99 [sanitizer] read() syscall hook.
llvm-svn: 187414
2013-07-30 13:04:43 +00:00
Evgeniy Stepanov 807e131261 [msan] Intercept pthread_join.
llvm-svn: 187413
2013-07-30 12:54:34 +00:00
Evgeniy Stepanov da9fd25603 [msan] Intercept confstr.
llvm-svn: 187412
2013-07-30 12:46:59 +00:00
Evgeniy Stepanov d8a1798b47 [asan] Limit fake stack size to a reasonable value when running with unlimited stack.
llvm-svn: 187411
2013-07-30 11:50:26 +00:00
Evgeniy Stepanov f3e218a021 [asan] Raise thread stack size limit.
It's a sanity check, mostly, and we've seen threads with >256Mb stack.

llvm-svn: 187408
2013-07-30 09:01:18 +00:00
Evgeniy Stepanov 573ba3499e [sanitizer] Disable ForEachMappedRegion on Android.
It needs interface that is missing from the NDK, and it is not used on Android anyway.

llvm-svn: 187407
2013-07-30 08:39:16 +00:00
Peter Collingbourne e572e17a8e Fix warning.
llvm-svn: 187373
2013-07-29 20:13:41 +00:00
Peter Collingbourne 9058c07c95 Move UnpoisonMappedDSO to sanitizer_common.
This is so DFSan will be able to use it.

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

llvm-svn: 187372
2013-07-29 19:09:49 +00:00
Chandler Carruth d45abe12a6 Turn off pipefail on msan tests to match the other sanitizers until
someone can go through and update the RUN lines appropriately for the
new pipefail behavior.

llvm-svn: 187298
2013-07-27 10:30:39 +00:00
Rafael Espindola 3cf7eb50a9 Disable pipefail for lsan.
llvm-svn: 187274
2013-07-26 23:42:16 +00:00
Rafael Espindola f4fa0d8d9f disable pipefail for ubsan.
llvm-svn: 187273
2013-07-26 23:40:17 +00:00
Rafael Espindola 7bc3077afb Disable pipefail for ThreadSanitizer.
llvm-svn: 187272
2013-07-26 23:38:18 +00:00
Rafael Espindola 48e479291e disable pipefail on asan for now.
llvm-svn: 187269
2013-07-26 23:19:33 +00:00
Sergey Matveev 540338259d [sanitizer] Change strip_path_prefix flag behavior.
Previously (in tools other than TSan) the entire prefix of the path had to mach
the argument. With this change, only some suffix of the prefix has to match.
This is the same way this flag works in TSan.

llvm-svn: 186837
2013-07-22 16:14:38 +00:00
Sergey Matveev 9c012165ad [lsan] Make __lsan_do_leak_check() honor the detect_leaks flag.
Also move detect_leaks to common flags.

llvm-svn: 186821
2013-07-22 12:38:17 +00:00
Sergey Matveev 1ac4824841 [lsan] Print direct leaks first.
Direct leaks are higher priority, so it makes sense to have them on top.

llvm-svn: 186819
2013-07-22 11:18:32 +00:00
Hans Wennborg cb445d882e Fix another instance of -ccc-cxx vs. --driver-mode=g++
llvm-svn: 186609
2013-07-18 21:09:03 +00:00
Hans Wennborg 2e304b6ffd Use --driver-mode=g++ instead of -ccc-cxx; required after Clang r186605
llvm-svn: 186607
2013-07-18 20:48:50 +00:00
Sergey Matveev 655bd0d08c [lsan] Add __lsan_do_leak_check() to the public interface.
Let users override the normal behavior to run leak checking earlier in
the process. Also fix a couple nits here and there.

llvm-svn: 186581
2013-07-18 14:06:07 +00:00
Dmitry Vyukov e9c456e15f tsan: treat SIGSYS as synchronous signal
It is required for chromium sandboxing code.
From the description it seems to be indeed synchronous -- called back on syscall with incorrect arguments,
but seems to be unused in practice. So this should be fine.

llvm-svn: 186579
2013-07-18 13:14:11 +00:00
Alexey Samsonov 79d79da0e1 [ASan] Fix leaks in ASan tests found by LSan
llvm-svn: 186577
2013-07-18 12:59:52 +00:00
Alexey Samsonov 3122deb65c [Sanitizer] Always provide --default-arch argument to llvm-symbolizer
llvm-svn: 186513
2013-07-17 15:02:43 +00:00
Dmitry Vyukov c2e4e95580 tsan: disable one more interceptor that causes recursion
llvm-svn: 186497
2013-07-17 07:10:47 +00:00
Dmitry Vyukov 46cbc2ed50 tsan: fix unitialized read warning under newer gcc (it does not have visibility into asm)
llvm-svn: 186495
2013-07-17 06:56:47 +00:00
Anton Korobeynikov ec42bd9700 Give compiler-rt a chance to compile with mingw-w64.
Patch by C. Bergström!

llvm-svn: 186463
2013-07-16 22:37:55 +00:00
Dmitry Vyukov d4060fd281 tsan: extend suppressions format with ^ and $ symbols
not it's possible to write more precise suppressions,
e.g. "^foo$" won't match "blafoobar"

llvm-svn: 186424
2013-07-16 16:44:15 +00:00
Alexey Samsonov af4806f719 [ASan] Bump min supported Mac OS X version to 10.6 - makefile build
llvm-svn: 186410
2013-07-16 13:16:15 +00:00
Alexey Samsonov 9916aa2d95 [Sanitizer] move strcpy and strncpy to common interceptors
llvm-svn: 186408
2013-07-16 12:51:53 +00:00
Alexey Samsonov eb7973246f [ASan] Bump min supported Mac OS X version to 10.6
llvm-svn: 186404
2013-07-16 11:54:40 +00:00
Dmitry Vyukov 1a0c76fa55 tsan: support sigsuspend() call
Intercepting it makes it process pending signal before return.

llvm-svn: 186400
2013-07-16 11:28:04 +00:00
Timur Iskhodzhanov 4245f78fdd [ASan] Use less shadow on Win 32-bit
llvm-svn: 186393
2013-07-16 09:47:39 +00:00
Alexander Potapenko 27155281db [ASan] Cache the OSX version to avoid calling sysctl() on every GetMacosVersion() call.
llvm-svn: 186389
2013-07-16 09:29:48 +00:00
Alexander Potapenko b137ca157b [ASan] Add support for OS X Mavericks to GetMacosVersion.
llvm-svn: 186386
2013-07-16 08:35:42 +00:00
Timur Iskhodzhanov d7eb67774e Fix check_lint warnings in sanitizers' runtime libraries
llvm-svn: 186328
2013-07-15 16:11:39 +00:00
Alexey Samsonov 0048a248bd Completely revert all mbstowcs-and-friends changes from r186109. They were unintentional
llvm-svn: 186158
2013-07-12 12:33:23 +00:00
Sergey Matveev 28dc98ab0d [lsan] Increase the hardcoded limit on number of leaks.
We never expected to see so many leaks in the real world. Until we did.

llvm-svn: 186157
2013-07-12 12:31:22 +00:00
Alexey Samsonov fde429ba69 [Sanitizer] Revert some parts of r186109 related to mbstowcs-and-friends interceptors
llvm-svn: 186155
2013-07-12 11:59:58 +00:00
Chandler Carruth 1a48dc5ed6 Fix a veritable conucopia of bugs in the readdir_r interceptors.
First, the reason I came here: I forgot to look at readdir64_r which had
the exact same bug as readdir_r. However, upon applying the same
quick-fix and testing it I discovered that it still didn't work at all.
As a consequence, I spent some time studying the code and thinking about
it and fixed several other problems.

Second, the code was checking for a null entry and result pointer, but
there is no indication that null pointers are viable here. Certainly,
the spec makes it extremely clear that there is no non-error case where
the implementation of readdir_r fails to dereference the 'result'
pointer and store NULL to it. Thus, our checking for a non-null 'result'
pointer before reflecting that write in the instrumentation was
trivially dead. Remove it.

Third, the interceptor was marking the write to the actual dirent struct
by looking at the entry pointer, but nothing in the spec requires that
the dirent struct written is actually written into the entry structure
provided. A threadlocal buffer would be just as conforming, and the spec
goes out of its way to say the pointer to the *actual* result dirent
struct is stored into *result, so *that* is where the interceptor should
reflect a write occuring. This also obviates the need to even consider
whether the 'entry' parameter is null.

Fourth, I got to the bottom of why nothing at all worked in readdir64_r
-- the interceptor structure for dirent64 was completely wrong in that
it was the same as dirent. I fixed this struct to be correct (64-bit
inode and 64-bit offset! just a 64-bit offset isn't enough!) and added
several missing tests for the size and layout of this struct.

llvm-svn: 186109
2013-07-11 18:51:40 +00:00
Sergey Matveev 29e787d456 [sanitizer] Remove optional arguments from clone() invocation.
Unbreaks compilation on older systems. Patch by Andy Jost.

llvm-svn: 186103
2013-07-11 16:37:44 +00:00
Evgeniy Stepanov 9240838655 [sanitizer] More checks in mbstowcs-like interceptors.
llvm-svn: 186004
2013-07-10 14:17:46 +00:00
Evgeniy Stepanov 123fdb3413 [sanitizer] Fix handling of edge cases in mbstowcs-like interceptors.
llvm-svn: 186002
2013-07-10 14:01:51 +00:00
Chandler Carruth 28c1b294b8 Fix a bug in the readdir_r interceptor: when we reach the end of the
directory stream, the entry is not written to, instead *result is set to
NULL and the entry is not written to at all.

I'm still somewhat suspicious of the correct instrumention here --
I feel like it should be marking the written range as the pointer in
*result and the length (*result)->d_reclen in case the implementation
decides not to use the passed-in entry (if that's even allowed).
Finally, the definition of 'struct dirent' analog used in the
interceptor is wrong in 32-bit mode with _FILE_OFFSET_BITS=64 as it hard
codes the use of a pointer-sized offset.

I've added a somewhat goofy test for the bug I fixed via ASan --
suggestions on how to better test the interceptor logic itself welcome.

llvm-svn: 185998
2013-07-10 09:50:29 +00:00
Peter Collingbourne 2c60538ddd [asan] Update blacklists to use categories.
Differential Revision: http://llvm-reviews.chandlerc.com/D1094

llvm-svn: 185980
2013-07-09 22:04:28 +00:00
Evgeniy Stepanov 7160fb6511 [sanitizer] Update glob64 interceptor to handle GLOB_ALTDIRFUNC as well.
llvm-svn: 185935
2013-07-09 12:34:25 +00:00
Evgeniy Stepanov faba61a7bc [sanitizer] Support GLOB_ALTDIRFUNC in glob interceptor.
llvm-svn: 185932
2013-07-09 12:07:59 +00:00
Evgeniy Stepanov 77ef78a0a5 [sanitizer] Intercept realpath and canonicalize_file_name.
Handle realpath(path, NULL) form.

llvm-svn: 185921
2013-07-09 09:53:37 +00:00
Evgeniy Stepanov f60c75a644 [sanitizer] Wrap lines >80 chars.
llvm-svn: 185920
2013-07-09 09:47:36 +00:00
Evgeniy Stepanov 8495b84076 [asan] Fix windows build.
llvm-svn: 185917
2013-07-09 09:29:19 +00:00
Evgeniy Stepanov f7f252d025 [sanitizer] Syscall handlers for clock_gettime and clock_getres.
llvm-svn: 185913
2013-07-09 08:54:59 +00:00
Sergey Matveev ddd7b6a1c8 [lsan] Fix test.
llvm-svn: 185817
2013-07-08 14:08:05 +00:00
Sergey Matveev bdeff959a1 [lsan] Handle fork() correctly.
Update the main thread's os_id on every pthread_create, and before
initiating leak checking. This ensures that we have the correct os_id even if we
have forked after Init().

llvm-svn: 185815
2013-07-08 12:57:24 +00:00
Alexey Samsonov 852d8a4c18 [LSan] Use overridable hook to report error summary
llvm-svn: 185805
2013-07-08 10:59:52 +00:00
Evgeniy Stepanov c2e3ba9eed [sanitizer] Fix mac build.
llvm-svn: 185706
2013-07-05 15:04:56 +00:00
Evgeniy Stepanov 628d727749 [msan] Intercept pthread_key_create.
llvm-svn: 185693
2013-07-05 12:31:07 +00:00
Evgeniy Stepanov 0d1d35aeba [sanitizer] Disable ptrace interception on non-x86(_64).
Patch by Hal Finkel.

llvm-svn: 185686
2013-07-05 08:57:47 +00:00
Alexander Potapenko 4f73dea69d [ASan] Close stderr before launching atos in asan_symbolize.py
llvm-svn: 185631
2013-07-04 14:21:49 +00:00
Evgeniy Stepanov 717e0cd2a7 [sanitizer] Intercept tcgetattr.
llvm-svn: 185626
2013-07-04 14:03:31 +00:00
Evgeniy Stepanov db615c186f [sanitizer] More interceptors.
bcopy
strtoimax, strtoumax
mbstowcs, mbsrtowcs, mbsnrtowcs
wcstombs, wcsrtombs, wcsnrtombs

llvm-svn: 185624
2013-07-04 13:19:41 +00:00
Alexander Potapenko d0c91acb58 [ASan] Do not protect the malloc zone created by malloc_zone_create() on Snow Leopard and earlier systems.
Fixes https://code.google.com/p/address-sanitizer/issues/detail?id=208

llvm-svn: 185621
2013-07-04 10:16:12 +00:00
Sergey Matveev 22614e5e3f [sanitizer] Fix memory leak in sanitizer_common discovered by LeakSanitizer.
llvm-svn: 185536
2013-07-03 13:45:13 +00:00
Evgeniy Stepanov 1bd0fe447f [sanitizer] Fix Android build.
llvm-svn: 185432
2013-07-02 14:51:31 +00:00
Evgeniy Stepanov aa23bd83e5 [msan] Intercept mempcpy, wmempcpy.
llvm-svn: 185431
2013-07-02 14:49:24 +00:00
Evgeniy Stepanov 69a387e6ae [sanitizer] Fix GLOB_NOMATCH behaviour and refactor the interceptor a bit.
llvm-svn: 185428
2013-07-02 14:08:52 +00:00
Evgeniy Stepanov 165d759a6a [sanitizer] Intercept mbtowc, mbrtowc, get_current_dir_name.
Move getcwd to common interceptors.

llvm-svn: 185424
2013-07-02 13:34:44 +00:00
Evgeniy Stepanov 1df4dfe87a [sanitizer] Intercept setlocale.
llvm-svn: 185416
2013-07-02 09:23:45 +00:00
Alexey Samsonov 4798a08df8 [ASan] try to fix Windows build
llvm-svn: 185345
2013-07-01 16:38:38 +00:00
Alexey Samsonov 9857ca2564 [ASan] Properly disable strict init-order checking when pthread_create is called
llvm-svn: 185342
2013-07-01 16:16:41 +00:00
Evgeniy Stepanov 654688bed5 [msan] Intercept stpcpy.
llvm-svn: 185340
2013-07-01 15:19:37 +00:00
Evgeniy Stepanov 8a4e24ea8b [sanitizer] Intercept getnameinfo.
llvm-svn: 185338
2013-07-01 13:51:31 +00:00
Alexey Samsonov 7a1ad5e605 Change __sanitizer_symbolize_demangle hook return type to 'int'
llvm-svn: 185326
2013-07-01 11:20:56 +00:00
Alexander Potapenko 0fde89f2aa [ASan] Cache atos processes to make Darwin symbolication faster.
Patch by Jesse Ruderman<jruderman@gmail.com>

llvm-svn: 185325
2013-07-01 10:51:31 +00:00
Sergey Matveev 6b5a492091 [sanitizer] Use the correct macro to check glibc version.
llvm-svn: 185324
2013-07-01 10:15:29 +00:00
Alexey Samsonov c3832f7788 [ASan] Add sanity test for asan_symbolize.py script
llvm-svn: 185318
2013-07-01 09:15:19 +00:00
Evgeniy Stepanov d6e856f722 [sanitizer] Fix build with older kernels.
PTRACE_SETREGSET & PTRACE_GETREGSET may be missing from linux headers.

llvm-svn: 185317
2013-07-01 09:10:34 +00:00
Alexey Samsonov cc510707af [ASan] Remove leading underscores from function names in output tests
llvm-svn: 185315
2013-07-01 08:41:45 +00:00
Alexey Samsonov 8918140809 Hide mlock/munlock info message under verbosity flag.
llvm-svn: 185314
2013-07-01 08:25:29 +00:00
Alexey Samsonov dd8872b1d2 Always set -m32/-m64 flags for targeting i386/x86_64 respectively. Apparently, there are platforms where the clang defaults are different from gcc
llvm-svn: 185287
2013-06-30 16:21:32 +00:00
Alexey Samsonov e71f37c1cd Define the path to llvm-symbolizer tool in a common config to reduce copy-paste
llvm-svn: 185286
2013-06-30 14:47:38 +00:00
Richard Smith 079fe209f5 Fix typo found by Clang fix for extern "C" function handling.
llvm-svn: 185234
2013-06-28 22:28:37 +00:00
Alexey Samsonov 13f89cd19b [ASan] Remove %symbolize from lit tests: we now use external symbolizer instead of python script
llvm-svn: 185163
2013-06-28 15:52:44 +00:00
Sergey Matveev 202881d1fe [lsan] Fix build again.
llvm-svn: 185157
2013-06-28 15:23:15 +00:00
Sergey Matveev b3fa575f7b [lsan] Fix build.
llvm-svn: 185156
2013-06-28 15:18:06 +00:00
Sergey Matveev 6672004c47 [lsan] When verbosity > 1, always print suppressions and summary (even if no leaks found).
Also fix an output bug.

llvm-svn: 185153
2013-06-28 15:05:16 +00:00
Sergey Matveev 2b19ee3da8 [lsan] Add suppression support.
llvm-svn: 185152
2013-06-28 14:38:31 +00:00
Evgeniy Stepanov a127039258 [sanitizer] Disable all ptrace-related definitions on Android.
llvm-svn: 185150
2013-06-28 14:18:10 +00:00
Alexey Samsonov 002d764f21 [ASan] Migrate lit tests to external symbolizer from asan_symbolize.py script
llvm-svn: 185148
2013-06-28 12:50:12 +00:00
Alexey Samsonov 6a5b0758ec Demangle names using pluggable internal symbolizer if possible
llvm-svn: 185146
2013-06-28 12:30:24 +00:00
Evgeniy Stepanov 4aef0ee57d [sanitizer] Fix an unfortunate typo and disable ptrace interception on Android.
llvm-svn: 185145
2013-06-28 12:16:03 +00:00
Alexey Samsonov 28e68f9f2f Pass --default-arch flag to external symbolizer. Fix line lengths.
llvm-svn: 185144
2013-06-28 12:13:31 +00:00
Evgeniy Stepanov dec0f76c14 [sanitizer] Intercept ptrace.
llvm-svn: 185142
2013-06-28 11:02:43 +00:00
Alexander Potapenko 2b064a2b4e [ASan][OSX] Make sure the zones created by malloc_create_zone() are write-protected.
Add a test.

llvm-svn: 185140
2013-06-28 10:01:09 +00:00
Alexander Potapenko 593f833e9b [ASan][OSX] Fix the incorrect malloc_create_zone() implementation that led to out-of-bounds mprotect()s
(https://code.google.com/p/address-sanitizer/issues/detail?id=203)
Add a test.

llvm-svn: 185138
2013-06-28 09:21:31 +00:00
Bill Wendling 28e84fc53e Revert hack that omits errno on Darwin platforms. We now have an acceptable 'errno' header.
llvm-svn: 185106
2013-06-27 21:17:53 +00:00
Bill Wendling 4ddc302879 Declare 'strerror' so that we can use it with errno.
llvm-svn: 185105
2013-06-27 21:17:24 +00:00
Bill Wendling bc922e5a5f Add 'errno.h' to the Darwin SDK.
llvm-svn: 185104
2013-06-27 21:17:06 +00:00
Sergey Matveev 9450108430 [sanitizer] Support padding with spaces in Printf.
llvm-svn: 185082
2013-06-27 15:30:44 +00:00
Sergey Matveev 1c34897887 [lsan] Fix flaky test.
llvm-svn: 185079
2013-06-27 14:24:07 +00:00
Dmitry Vyukov d2cd2d018f tsan: revert dynamic symbols file to the old incorrect one
full proper list of dynamic symbols crashes old gold (see bug 16468).
the culprit is 'memcpy' function, if it's added to syms file, gold crashes

llvm-svn: 185078
2013-06-27 13:56:37 +00:00
Dmitry Vyukov b7c6f49364 tsan: remove non-existent functions from syms file
llvm-svn: 185077
2013-06-27 13:52:50 +00:00
Evgeniy Stepanov f5cae53057 [msan] Optionally disable 2 tests (dlopen & gethostbyname).
llvm-svn: 185076
2013-06-27 13:21:00 +00:00
Evgeniy Stepanov 815d3232a7 [sanitizer] Fix dirent interceptors.
The new version reads d_reclen for (struct dirent) size.

llvm-svn: 185067
2013-06-27 09:37:27 +00:00
Alexey Samsonov 895784a5b0 [LSan] Add the way to disable LSan at link time
llvm-svn: 185066
2013-06-27 09:35:50 +00:00
Alexey Samsonov ecdcf11bd6 [TSan] try to fix Go build
llvm-svn: 185063
2013-06-27 07:57:53 +00:00
Alexey Samsonov ed4594b76a [MSan] Rename __msan_unpoision_param to __msan::UnpoisonParam - it shouldn't be in interface
llvm-svn: 185062
2013-06-27 07:50:56 +00:00
Sergey Matveev 0b2ffe30e4 [tsan] Fix build.
llvm-svn: 184963
2013-06-26 16:49:34 +00:00
Bob Wilson c4b26ad006 Revert "Temporarily disable building the armv7 variants of profile_ios on"
This reverts commit r184816.  With Chandler's change in r184929, this should
no longer be necessary.

llvm-svn: 184961
2013-06-26 16:35:16 +00:00
Sergey Matveev d109eb052b [tsan] Move some suppressions-related code to common.
Factor out code to be reused in LSan. Also switch from linked list to vector.

llvm-svn: 184957
2013-06-26 15:37:14 +00:00
Evgeniy Stepanov 06d6c25141 [sanitizer] readdir and readdir_r interceptors.
llvm-svn: 184950
2013-06-26 15:00:53 +00:00
Kostya Serebryany 6a068a715d [asan] initialize fake_stack lazily and increase its maximal size. This makes -fsanitize=address,use-after-return more robust: all SPEC tests pass now. In the default mode thread stacks become a bit smaller.
llvm-svn: 184934
2013-06-26 12:16:05 +00:00
Chandler Carruth fc9d259c98 Revert the Darwin half of r184805: "Remove the sysroot (or isysroot)
restriction from the GCDAProfile.c"

Bill added a much more effective way of coping with the use of errno and
other system interactions for Darwin for now by disabling it on that
platform. Building against the SDK stuff is more fundamental to the
darwin build process.

llvm-svn: 184929
2013-06-26 10:05:37 +00:00
Evgeniy Stepanov b598c0b527 [sanitizer] Reformat line >80 chars.
llvm-svn: 184926
2013-06-26 09:16:45 +00:00
Evgeniy Stepanov 2c7d4d379e [sanitizer] Fix build with OSS4 kernel headers.
This fixes PR16453.

llvm-svn: 184925
2013-06-26 08:16:38 +00:00
Chandler Carruth fa95cc916f Fix a use after free I introduced and that Bill caught in code review
(thanks!) by deferring the free of the filename until we finish writing
the coverage data to that file.

Bill, let me know if you'd prefer a different approach!

llvm-svn: 184895
2013-06-26 00:26:16 +00:00
Bill Wendling 90c38bcf58 Don't use 'errno.h' on Apple just yet. This breaks for some of our buildbots.
llvm-svn: 184878
2013-06-25 21:08:40 +00:00
Dmitry Vyukov eb95448245 tsan: add missing __attribute__((visibility("default"))) to interface functions
llvm-svn: 184858
2013-06-25 15:36:25 +00:00
Sergey Matveev c3332bc8c3 [lsan] Define interceptors more correctly. Also, always clear allocated memory.
llvm-svn: 184849
2013-06-25 14:05:52 +00:00
Evgeniy Stepanov 982d56abb8 [sanitizer] Move log_path to common flag and use it in MSan.
llvm-svn: 184836
2013-06-25 13:50:44 +00:00
Chandler Carruth 825abd8649 Temporarily disable building the armv7 variants of profile_ios on
darwin.

After talking with Jim Grosbach pretty extensively, he was OK with me
punting on this to the Apple folks.

We agreed that the correct fix is either to extend the fake SDK headers
in compiler-rt to support the rest of libc needed by GCDAProfiling.c or
to teach the make build to test for the existence of a suitable SDK on
the system prior to building it. Both of these require someone with
access to the SDK which I don't have, and the latter (my preferred
solution) requires understanding the strange compiler-rt make build
system. Punting to Dan Dunbar or one of the others who support this
stuff on ios to write the appropriate fix, and we can let the build bots
proceed in the mean time.

llvm-svn: 184816
2013-06-25 02:15:14 +00:00
Chandler Carruth ffdf342728 Remove the sysroot (or isysroot) restriction from the GCDAProfile.c
runtime in the Makefile build system as well. Sorry for the temporary
fallout, it took me a while to find these bits.

Bill, I'm not at all confident of the change for Darwin and iOS, but as
discussed we're completely blocked on fixing this. Anyways, please
review and let me know if this will work for you guys. If necessary,
I can work with you to rig up an errno.h stub for Darwin, but I expect
that to be... moderately challenging.

llvm-svn: 184805
2013-06-25 00:57:06 +00:00
Chandler Carruth a26c814953 Address a few of the issues in GCDAProfiling I noted when looking
through Bill's patch:

1) Correctly test the file descriptor after the sceond attempt at
   creating the file.
2) Make the filename a global so that we can issue error messages from
   other routines.
3) Check errno in several places and print it out so that errors are
   easier to track down.

I don't really expect any of these to fix the current failures I'm
seeing, but I'm hopeful they'll at least let me debug them.

llvm-svn: 184799
2013-06-25 00:37:32 +00:00
Chandler Carruth 9fcb41d0fa Remove the sysroot restriction from building GCDAProfiling.c.
We really need the C standard library to be available to implement the
profiling runtime library reasonably, and replicating everything in the
SDKs tree really isn't addressing any problems we have. Notably, all of
the sanitizer runtimes take the same approach, and this isn't a library
which could end up in a bootstrapping problem where the system headers
aren't even available.

This will hopefully prevent subsequent changes which start using various
other bits of C standard library to make things more debuggable.

llvm-svn: 184798
2013-06-25 00:37:28 +00:00
Dmitry Vyukov 5001d43dcb tsan: make the test more robust
currently it episodically fails
the hypothesis it is due to racy race detection algorithm
the sleep should make it more robust

llvm-svn: 184752
2013-06-24 16:28:02 +00:00
Dmitry Vyukov b4711b2c24 tsan: update dynamic export syms file
now it includes proper functions (including interceptors)
and does not include local functions that lead to build failures

llvm-svn: 184747
2013-06-24 15:17:36 +00:00
Evgeniy Stepanov 60d964d4f2 [sanitizer] Intercept sysinfo.
llvm-svn: 184739
2013-06-24 14:25:33 +00:00
Evgeniy Stepanov 8fb2c264a2 [sanitizer] Fix TSan build.
llvm-svn: 184736
2013-06-24 14:03:13 +00:00
Evgeniy Stepanov 02a7460d12 [sanitizer] Intercept inet_aton.
llvm-svn: 184735
2013-06-24 13:56:14 +00:00
Evgeniy Stepanov 830550ce4c [msan] Unpoison param-tls in signal handler wrapper.
This an entry point from uninstrumented code.

llvm-svn: 184734
2013-06-24 13:48:42 +00:00
Evgeniy Stepanov 0e8053af08 [sanitizer] Intercept readv, preadv, writev, pwritev.
llvm-svn: 184717
2013-06-24 10:43:23 +00:00
Sergey Matveev b8cd986b5d [lsan] Fix android build.
llvm-svn: 184704
2013-06-24 09:12:11 +00:00
Sergey Matveev 4e0215a71c Revert to C-style callbacks for iteration over allocator chunks.
Also clean up LSan code, fix some comments and replace void* with uptr
to bring down the number of reinterpret_casts.

llvm-svn: 184700
2013-06-24 08:34:50 +00:00
Alexey Samsonov 43937b3758 Add cmake rules for building LSan common on Mac OS
llvm-svn: 184639
2013-06-22 16:33:52 +00:00
Sergey Matveev 38fa1ff710 [lsan] Try REALLY hard to fix Win build.
llvm-svn: 184557
2013-06-21 15:50:49 +00:00
Sergey Matveev 85f1fffdfb [lsan] This time really fix Win build.
llvm-svn: 184556
2013-06-21 15:22:12 +00:00
Sergey Matveev 7ed5c687ed [lsan] Fix win build.
llvm-svn: 184555
2013-06-21 15:14:57 +00:00
Sergey Matveev d28c03c03a [lsan] Increase allocator space; minor fixes.
llvm-svn: 184554
2013-06-21 15:10:20 +00:00
Sergey Matveev b94d5e2d1c [asan] Move lsan_disabled out of thread context.
Fix for the case where disabler is used in pthread key destructor.

llvm-svn: 184553
2013-06-21 14:51:52 +00:00
Alexey Samsonov a9db3f9757 [ASan] reimplement strdup() interceptor to get nicer stack traces for memory chunks allocated there
llvm-svn: 184546
2013-06-21 14:41:59 +00:00
Evgeniy Stepanov b58b72e151 [msan] Intercept (v)asprintf.
llvm-svn: 184545
2013-06-21 13:32:26 +00:00
Evgeniy Stepanov ae4e1ec4e6 [msan] Add keep_going runtime flag.
llvm-svn: 184542
2013-06-21 12:37:58 +00:00
Alexey Samsonov f9e6624663 [ASan] make test for LSan annotations Linux-only for now
llvm-svn: 184541
2013-06-21 12:18:52 +00:00
Alexey Samsonov ad25b50a89 [ASan] Check that ASan user may include and use LSan headers
llvm-svn: 184540
2013-06-21 11:11:44 +00:00
Evgeniy Stepanov 57a40e5a94 [santizer] Disable several EVIOxxx ioctls on older kernels.
llvm-svn: 184539
2013-06-21 10:54:57 +00:00
Dmitry Vyukov 03ec9545f5 tsan: fix potential false positive race on fd
llvm-svn: 184430
2013-06-20 14:32:12 +00:00
Sergey Matveev 5e6b9eccce [asan] Define LSan annotations as no-ops if leak detection is not supported.
llvm-svn: 184422
2013-06-20 13:39:42 +00:00
Evgeniy Stepanov 673cf23d06 Fix unused function warning w/o changing compiler flags.
We have way too many different build systems.

llvm-svn: 184409
2013-06-20 09:45:36 +00:00
Evgeniy Stepanov 3ce228faf3 [sanitizer] Fix Mac build.
llvm-svn: 184407
2013-06-20 09:39:34 +00:00
Evgeniy Stepanov d271563e5a Remove an outdated comment.
llvm-svn: 184406
2013-06-20 09:21:25 +00:00
Evgeniy Stepanov fbea5b95c6 [sanitizer] Handle EVIOxxxx ioctls.
llvm-svn: 184405
2013-06-20 09:19:28 +00:00
Alexey Samsonov 686c229b03 [ASan] Clear allocation magic value before recycling the chunk. This led to spurious crashes in LSan when it walked through reused chunks. Don't know how to create not-brittle test case for this.
llvm-svn: 184404
2013-06-20 08:13:06 +00:00
Sergey Matveev 7014179ccb [lsan] Prevent inlining of WipeStack().
llvm-svn: 184312
2013-06-19 15:39:13 +00:00
Sergey Matveev dac35c24c0 [lsan] Move symbolization and reporting out of StopTheWorld callback.
llvm-svn: 184303
2013-06-19 14:04:11 +00:00
Evgeniy Stepanov 49b4314cfd [sanitizer] Fix struct ifconf definition on Mac and restore the size checks.
llvm-svn: 184296
2013-06-19 13:21:38 +00:00
Sylvestre Ledru 6e0a254ec9 When the compiler is not providing a clean triple, we should fail
the build right from the start. 
For now, it is only done with DEBUGMAKE is provided. That makes
things harder to debug during ports of compiler-rt on other systems.

llvm-svn: 184295
2013-06-19 12:59:56 +00:00
Alexander Potapenko 29b9fcf0a8 [ASan] Delete excessive 'extern "C"' around mlock* interceptors.
llvm-svn: 184294
2013-06-19 11:36:51 +00:00
Evgeniy Stepanov 41060fd728 [sanitizer] Fix Android build.
llvm-svn: 184293
2013-06-19 10:36:31 +00:00
Evgeniy Stepanov f9cfe76526 [sanitizer] Fix build on RHEL 6.3, 6.4.
linux/if_ppp.h is broken in certain kernels.

llvm-svn: 184290
2013-06-19 08:55:28 +00:00
Kostya Serebryany 63d84f8149 [asan] fix a rare failure in fast unwinder, found by asan/clang bootstrap
llvm-svn: 184190
2013-06-18 14:47:40 +00:00
Sergey Matveev 2717e7be06 [lsan] Set current_thread_tid correctly for main thread.
llvm-svn: 184189
2013-06-18 14:44:45 +00:00
Evgeniy Stepanov 394b09b00f [sanitizer] Fix Android build.
llvm-svn: 184187
2013-06-18 13:56:12 +00:00
Evgeniy Stepanov fc3f61fcf0 [sanitizer] Remove a set of deprecated ioctls.
llvm-svn: 184185
2013-06-18 10:37:17 +00:00
Evgeniy Stepanov b9c1020696 [sanitizer] Replace ext2_ ioctls with generic fs_ ioctls.
They are actually the same, but ext2_fs.h header is not available in userspace
with newer kernels.

llvm-svn: 184184
2013-06-18 09:49:04 +00:00
Evgeniy Stepanov 8fa046e288 [sanitizer] Symbolic ioctl names.
Replace hardcoded ioctl request ids with symbolic names.
Disable certain ioctls on platforms where such names are not found in the
system headers.
Fix a bug in ioctl_lookup.
Reenable ioctl test on Mac.

llvm-svn: 184183
2013-06-18 09:22:24 +00:00
Dmitry Vyukov 5cf581a8d4 tsan: consistently use return pc as top frame pc
always substract 1 from the top pc
this allows to get correct stacks with -O2

llvm-svn: 184112
2013-06-17 19:57:03 +00:00
Alexey Samsonov 7e325fb477 Properly install LSan interface header, rely on sanitizer header presence in lit tests
llvm-svn: 183977
2013-06-14 11:45:36 +00:00
Alexey Samsonov 0d7012debb [TSan] use InternalMmapVector to store fired suppressions
llvm-svn: 183974
2013-06-14 11:18:58 +00:00
Alexey Samsonov bd0428b81a [LSan] Use a typedef for frontier vector
llvm-svn: 183973
2013-06-14 10:07:56 +00:00
Alexey Samsonov b0d92b3312 [Sanitizer] Rename InternalVector to InternalMmapVector
llvm-svn: 183972
2013-06-14 09:59:40 +00:00
Dmitry Vyukov 26daccaddb tsan: fix Windows Go crash
llvm-svn: 183898
2013-06-13 10:15:44 +00:00
Alexey Samsonov 5e520c5e09 [LSan] fix link flags for building unit tests
llvm-svn: 183891
2013-06-13 07:23:18 +00:00
Richard Trieu 5685aa6845 Fix broken header guard.
llvm-svn: 183873
2013-06-12 22:37:22 +00:00
Sergey Matveev 978460c12c [lsan] Harmonized some naming inconsistencies.
llvm-svn: 183748
2013-06-11 15:26:20 +00:00
Dmitry Vyukov a8570d38fe tsan: add -Wno-maybe-uninitialized to Go build script
this is how the rest of the codebase is built

llvm-svn: 183738
2013-06-11 11:44:43 +00:00
Sergey Matveev 5129c5e56f [lsan] Fix the unittest makefiles.
llvm-svn: 183735
2013-06-11 09:52:02 +00:00
Alexey Samsonov bc1c6714f2 [Sanitizer] add file forgotten in r183730
llvm-svn: 183732
2013-06-11 08:14:24 +00:00
Alexey Samsonov c8e7364763 [Sanitizer] support running external llvm-symbolizer on Mac
llvm-svn: 183730
2013-06-11 08:13:36 +00:00
Dmitry Vyukov 79de34f75c tsan: fix lit test failures
llvm-svn: 183674
2013-06-10 16:06:21 +00:00
Dmitry Vyukov b08e72913a tsan: add system tests for suppressions
llvm-svn: 183673
2013-06-10 15:39:28 +00:00
Dmitry Vyukov 315bb0e687 tsan: allows to suppress races on global variables
llvm-svn: 183672
2013-06-10 15:38:44 +00:00
Alexander Potapenko 152f7edf24 [ASan] Fix unset-insert-libraries-on-exec.cc on 32-bit Darwin.
The test used to execute a 64-bit /bin/bash binary and preload a 32-bit dynamic library into it.
Now the arch-specific version of echo-env is executed instead.

llvm-svn: 183662
2013-06-10 14:47:43 +00:00
Alexey Samsonov f67191b4c3 [ASan] mark ioctl test as xfailing on darwin. remove redundant semicolons
llvm-svn: 183655
2013-06-10 14:17:08 +00:00
Kostya Serebryany 02062becea [asan] fix Android build (mark asan_malloc_usable_size as an interface function)
llvm-svn: 183651
2013-06-10 13:28:33 +00:00
Dmitry Vyukov b19a26b852 tsan: disable getaddrinfo() interceptor for tsan (causes recursion)
llvm-svn: 183649
2013-06-10 11:35:08 +00:00
Dmitry Vyukov 7e4a18c4fb tsan: fix merge bug
llvm-svn: 183648
2013-06-10 11:11:29 +00:00
Kostya Serebryany e71982d589 [asan] fix the bug with memalign and malloc_usable_size (http://code.google.com/p/address-sanitizer/issues/detail?id=193); also fix lint
llvm-svn: 183647
2013-06-10 10:46:27 +00:00
Dmitry Vyukov b278f1235f tsan: fix windows crash (incorrect stack boundaries)
llvm-svn: 183646
2013-06-10 10:30:54 +00:00
Dmitry Vyukov ddb0294dd8 tsan: fix old gcc warnings
llvm-svn: 183645
2013-06-10 10:30:19 +00:00
Dmitry Vyukov e979c5467c tsan: fix windows mingw build
llvm-svn: 183644
2013-06-10 10:02:02 +00:00
Dmitry Vyukov 8794772337 tsan: more detailed trace for atomic operations (include address and memory ordering)
llvm-svn: 183643
2013-06-10 10:01:31 +00:00
Dmitry Vyukov 50ef53ebfc tsan: fix lint warnings
llvm-svn: 183642
2013-06-10 10:00:54 +00:00
Alexey Samsonov dd489a4e15 [MSan] don't add msan unit tests to check-msan command if libcxx is not checked out
llvm-svn: 183641
2013-06-10 09:09:40 +00:00
Alexey Samsonov 4c0ea93725 [ASan] don't use -m{32,64} flag in test case, as it can be run in both 32- and 64-bit modes
llvm-svn: 183638
2013-06-10 07:55:12 +00:00
Bill Wendling 658fb53b7e Reverting r183529:
This is causing the following error on Darwin:

/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:282:1: error: 'assertion_failed__282' declared as an array with a negative size
CHECK_TYPE_SIZE(ifconf);
^~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:223:3: note: expanded from macro 'CHECK_TYPE_SIZE'
  COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE))
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:239:30: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:245:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
    typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                        ^~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:284:1: error: 'assertion_failed__284' declared as an array with a negative size
CHECK_SIZE_AND_OFFSET(ifconf, ifc_ifcu);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:228:3: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
  COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) ==          \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:239:30: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:245:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
    typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                        ^~~~~~~~~~~~~~~

llvm-svn: 183557
2013-06-07 20:28:29 +00:00
Evgeniy Stepanov cead69d4a3 [sanitizer] Handle SIOCGIFCONF ioctl.
llvm-svn: 183529
2013-06-07 15:49:38 +00:00
Alexey Samsonov 4fdf8d66a9 [ASan] fix test case to use absolute paths
llvm-svn: 183527
2013-06-07 15:44:21 +00:00
Alexander Potapenko 6af3fce55e [ASan] An early return from InitializeAsanInterceptors() on Mac has been considered unobvious.
Remove it and replace ASAN_INTERCEPT_FUNC with a no-op if SANITIZER_MAC==1.

llvm-svn: 183524
2013-06-07 15:10:02 +00:00
Evgeniy Stepanov c24e13e7bb [sanitizer] Fix Android build.
llvm-svn: 183523
2013-06-07 14:56:54 +00:00
Evgeniy Stepanov 74dcb1a8de [sanitizer] Fix windows build.
llvm-svn: 183518
2013-06-07 13:19:33 +00:00
Evgeniy Stepanov 0b1f41b6f4 [sanitizer] ioctl interceptor.
ASan: disabled by default
MSan: enabled by default
TSan: disabled
llvm-svn: 183517
2013-06-07 13:00:47 +00:00
Alexey Samsonov 575c599554 Drop support for 32-bit PowerPC in sanitizer tools.
llvm-svn: 183499
2013-06-07 09:44:43 +00:00
Alexey Samsonov 889e3ab83c [ASan] create separate configs for running ASan lit tests in both 32- and 64-bit mode. Clean up RUN-lines in tests.
llvm-svn: 183498
2013-06-07 09:38:55 +00:00
Sergey Matveev 1c4e214c32 [lsan] Put SANITIZER_INTERFACE_ATTRIBUTE on LSan interface functions.
llvm-svn: 183429
2013-06-06 18:40:55 +00:00
Dmitry Vyukov 0fffc0088c tsan: use memory access size for Go after all
helps to make range access functions correct and fast

llvm-svn: 183418
2013-06-06 14:31:15 +00:00
Sergey Matveev db356560fc [sanitizer] Do not fall back to SlowUnwindStack() in GetStackTrace()
llvm-svn: 183414
2013-06-06 14:19:36 +00:00
Sergey Matveev ecc4f5ba8e [lsan] Implement __lsan_ignore_object().
Leak annotation similar to HeapChecker's IgnoreObject().

llvm-svn: 183412
2013-06-06 14:17:56 +00:00
Alexey Samsonov e674320ade [ASan] make pthread_getschedparam test more robust
llvm-svn: 183411
2013-06-06 14:08:40 +00:00
Alexey Samsonov f6630ecee9 Simplify lit configs for asan/lsan/msan unit tests
llvm-svn: 183410
2013-06-06 13:48:20 +00:00
Dmitry Vyukov 5fe8a4f88f tsan: always strip bottom frame in Go reports
llvm-svn: 183408
2013-06-06 13:31:35 +00:00
Alexey Samsonov e3bf521b7c Remove a bunch of copy-paste: use common config for sanitizer lit/unit tests
llvm-svn: 183407
2013-06-06 13:28:37 +00:00
Dmitry Vyukov ce0247c93e tsan: fix darwin Go crashes
llvm-svn: 183405
2013-06-06 13:20:40 +00:00
Dmitry Vyukov c9e304afbd tsan: fix darwin Go build
llvm-svn: 183402
2013-06-06 13:00:32 +00:00