chromiumos/third_party/compiler-rt.git
10 months ago[msan] Save/restore va_arg_overflow_tls in signal handlers. master
Evgeniy Stepanov [Tue, 27 Aug 2013 14:08:15 +0000 (14:08 +0000)]
[msan] Save/restore va_arg_overflow_tls in signal handlers.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189351 91177308-0d34-0410-b5e6-96231b3b80d8

10 months agoRevert r189347: it breaks on machines w/o installed debug versions of system libraries
Alexey Samsonov [Tue, 27 Aug 2013 14:04:01 +0000 (14:04 +0000)]
Revert r189347: it breaks on machines w/o installed debug versions of system libraries

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189350 91177308-0d34-0410-b5e6-96231b3b80d8

10 months agoLSan: Check that dynamic linker library is properly symbolized
Alexey Samsonov [Tue, 27 Aug 2013 13:39:33 +0000 (13:39 +0000)]
LSan: Check that dynamic linker library is properly symbolized

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189347 91177308-0d34-0410-b5e6-96231b3b80d8

10 months ago[msan] Unpoison all TLS shadow when leaving a signal handler.
Evgeniy Stepanov [Tue, 27 Aug 2013 12:59:39 +0000 (12:59 +0000)]
[msan] Unpoison all TLS shadow when leaving a signal handler.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189343 91177308-0d34-0410-b5e6-96231b3b80d8

10 months ago[msan] Fix a data race in signal/sigaction interceptors.
Evgeniy Stepanov [Tue, 27 Aug 2013 11:34:05 +0000 (11:34 +0000)]
[msan] Fix a data race in signal/sigaction interceptors.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189342 91177308-0d34-0410-b5e6-96231b3b80d8

10 months ago[msan] A test for ppoll() interceptor.
Evgeniy Stepanov [Tue, 27 Aug 2013 11:10:20 +0000 (11:10 +0000)]
[msan] A test for ppoll() interceptor.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189339 91177308-0d34-0410-b5e6-96231b3b80d8

10 months ago[sanitizer] Simplify sigaction and sigset_t handling.
Evgeniy Stepanov [Tue, 27 Aug 2013 11:10:04 +0000 (11:10 +0000)]
[sanitizer] Simplify sigaction and sigset_t handling.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189338 91177308-0d34-0410-b5e6-96231b3b80d8

10 months agocmake: fix the compiler-rt build with MSVC
Hans Wennborg [Tue, 27 Aug 2013 01:24:01 +0000 (01:24 +0000)]
cmake: fix the compiler-rt build with MSVC

This sets flags and excludes things that aren't working with MSVC yet,
allowing us to build the ASan runtime as part of the cmake build.

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189304 91177308-0d34-0410-b5e6-96231b3b80d8

10 months ago[sanitizer] Add a fast version of StackDepotGet() for use in LSan.
Sergey Matveev [Mon, 26 Aug 2013 13:24:43 +0000 (13:24 +0000)]
[sanitizer] Add a fast version of StackDepotGet() for use in LSan.

Add a class that holds a snapshot of the StackDepot optimized for querying by
ID. This allows us to speed up LSan dramatically.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189217 91177308-0d34-0410-b5e6-96231b3b80d8

10 months ago[sanitizer] Handle Die() in StopTheWorld.
Sergey Matveev [Mon, 26 Aug 2013 13:20:31 +0000 (13:20 +0000)]
[sanitizer] Handle Die() in StopTheWorld.

Handle calls to Die() from the tracer thread. Fixes a bug where a CHECK
could fail in the tracer thread, resulting in a call to AsanDie. The tracer
thread then exited and the parent process continued execution despite its
address space being in an unusable state.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189216 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[dfsan] Integration test for the equal-labels case
Peter Collingbourne [Fri, 23 Aug 2013 18:45:22 +0000 (18:45 +0000)]
[dfsan] Integration test for the equal-labels case

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189134 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[msan] Extend VAArgTLSOverwrite test.
Evgeniy Stepanov [Fri, 23 Aug 2013 12:13:18 +0000 (12:13 +0000)]
[msan] Extend VAArgTLSOverwrite test.

This test now covers LLVM r189104.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189105 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoSlightly improve lint checker script and fix a few style issues
Alexey Samsonov [Fri, 23 Aug 2013 07:43:56 +0000 (07:43 +0000)]
Slightly improve lint checker script and fix a few style issues

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189092 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[lsan] Add a regression test for building C code.
Sergey Matveev [Thu, 22 Aug 2013 14:48:44 +0000 (14:48 +0000)]
[lsan] Add a regression test for building C code.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189016 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Fix build when scanf interceptors are enabled, and __isoc99_*scanf are...
Evgeniy Stepanov [Thu, 22 Aug 2013 13:59:15 +0000 (13:59 +0000)]
[sanitizer] Fix build when scanf interceptors are enabled, and __isoc99_*scanf are not.

Fixes PR16916.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189015 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[lsan] Add a stress test.
Sergey Matveev [Thu, 22 Aug 2013 13:32:10 +0000 (13:32 +0000)]
[lsan] Add a stress test.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189012 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[lsan] Follow-up to r189010 - do the same in Makefile build.
Sergey Matveev [Thu, 22 Aug 2013 13:30:01 +0000 (13:30 +0000)]
[lsan] Follow-up to r189010 - do the same in Makefile build.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189011 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[lsan] Build standalone LSan with -fno-rtti.
Sergey Matveev [Thu, 22 Aug 2013 13:23:22 +0000 (13:23 +0000)]
[lsan] Build standalone LSan with -fno-rtti.

Fix issue where C code could not be built with -fsanitize=leak.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189010 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoAdd missing ']'.
Bill Wendling [Wed, 21 Aug 2013 20:12:27 +0000 (20:12 +0000)]
Add missing ']'.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188927 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoFor Darwin builds, locate tools using xcrun when available.
Bob Wilson [Wed, 21 Aug 2013 04:42:56 +0000 (04:42 +0000)]
For Darwin builds, locate tools using xcrun when available.

The make/platform/darwin_bni.mk file already has similar code but we
apparently neglected to add it to the clang_darwin.mk file.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188864 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[LSan] Add support for building standalone LSan runtime to Make build (compiler-rt...
Alexey Samsonov [Tue, 20 Aug 2013 14:49:01 +0000 (14:49 +0000)]
[LSan] Add support for building standalone LSan runtime to Make build (compiler-rt part)

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188804 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoIt appears that glibc 2.13 has the same thread descriptor size as 2.11,
Chandler Carruth [Sun, 18 Aug 2013 10:04:51 +0000 (10:04 +0000)]
It appears that glibc 2.13 has the same thread descriptor size as 2.11,
bump up the inflection point to 2.14. If someone can tell me how to
actually figure out value for this, that would be awesome.

Anyways, this takes me to one ASan failure, one LSan failure, and three
TSan failures for 'check-all' on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188635 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoRevert r188369 (and r188455) which breaks the build on at least some
Chandler Carruth [Sun, 18 Aug 2013 08:47:06 +0000 (08:47 +0000)]
Revert r188369 (and r188455) which breaks the build on at least some
Linux systems. I've replied on the original commit thread with details
of the problem.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188628 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoFix endian conditions on Solaris. From Alexander Esilevich.
Joerg Sonnenberger [Sat, 17 Aug 2013 22:32:10 +0000 (22:32 +0000)]
Fix endian conditions on Solaris. From Alexander Esilevich.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188613 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[ASan/RTL] Disable colored reporting on Windows
Timur Iskhodzhanov [Fri, 16 Aug 2013 11:26:26 +0000 (11:26 +0000)]
[ASan/RTL] Disable colored reporting on Windows

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188545 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agotsan: better report formatting for Go
Dmitry Vyukov [Fri, 16 Aug 2013 11:15:14 +0000 (11:15 +0000)]
tsan: better report formatting for Go
Say that gorotuine 1 is main goroutine.
Remove excessive new line.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188542 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[ASan/RTL] Disable alloc_dealloc_mismatch by default on Windows
Timur Iskhodzhanov [Fri, 16 Aug 2013 11:04:59 +0000 (11:04 +0000)]
[ASan/RTL] Disable alloc_dealloc_mismatch by default on Windows

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188541 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[dfsan] Initial set of custom functions and interceptors for libc.
Peter Collingbourne [Thu, 15 Aug 2013 21:18:53 +0000 (21:18 +0000)]
[dfsan] Initial set of custom functions and interceptors for libc.

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188490 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[dfsan] Runtime support for -dfsan-debug-nonzero-labels feature.
Peter Collingbourne [Thu, 15 Aug 2013 18:51:07 +0000 (18:51 +0000)]
[dfsan] Runtime support for -dfsan-debug-nonzero-labels feature.

Reviewers: eugenis

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1406

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188471 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Add missing include.
Evgeniy Stepanov [Thu, 15 Aug 2013 10:20:30 +0000 (10:20 +0000)]
[sanitizer] Add missing include.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188455 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[dfsan] New __dfsan_set_label runtime function.
Peter Collingbourne [Wed, 14 Aug 2013 20:51:33 +0000 (20:51 +0000)]
[dfsan] New __dfsan_set_label runtime function.

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188411 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[dfsan] Runtime support for ABI list functionality; can now run integration tests...
Peter Collingbourne [Wed, 14 Aug 2013 18:54:06 +0000 (18:54 +0000)]
[dfsan] Runtime support for ABI list functionality; can now run integration tests with args ABI.

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188401 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Split platform_limits_posix into system- and kernel-dependent parts.
Evgeniy Stepanov [Wed, 14 Aug 2013 13:34:14 +0000 (13:34 +0000)]
[sanitizer] Split platform_limits_posix into system- and kernel-dependent parts.

This change moves everything depending on kernel headers (mostly ioctl types
and ids) into a separate source file. This will reduce the possibility of
header conflict on various platforms (most importantly, older glibc versions).

This change also removes 2 deprecated ioctls, and symbolic ids for other bunch
of ambiguous ioctls (i.e. same id is shared by ioctls with different memory
behavior).

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188369 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[dfsan] Introduce dfsan_read_label runtime function.
Peter Collingbourne [Tue, 13 Aug 2013 22:15:40 +0000 (22:15 +0000)]
[dfsan] Introduce dfsan_read_label runtime function.

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188319 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agodfsan: fix lint warning
Dmitry Vyukov [Tue, 13 Aug 2013 16:52:07 +0000 (16:52 +0000)]
dfsan: fix lint warning

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188292 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agotsan: intercept getaddrinfo
Dmitry Vyukov [Tue, 13 Aug 2013 16:51:27 +0000 (16:51 +0000)]
tsan: intercept getaddrinfo
This is necessary to prevent false positives, see:
https://code.google.com/p/thread-sanitizer/issues/detail?id=25

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188291 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[ASan/Win] Oops, forgot to add the attributes to the memory allocations functions
Timur Iskhodzhanov [Tue, 13 Aug 2013 16:48:18 +0000 (16:48 +0000)]
[ASan/Win] Oops, forgot to add the attributes to the memory allocations functions

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188290 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agotsan/msan: add halt_on_error flag
Dmitry Vyukov [Tue, 13 Aug 2013 15:33:00 +0000 (15:33 +0000)]
tsan/msan: add halt_on_error flag
If halt_on_error==true, program terminates after reporting first error.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188279 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[ASan/Win] Hook some memory allocation functions; passes simple sanity test now
Timur Iskhodzhanov [Tue, 13 Aug 2013 15:29:42 +0000 (15:29 +0000)]
[ASan/Win] Hook some memory allocation functions; passes simple sanity test now

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188278 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[ASan/Win] Add the first version of the RTL thunk that should be linked with instrume...
Timur Iskhodzhanov [Tue, 13 Aug 2013 13:47:03 +0000 (13:47 +0000)]
[ASan/Win] Add the first version of the RTL thunk that should be linked with instrumented DLLs

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188267 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoAdd a FIXME to check_lint
Timur Iskhodzhanov [Tue, 13 Aug 2013 13:44:02 +0000 (13:44 +0000)]
Add a FIXME to check_lint

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188266 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[*San/RTL] One more minor fix
Timur Iskhodzhanov [Tue, 13 Aug 2013 12:16:43 +0000 (12:16 +0000)]
[*San/RTL] One more minor fix

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188263 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[*San/RTL] Fix minor breakage
Timur Iskhodzhanov [Tue, 13 Aug 2013 12:03:51 +0000 (12:03 +0000)]
[*San/RTL] Fix minor breakage

Grumbling: this hasn't been caught by running 'make check-{a,l,t}san check-sanitizer'

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188262 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoDefine SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where SANITIZE...
Timur Iskhodzhanov [Tue, 13 Aug 2013 11:42:45 +0000 (11:42 +0000)]
Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where SANITIZER_INTERFACE_ATTRIBUTE or SANITIZER_ATTRIBUTE_WEAK are used

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188261 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[dfsan] Remove the unused __dfsan_memcpy function.
Peter Collingbourne [Tue, 13 Aug 2013 00:16:18 +0000 (00:16 +0000)]
[dfsan] Remove the unused __dfsan_memcpy function.

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188238 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[dfsan] Begin a private header and move shadow_for there.
Peter Collingbourne [Mon, 12 Aug 2013 23:51:33 +0000 (23:51 +0000)]
[dfsan] Begin a private header and move shadow_for there.

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188231 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[dfsan] Introduce dfsan_union runtime function.
Peter Collingbourne [Mon, 12 Aug 2013 23:47:37 +0000 (23:47 +0000)]
[dfsan] Introduce dfsan_union runtime function.

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188229 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoAdd "CHECK-" prefix to un-break buildbot failure.
Rui Ueyama [Mon, 12 Aug 2013 23:43:19 +0000 (23:43 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188227 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Intercept poll/ppoll.
Evgeniy Stepanov [Mon, 12 Aug 2013 13:19:53 +0000 (13:19 +0000)]
[sanitizer] Intercept poll/ppoll.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188177 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Intercept getgroups.
Evgeniy Stepanov [Mon, 12 Aug 2013 11:01:40 +0000 (11:01 +0000)]
[sanitizer] Intercept getgroups.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188167 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[tests] Add one more lit rename update I missed.
Daniel Dunbar [Fri, 9 Aug 2013 22:23:23 +0000 (22:23 +0000)]
[tests] Add one more lit rename update I missed.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188117 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[tests] Update to use lit_config and lit package, as appropriate.
Daniel Dunbar [Fri, 9 Aug 2013 22:14:01 +0000 (22:14 +0000)]
[tests] Update to use lit_config and lit package, as appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188116 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Fix handling of %n in scanf interceptor.
Evgeniy Stepanov [Fri, 9 Aug 2013 12:58:35 +0000 (12:58 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188069 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Limit scandir interceptor to Linux.
Evgeniy Stepanov [Thu, 8 Aug 2013 14:04:36 +0000 (14:04 +0000)]
[sanitizer] Limit scandir interceptor to Linux.

Implementation uses __thread not available on certain platforms.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187983 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Intercept scandir/scandir64.
Evgeniy Stepanov [Thu, 8 Aug 2013 13:57:15 +0000 (13:57 +0000)]
[sanitizer] Intercept scandir/scandir64.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187982 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agotsan: better diagnostics for invalid addresses passed to free()
Dmitry Vyukov [Thu, 8 Aug 2013 13:47:50 +0000 (13:47 +0000)]
tsan: better  diagnostics for invalid addresses passed to free()

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187980 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Intercept strerror and strerror_r.
Evgeniy Stepanov [Thu, 8 Aug 2013 11:44:05 +0000 (11:44 +0000)]
[sanitizer] Intercept strerror and strerror_r.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187978 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] ASan/MSan tests for r187967.
Evgeniy Stepanov [Thu, 8 Aug 2013 09:23:19 +0000 (09:23 +0000)]
[sanitizer] ASan/MSan tests for r187967.

r187967: Disable inlining between sanitized and non-sanitized functions.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187971 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoSimplify (and fix) check-dfsan configs
Alexey Samsonov [Thu, 8 Aug 2013 08:26:39 +0000 (08:26 +0000)]
Simplify (and fix) check-dfsan configs

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187968 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoDataFlowSanitizer; compiler-rt changes.
Peter Collingbourne [Wed, 7 Aug 2013 22:47:26 +0000 (22:47 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187924 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[TSan] Fix free_race.c by removing `not` from the test invocation that doesn't fail.
Alexander Potapenko [Wed, 7 Aug 2013 13:54:27 +0000 (13:54 +0000)]
[TSan] Fix free_race.c by removing `not` from the test invocation that doesn't fail.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187889 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[TSan] Let the users suppress use-after-free errors using the "race:" suppressions.
Alexander Potapenko [Wed, 7 Aug 2013 12:39:00 +0000 (12:39 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187885 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoASan: fix one more test case for pipefail
Alexey Samsonov [Wed, 7 Aug 2013 10:41:49 +0000 (10:41 +0000)]
ASan: fix one more test case for pipefail

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187881 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoDistinguish 32-bit ASan from 64-bit ASan in lit configs
Alexey Samsonov [Wed, 7 Aug 2013 09:31:28 +0000 (09:31 +0000)]
Distinguish 32-bit ASan from 64-bit ASan in lit configs

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187878 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoEnable pipefail for ASan tests
Alexey Samsonov [Wed, 7 Aug 2013 09:14:30 +0000 (09:14 +0000)]
Enable pipefail for ASan tests

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187877 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Intercept sched_getaffinity.
Evgeniy Stepanov [Wed, 7 Aug 2013 09:10:16 +0000 (09:10 +0000)]
[sanitizer] Intercept sched_getaffinity.

Re-applying with a more reliable test case.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187876 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoEnable pipefail for TSan tests
Alexey Samsonov [Wed, 7 Aug 2013 09:02:37 +0000 (09:02 +0000)]
Enable pipefail for TSan tests

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187875 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoEnable pipefail for LSan tests
Alexey Samsonov [Wed, 7 Aug 2013 08:46:09 +0000 (08:46 +0000)]
Enable pipefail for LSan tests

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187873 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoRevert "[sanitizer] Intercept sched_getaffinity."
David Blaikie [Wed, 7 Aug 2013 00:37:26 +0000 (00:37 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187841 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[libsanitizer] Drive-by fix for -Wempty-body in sanitizer_common_syscalls.inc
Alexander Potapenko [Tue, 6 Aug 2013 14:07:46 +0000 (14:07 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187797 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Fix NULL arg handling in setitimer/getitimer interceptors.
Evgeniy Stepanov [Tue, 6 Aug 2013 09:54:33 +0000 (09:54 +0000)]
[sanitizer] Fix NULL arg handling in setitimer/getitimer interceptors.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187789 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Intercept sched_getaffinity.
Evgeniy Stepanov [Tue, 6 Aug 2013 09:29:01 +0000 (09:29 +0000)]
[sanitizer] Intercept sched_getaffinity.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187788 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoLint fixes
Alexey Samsonov [Mon, 5 Aug 2013 13:20:39 +0000 (13:20 +0000)]
Lint fixes

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187726 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[msan] Allocator statistics interface and malloc hooks.
Evgeniy Stepanov [Fri, 2 Aug 2013 14:26:58 +0000 (14:26 +0000)]
[msan] Allocator statistics interface and malloc hooks.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187653 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[msan] Fix unused function warning in the tests.
Evgeniy Stepanov [Fri, 2 Aug 2013 09:09:02 +0000 (09:09 +0000)]
[msan] Fix unused function warning in the tests.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187648 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[lsan] Add leak_check_at_exit flag.
Sergey Matveev [Thu, 1 Aug 2013 14:57:07 +0000 (14:57 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187578 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[msan] Intercept setenv, putenv.
Evgeniy Stepanov [Thu, 1 Aug 2013 11:14:14 +0000 (11:14 +0000)]
[msan] Intercept setenv, putenv.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187575 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[msan] Fix msan tests with pipefail option.
Evgeniy Stepanov [Wed, 31 Jul 2013 09:14:55 +0000 (09:14 +0000)]
[msan] Fix msan tests with pipefail option.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187485 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Tweak read syscall handler signature for consistency.
Evgeniy Stepanov [Tue, 30 Jul 2013 13:16:52 +0000 (13:16 +0000)]
[sanitizer] Tweak read syscall handler signature for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187417 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] read() syscall hook.
Evgeniy Stepanov [Tue, 30 Jul 2013 13:04:43 +0000 (13:04 +0000)]
[sanitizer] read() syscall hook.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187414 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[msan] Intercept pthread_join.
Evgeniy Stepanov [Tue, 30 Jul 2013 12:54:34 +0000 (12:54 +0000)]
[msan] Intercept pthread_join.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187413 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[msan] Intercept confstr.
Evgeniy Stepanov [Tue, 30 Jul 2013 12:46:59 +0000 (12:46 +0000)]
[msan] Intercept confstr.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187412 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[asan] Limit fake stack size to a reasonable value when running with unlimited stack.
Evgeniy Stepanov [Tue, 30 Jul 2013 11:50:26 +0000 (11:50 +0000)]
[asan] Limit fake stack size to a reasonable value when running with unlimited stack.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187411 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[asan] Raise thread stack size limit.
Evgeniy Stepanov [Tue, 30 Jul 2013 09:01:18 +0000 (09:01 +0000)]
[asan] Raise thread stack size limit.

It's a sanity check, mostly, and we've seen threads with >256Mb stack.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187408 91177308-0d34-0410-b5e6-96231b3b80d8

11 months ago[sanitizer] Disable ForEachMappedRegion on Android.
Evgeniy Stepanov [Tue, 30 Jul 2013 08:39:16 +0000 (08:39 +0000)]
[sanitizer] Disable ForEachMappedRegion on Android.

It needs interface that is missing from the NDK, and it is not used on Android anyway.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187407 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoFix warning.
Peter Collingbourne [Mon, 29 Jul 2013 20:13:41 +0000 (20:13 +0000)]
Fix warning.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187373 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoMove UnpoisonMappedDSO to sanitizer_common.
Peter Collingbourne [Mon, 29 Jul 2013 19:09:49 +0000 (19:09 +0000)]
Move UnpoisonMappedDSO to sanitizer_common.

This is so DFSan will be able to use it.

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

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187372 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoTurn off pipefail on msan tests to match the other sanitizers until
Chandler Carruth [Sat, 27 Jul 2013 10:30:39 +0000 (10:30 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187298 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoDisable pipefail for lsan.
Rafael Espindola [Fri, 26 Jul 2013 23:42:16 +0000 (23:42 +0000)]
Disable pipefail for lsan.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187274 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agodisable pipefail for ubsan.
Rafael Espindola [Fri, 26 Jul 2013 23:40:17 +0000 (23:40 +0000)]
disable pipefail for ubsan.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187273 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agoDisable pipefail for ThreadSanitizer.
Rafael Espindola [Fri, 26 Jul 2013 23:38:18 +0000 (23:38 +0000)]
Disable pipefail for ThreadSanitizer.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187272 91177308-0d34-0410-b5e6-96231b3b80d8

11 months agodisable pipefail on asan for now.
Rafael Espindola [Fri, 26 Jul 2013 23:19:33 +0000 (23:19 +0000)]
disable pipefail on asan for now.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@187269 91177308-0d34-0410-b5e6-96231b3b80d8

12 months ago[sanitizer] Change strip_path_prefix flag behavior.
Sergey Matveev [Mon, 22 Jul 2013 16:14:38 +0000 (16:14 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186837 91177308-0d34-0410-b5e6-96231b3b80d8

12 months ago[lsan] Make __lsan_do_leak_check() honor the detect_leaks flag.
Sergey Matveev [Mon, 22 Jul 2013 12:38:17 +0000 (12:38 +0000)]
[lsan] Make __lsan_do_leak_check() honor the detect_leaks flag.

Also move detect_leaks to common flags.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186821 91177308-0d34-0410-b5e6-96231b3b80d8

12 months ago[lsan] Print direct leaks first.
Sergey Matveev [Mon, 22 Jul 2013 11:18:32 +0000 (11:18 +0000)]
[lsan] Print direct leaks first.

Direct leaks are higher priority, so it makes sense to have them on top.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186819 91177308-0d34-0410-b5e6-96231b3b80d8

12 months agoFix another instance of -ccc-cxx vs. --driver-mode=g++
Hans Wennborg [Thu, 18 Jul 2013 21:09:03 +0000 (21:09 +0000)]
Fix another instance of -ccc-cxx vs. --driver-mode=g++

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186609 91177308-0d34-0410-b5e6-96231b3b80d8

12 months agoUse --driver-mode=g++ instead of -ccc-cxx; required after Clang r186605
Hans Wennborg [Thu, 18 Jul 2013 20:48:50 +0000 (20:48 +0000)]
Use --driver-mode=g++ instead of -ccc-cxx; required after Clang r186605

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186607 91177308-0d34-0410-b5e6-96231b3b80d8

12 months ago[lsan] Add __lsan_do_leak_check() to the public interface.
Sergey Matveev [Thu, 18 Jul 2013 14:06:07 +0000 (14:06 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186581 91177308-0d34-0410-b5e6-96231b3b80d8

12 months agotsan: treat SIGSYS as synchronous signal
Dmitry Vyukov [Thu, 18 Jul 2013 13:14:11 +0000 (13:14 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186579 91177308-0d34-0410-b5e6-96231b3b80d8

12 months ago[ASan] Fix leaks in ASan tests found by LSan
Alexey Samsonov [Thu, 18 Jul 2013 12:59:52 +0000 (12:59 +0000)]
[ASan] Fix leaks in ASan tests found by LSan

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@186577 91177308-0d34-0410-b5e6-96231b3b80d8