native_client/pnacl-compiler-rt.git
4 days agoMove PNaCl files into lib/builtins along with the sources they refer to. master
Derek Schuff [Wed, 28 Jan 2015 19:17:39 +0000 (11:17 -0800)]
Move PNaCl files into lib/builtins along with the sources they refer to.

4 days agoAdd missing PNaCl files
Derek Schuff [Sat, 24 Jan 2015 00:48:19 +0000 (16:48 -0800)]
Add missing PNaCl files

This is the diff between e586cb34ca768cb1c5170c6ca5865ca5333b3c6e (our
current master branch) and f1fd6b6a05f1d0e4bb408123a83e4a132cc16d38 (the
merge-base with upstream). The old history was based on a git-svn branch
I managed manually because there was no official git mirror.

Now that there is a llvm.org git mirror (http://llvm.org/git/compiler-rt.git),
I have added its history to our repo and have applied our local changes
to it (just new files; there are no modifications to existing files AFAIK).

9 days ago[sanitizer] Update descriptor size for glibc 2.13.
Sergey Matveev [Fri, 23 Jan 2015 21:12:39 +0000 (21:12 +0000)]
[sanitizer] Update descriptor size for glibc 2.13.

See https://code.google.com/p/address-sanitizer/issues/detail?id=361

It's still not clear whether the values are correct in all cases, but at least
this should unbreak our bots.

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

9 days ago[compiler-rt] Ensure AsanInitFromRtl is called from a static initializer on OS X...
Kuba Brecka [Fri, 23 Jan 2015 19:29:19 +0000 (19:29 +0000)]
[compiler-rt] Ensure AsanInitFromRtl is called from a static initializer on OS X by using ASAN_DYNAMIC=1

The idea is to ensure that the ASan runtime gets initialized early (i.e.
before other initializers/constructors) even when DYLD_INSERT_LIBRARIES
is not used. In that case, the interceptors are not installed (on OS X,
DYLD_INSERT_LIBRARIES is required for interceptors to work), and therefore
ASan gets currently initialized quite late -- from the main executable's
module initializer. The following issues are a consequence of this:

  https://code.google.com/p/address-sanitizer/issues/detail?id=363
  https://code.google.com/p/address-sanitizer/issues/detail?id=357

Both of them are fixed with this patch.

Reviewed at http://reviews.llvm.org/D7117

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

9 days ago[compiler-rt] Fix the prototype of ioctl interceptor
Kuba Brecka [Fri, 23 Jan 2015 19:17:20 +0000 (19:17 +0000)]
[compiler-rt] Fix the prototype of ioctl interceptor

The interceptor of ioctl is using a non-standard prototype:

  INTERCEPTOR(int, ioctl, int d, unsigned request, void *arg)

At least on OS X, the request argument should be unsigned long and not
just unsigned, and also instead of the last argument (arg), the function
should be accepting a variable number of arguments, so the prototype
should be:

  int ioctl(int fildes, unsigned long request, ...);

We can still keep using `unsigned` internally to save space, because we
know that all possible values of `request` will fit into it.

Reviewed at http://reviews.llvm.org/D7038

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

9 days ago[sanitizer] Fix an edge case in MemoryRangeIsAvailable.
Evgeniy Stepanov [Fri, 23 Jan 2015 15:14:27 +0000 (15:14 +0000)]
[sanitizer] Fix an edge case in MemoryRangeIsAvailable.

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

9 days ago[Sanitizers] Intercept statfs() on FreeBSD
Viktor Kutuzov [Fri, 23 Jan 2015 14:39:23 +0000 (14:39 +0000)]
[Sanitizers] Intercept statfs() on FreeBSD
Committed unreviewed with permission.

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

10 days agoFix the extra whitespace from r226878.
Kuba Brecka [Fri, 23 Jan 2015 00:14:22 +0000 (00:14 +0000)]
Fix the extra whitespace from r226878.

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

10 days agoFix/workaround for OS X truncated stacktraces taken by external tools
Kuba Brecka [Thu, 22 Jan 2015 23:36:47 +0000 (23:36 +0000)]
Fix/workaround for OS X truncated stacktraces taken by external tools

This patch is a proposed solution for https://code.google.com/p/address-sanitizer/issues/detail?id=375:

When the stacktraces are captured and printed by ASan itself, they are fine, but when the program has already printed the report (or is just printing it), capturing a stacktrace via other means is broken. "Other means" include OS X CrashReporter, debuggers or calling backtrace() within the program. For example calling backtrace() from a sanitizer_set_death_callback function prints a very truncated stacktrace.

Reviewed at http://reviews.llvm.org/D7103

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

10 days ago[sanitizer] Move sched_getparam test under Linux/.
Evgeniy Stepanov [Thu, 22 Jan 2015 15:34:50 +0000 (15:34 +0000)]
[sanitizer] Move sched_getparam test under Linux/.

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

10 days ago[ASan/Win] Fix PR20944 -- run ASan gtests as part of check-asan on Windows
Timur Iskhodzhanov [Thu, 22 Jan 2015 14:54:22 +0000 (14:54 +0000)]
[ASan/Win] Fix PR20944 -- run ASan gtests as part of check-asan on Windows

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

10 days agotsan: use hacky call only on x86_64
Dmitry Vyukov [Thu, 22 Jan 2015 14:13:56 +0000 (14:13 +0000)]
tsan: use hacky call only on x86_64

required for mips64 and aarch64 ports

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

10 days ago[sanitizer] Intercept sched_getparam.
Evgeniy Stepanov [Thu, 22 Jan 2015 14:03:07 +0000 (14:03 +0000)]
[sanitizer] Intercept sched_getparam.

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

10 days ago[sanitizer] Fix windows build.
Evgeniy Stepanov [Thu, 22 Jan 2015 13:47:12 +0000 (13:47 +0000)]
[sanitizer] Fix windows build.

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

10 days ago[msan] Better use-after-free reports.
Evgeniy Stepanov [Thu, 22 Jan 2015 13:33:16 +0000 (13:33 +0000)]
[msan] Better use-after-free reports.

By attaching an extra integer tag to heap origins, we are able
to distinguish between uninits
 - created by heap allocation,
 - created by heap deallocation (i.e. use-after-free),
 - created by __msan_allocated_memory call,
 - etc.

See https://code.google.com/p/memory-sanitizer/issues/detail?id=35.

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

10 days ago[ASan/Win] Move the shadow to 0x30000000
Timur Iskhodzhanov [Thu, 22 Jan 2015 12:24:21 +0000 (12:24 +0000)]
[ASan/Win] Move the shadow to 0x30000000

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

10 days ago[ASan] Print out the shadow memory range on shadow mapping failures
Timur Iskhodzhanov [Thu, 22 Jan 2015 12:05:27 +0000 (12:05 +0000)]
[ASan] Print out the shadow memory range on shadow mapping failures

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

10 days ago[msan] Relax CHECK conditions in 2 tests.
Evgeniy Stepanov [Thu, 22 Jan 2015 09:27:00 +0000 (09:27 +0000)]
[msan] Relax CHECK conditions in 2 tests.

Sometimes malloc/realloc/etc are symbolized as
__interceptor_malloc/realloc/etc.

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

10 days ago[Msan] Fix the readv and preadv unit tests to pass on FreeBSD
Viktor Kutuzov [Thu, 22 Jan 2015 09:00:46 +0000 (09:00 +0000)]
[Msan] Fix the readv and preadv unit tests to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D7091

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

10 days ago[Msan] Fix the strerror_r unit test to build on FreeBSD
Viktor Kutuzov [Thu, 22 Jan 2015 08:57:59 +0000 (08:57 +0000)]
[Msan] Fix the strerror_r unit test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D7089

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

10 days ago[Msan] Fix the DynRet unit test to build on FreeBSD
Viktor Kutuzov [Thu, 22 Jan 2015 08:54:03 +0000 (08:54 +0000)]
[Msan] Fix the DynRet unit test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D7086

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

10 days ago[Sanitizers] Fix inet_aton() and inet_pton() interceptors to work on FreeBSD
Viktor Kutuzov [Thu, 22 Jan 2015 08:51:07 +0000 (08:51 +0000)]
[Sanitizers] Fix inet_aton() and inet_pton() interceptors to work on FreeBSD
Differential Revision: http://reviews.llvm.org/D7084

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

10 days ago[Sanitizers] Intercept preadv() on FreeBSD
Viktor Kutuzov [Thu, 22 Jan 2015 08:47:54 +0000 (08:47 +0000)]
[Sanitizers] Intercept preadv() on FreeBSD
Committed unreviewed with permission.

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

11 days ago[msan] Fix origins in realloc.
Evgeniy Stepanov [Wed, 21 Jan 2015 16:48:29 +0000 (16:48 +0000)]
[msan] Fix origins in realloc.

Fixes 2 issues in origins arising from realloc() calls:
 * In the in-place grow case origin for the new memory is not set at all.
 * In the copy-realloc case __msan_memcpy is used, which unwinds stack from
   inside the MSan runtime. This does not generally work (as we may be built
   w/o frame pointers), and produces "bad" stack trace anyway, with several
   uninteresting (internal) frames on top.

This change also makes realloc() honor "zeroise" and "poison_in_malloc" flags.

See https://code.google.com/p/memory-sanitizer/issues/detail?id=73.

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

11 days ago[msan] Refactor shadow operations.
Evgeniy Stepanov [Wed, 21 Jan 2015 16:42:30 +0000 (16:42 +0000)]
[msan] Refactor shadow operations.

Move a bunch of functions to a new source file and rename some of them for
consistency. No functional changes.

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

11 days agotsan: remove sleeps from tests
Dmitry Vyukov [Wed, 21 Jan 2015 13:50:02 +0000 (13:50 +0000)]
tsan: remove sleeps from tests

Even sleep(1) lead to episodical flakes on some machines.
Use an invisible by tsan barrier to enforce required execution order instead.
This makes the tests deterministic and faster.

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

11 days ago[msan] Update origin for the entire destination range on memory store.
Evgeniy Stepanov [Wed, 21 Jan 2015 13:21:31 +0000 (13:21 +0000)]
[msan] Update origin for the entire destination range on memory store.

Previously we always stored 4 bytes of origin at the destination address
even for 8-byte (and longer) stores.

This should fix rare missing, or incorrect, origin stacks in MSan reports.

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

11 days ago[ASan] Fix the test expectations for dyld_insert_libraries_reexec.cc
Alexander Potapenko [Wed, 21 Jan 2015 10:04:41 +0000 (10:04 +0000)]
[ASan] Fix the test expectations for dyld_insert_libraries_reexec.cc

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

11 days ago[Msan] Fix the accept unit test to pass on FreeBSD
Viktor Kutuzov [Wed, 21 Jan 2015 09:46:21 +0000 (09:46 +0000)]
[Msan] Fix the accept unit test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D7083

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

11 days ago[Sanitizers] Intercept confstr() on FreeBSD
Viktor Kutuzov [Wed, 21 Jan 2015 08:56:40 +0000 (08:56 +0000)]
[Sanitizers] Intercept confstr() on FreeBSD
Committed unreviewed with permission.

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

11 days ago[Sanitizers] Intercept opendir()
Viktor Kutuzov [Wed, 21 Jan 2015 08:54:01 +0000 (08:54 +0000)]
[Sanitizers] Intercept opendir()
Differential Revision: http://reviews.llvm.org/D6968

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

11 days agotsan: don't unroll memory access loop in debug mode
Dmitry Vyukov [Wed, 21 Jan 2015 08:09:13 +0000 (08:09 +0000)]
tsan: don't unroll memory access loop in debug mode

MemoryAccess function consumes ~4K of stack in debug mode,
in significant part due to the unrolled loop.
And gtest gives only 4K of stack to death test
threads, which causes stack overflows in debug mode.

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

11 days ago[sanitizer] First step toward supporting 42-bit AS on aarch64
Kostya Serebryany [Wed, 21 Jan 2015 02:11:05 +0000 (02:11 +0000)]
[sanitizer] First step toward supporting 42-bit AS on aarch64

aarch64-linux kernel has configurable 39, 42 or 47 bit virtual address
space.  Most distros AFAIK use 42-bit VA right now, but there are also
39-bit VA users too.  The ppc64 handling can be used for this just fine
and support all the 3 sizes.

There are other issues, like allocator32 not really being able to support
the larger addres spaces, and hardcoded 39-bit address space size in other
macros.

Patch by Jakub Jelinek.

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

11 days agoMuch spelling. Wow.
Nico Weber [Wed, 21 Jan 2015 02:09:16 +0000 (02:09 +0000)]
Much spelling. Wow.

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

11 days ago[sanitizer] Fix aarch64 sanitizer build with recent glibc
Kostya Serebryany [Wed, 21 Jan 2015 02:08:42 +0000 (02:08 +0000)]
[sanitizer] Fix aarch64 sanitizer build with recent glibc

glibc recently changed ABI on aarch64-linux:
https://sourceware.org/git/?p=glibc.git;a=commit;h=5c40c3bab2fddaca8cfe12d75944d1fef8adf1a4
Instead of having unsigned short mode; unsigned short __pad1; it now has
unsigned int mode; field in ipc_perm structure.

This patch allows to build against the recent glibc and disables the
ipc_perm.mode verification for older versions of glibc.

I think it shouldn't be a big deal even for older glibcs, I couldn't find
any place which would actually care about the exact mode field, rather than
the whole structure, appart from the CHECK_SIZE_AND_OFFSET macro.

Patch by Jakub Jelinek

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

11 days ago[asan] use MADV_NOHUGEPAGE for shadow to reduce the actual memory usage
Kostya Serebryany [Wed, 21 Jan 2015 02:05:31 +0000 (02:05 +0000)]
[asan] use MADV_NOHUGEPAGE for shadow to reduce the actual memory usage

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

12 days ago[MIPS64] Make __clear_cache more optimal
Petar Jovanovic [Tue, 20 Jan 2015 15:04:19 +0000 (15:04 +0000)]
[MIPS64] Make __clear_cache more optimal

Use synci implementation of clear_cache for short address ranges.
For long address ranges, make a kernel call.

Differential Revision: http://reviews.llvm.org/D6661

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

12 days ago[asan] Allow changing verbosity in activation flags.
Evgeniy Stepanov [Tue, 20 Jan 2015 13:21:20 +0000 (13:21 +0000)]
[asan] Allow changing verbosity in activation flags.

This change removes some debug output in asan_flags.cc that
was reading the verbosity level before all the flags were parsed.

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

12 days ago[asan] Warn if unsupported flags are used at activation.
Evgeniy Stepanov [Tue, 20 Jan 2015 12:19:14 +0000 (12:19 +0000)]
[asan] Warn if unsupported flags are used at activation.

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

12 days ago[Msan] Fix the readlink unit test to pass on FreeBSD
Viktor Kutuzov [Tue, 20 Jan 2015 09:57:28 +0000 (09:57 +0000)]
[Msan] Fix the readlink unit test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D7052

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

13 days agotsan: remove TSAN_SHADOW_COUNT
Dmitry Vyukov [Mon, 19 Jan 2015 15:01:07 +0000 (15:01 +0000)]
tsan: remove TSAN_SHADOW_COUNT

TSAN_SHADOW_COUNT is defined to 4 in all environments.
Other values of TSAN_SHADOW_COUNT were never tested and
were broken by recent changes to shadow mapping.
Remove it as there is no reason to fix nor maintain it.

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

13 days ago[Sanitizers] Intercept statvfs() on FreeBSD
Viktor Kutuzov [Mon, 19 Jan 2015 13:26:25 +0000 (13:26 +0000)]
[Sanitizers] Intercept statvfs() on FreeBSD
Committed unreviewed with permission.

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

13 days ago[Msan] Intercept stat() and fstatat() on FreeBSD
Viktor Kutuzov [Mon, 19 Jan 2015 13:22:33 +0000 (13:22 +0000)]
[Msan] Intercept stat() and fstatat() on FreeBSD
Differential Revision: http://reviews.llvm.org/D7051

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

13 days ago[sanitizer] Make unrecognized flags not fatal.
Evgeniy Stepanov [Mon, 19 Jan 2015 12:22:57 +0000 (12:22 +0000)]
[sanitizer] Make unrecognized flags not fatal.

Print a warning at verbosity=1 and higher instead of dying immediately.

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

13 days ago[sanitizer] Switch flag parsing to LowLevelAlloc.
Evgeniy Stepanov [Mon, 19 Jan 2015 11:47:13 +0000 (11:47 +0000)]
[sanitizer] Switch flag parsing to LowLevelAlloc.

InternalAlloc is quite complex and its behavior may depend on the values of
flags. As such, it should not be used while parsing flags.

Sadly, LowLevelAlloc does not support deallocation of memory.

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

13 days ago[sanitizer] Simplify code in flag parser.
Evgeniy Stepanov [Mon, 19 Jan 2015 10:54:36 +0000 (10:54 +0000)]
[sanitizer] Simplify code in flag parser.

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

13 days ago[Sanitizers] Order initialization of coverage and guard arrays
Viktor Kutuzov [Mon, 19 Jan 2015 09:41:52 +0000 (09:41 +0000)]
[Sanitizers] Order initialization of coverage and guard arrays
Differential Revision: http://reviews.llvm.org/D6892

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

13 days ago[sanitizer] Move options-related tests to sanitizer_common.
Evgeniy Stepanov [Mon, 19 Jan 2015 09:21:44 +0000 (09:21 +0000)]
[sanitizer] Move options-related tests to sanitizer_common.

And handle help=1 in standalone LSan.

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

13 days ago[msan] Use internal__exit() instead of _exit().
Evgeniy Stepanov [Mon, 19 Jan 2015 09:20:28 +0000 (09:20 +0000)]
[msan] Use internal__exit() instead of _exit().

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

13 days ago[dfsan] Use append_no_rtti_flag instead of manually specifying -fno-rtti.
Evgeniy Stepanov [Mon, 19 Jan 2015 08:26:38 +0000 (08:26 +0000)]
[dfsan] Use append_no_rtti_flag instead of manually specifying -fno-rtti.

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

2 weeks agoUpdate for tests failing due to improvements in clang's column information for aggreg...
David Blaikie [Sun, 18 Jan 2015 02:17:55 +0000 (02:17 +0000)]
Update for tests failing due to improvements in clang's column information for aggregate expressions

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

2 weeks ago[sanitizer] Adjust max read size in FlagHandlerInclude
Hal Finkel [Sat, 17 Jan 2015 03:31:43 +0000 (03:31 +0000)]
[sanitizer] Adjust max read size in FlagHandlerInclude

Setting the maximum read size in FlagHandlerInclude to 2^15 might be a good
default, but causes the read to fail on systems with a page size larger than
that (ReadFileToBuffer(...) will fail if the maximum allowed size is less than
the value returned by GetPageSizeCached()). For example, on my PPC64/Linux
system, GetPageSizeCached() returns 2^16. In case the page size is larger, use
that instead.

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

2 weeks agoInstrProf: Optionally print an error when emitting profile data fails
Justin Bogner [Fri, 16 Jan 2015 20:10:56 +0000 (20:10 +0000)]
InstrProf: Optionally print an error when emitting profile data fails

Debugging a missing profile is a bit painful right now. We can make
people's lives a bit easier by adding a knob to enable printing a
helpful error message for such failures.

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

2 weeks ago[sanitizer] Additional error checking.
Evgeniy Stepanov [Fri, 16 Jan 2015 15:25:16 +0000 (15:25 +0000)]
[sanitizer] Additional error checking.

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

2 weeks ago[Sanitizers] Intercept clock_gettime() on FreeBSD
Viktor Kutuzov [Fri, 16 Jan 2015 14:54:39 +0000 (14:54 +0000)]
[Sanitizers] Intercept clock_gettime() on FreeBSD
Committed unreviewed with permission.

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

2 weeks ago[Sanitizers] Intercept lgamma_r() on FreeBSD
Viktor Kutuzov [Fri, 16 Jan 2015 14:52:17 +0000 (14:52 +0000)]
[Sanitizers] Intercept lgamma_r() on FreeBSD
Committed unreviewed with permission.

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

2 weeks ago[asan] Change detection of allow_user_segv_handler on Android.
Evgeniy Stepanov [Fri, 16 Jan 2015 13:12:22 +0000 (13:12 +0000)]
[asan] Change detection of allow_user_segv_handler on Android.

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

2 weeks ago[asan] More verbose output from one of the tests.
Evgeniy Stepanov [Fri, 16 Jan 2015 12:08:32 +0000 (12:08 +0000)]
[asan] More verbose output from one of the tests.

Trying to debug a buildbot-only failure.

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

2 weeks ago[asan] Fix asan_options-include test.
Evgeniy Stepanov [Fri, 16 Jan 2015 10:30:53 +0000 (10:30 +0000)]
[asan] Fix asan_options-include test.

Wrong include order.

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

2 weeks ago[sanitizer] Fix bashism in check_lint.sh.
Evgeniy Stepanov [Fri, 16 Jan 2015 10:20:49 +0000 (10:20 +0000)]
[sanitizer] Fix bashism in check_lint.sh.

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

2 weeks ago[sanitizer] Cleanup linter temporary files.
Evgeniy Stepanov [Fri, 16 Jan 2015 10:09:56 +0000 (10:09 +0000)]
[sanitizer] Cleanup linter temporary files.

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

2 weeks ago[sanitizer] Fix compiler warning in the flag parser code.
Evgeniy Stepanov [Fri, 16 Jan 2015 09:32:31 +0000 (09:32 +0000)]
[sanitizer] Fix compiler warning in the flag parser code.

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

2 weeks ago[asan] Loosen test for upcoming ppc64 change
Hal Finkel [Thu, 15 Jan 2015 20:48:38 +0000 (20:48 +0000)]
[asan] Loosen test for upcoming ppc64 change

This test casts 0x4 to a function pointer and calls it. Unfortunately, the
faulting address may not exactly be 0x4 on PPC64 ELFv1 systems. The LLVM PPC
backend used to always generate the loads "in order", so we'd fault at 0x4
anyway. However, at upcoming change to loosen that ordering, and we'll pick a
different order on some targets. As a result, as explained in the comment, we
need to allow for certain nearby addresses as well.

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

2 weeks ago[sanitizer] Restore -fno-lto accidentally removed in r226169.
Evgeniy Stepanov [Thu, 15 Jan 2015 16:31:22 +0000 (16:31 +0000)]
[sanitizer] Restore -fno-lto accidentally removed in r226169.

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

2 weeks ago[sanitizer] Implement include= option.
Evgeniy Stepanov [Thu, 15 Jan 2015 16:26:59 +0000 (16:26 +0000)]
[sanitizer] Implement include= option.

Allows loading sanitizer options from file.

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

2 weeks ago[sanitizer] Flag parser rewrite.
Evgeniy Stepanov [Thu, 15 Jan 2015 15:13:43 +0000 (15:13 +0000)]
[sanitizer] Flag parser rewrite.

The new parser is a lot stricter about syntax, reports unrecognized
flags, and will make it easier to implemented some of the planned features.

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

2 weeks ago[lsan] Fix a typo in a test.
Evgeniy Stepanov [Thu, 15 Jan 2015 15:00:49 +0000 (15:00 +0000)]
[lsan] Fix a typo in a test.

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

2 weeks agoFix compilation of compiler_rt against libunwind.
Evgeniy Stepanov [Thu, 15 Jan 2015 14:27:38 +0000 (14:27 +0000)]
Fix compilation of compiler_rt against libunwind.

libunwind defines _Unwind_GetLanguageSpecificData as returning long
instead of (uint8_t *).

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

2 weeks agobuiltins: avoid duplicating unwind declarations
Saleem Abdulrasool [Wed, 14 Jan 2015 15:55:17 +0000 (15:55 +0000)]
builtins: avoid duplicating unwind declarations

Use unwind.h to get the declarations for unwinding interfaces.  This header is
already provided by clang and gcc, so this adds no additional dependencies for
building the builtins library.  It avoids the duplication which may drift over
time though.

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

2 weeks ago[Msan] Fix strlen() and strnlen() interceptors to work on FreeBSD
Viktor Kutuzov [Wed, 14 Jan 2015 14:59:46 +0000 (14:59 +0000)]
[Msan] Fix strlen() and strnlen() interceptors to work on FreeBSD
Differential Revision: http://reviews.llvm.org/D6928

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

2 weeks agoReapply debug info changes now that more precise column information is available.
David Blaikie [Wed, 14 Jan 2015 07:59:48 +0000 (07:59 +0000)]
Reapply debug info changes now that more precise column information is available.

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

2 weeks agoAnother try at handling LD_LIBRARY_PATH not being defined.
Rafael Espindola [Wed, 14 Jan 2015 02:23:27 +0000 (02:23 +0000)]
Another try at handling LD_LIBRARY_PATH not being defined.

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

2 weeks agoHandle LD_LIBRARY_PATH not being defined.
Rafael Espindola [Wed, 14 Jan 2015 01:28:08 +0000 (01:28 +0000)]
Handle LD_LIBRARY_PATH not being defined.

Should fix the bots after r225890.

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

2 weeks agoUpdate test cases for new -fsanitize-recover= semantics.
Alexey Samsonov [Mon, 12 Jan 2015 23:02:42 +0000 (23:02 +0000)]
Update test cases for new -fsanitize-recover= semantics.

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

2 weeks ago[dfsan] Export dfsan_get_label_info function with C linkage.
Peter Collingbourne [Mon, 12 Jan 2015 20:40:30 +0000 (20:40 +0000)]
[dfsan] Export dfsan_get_label_info function with C linkage.

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

2 weeks ago[Msan] Fix use of mmap(MAP_ANONYMOUS) in the unit tests on FreeBSD
Viktor Kutuzov [Mon, 12 Jan 2015 20:18:38 +0000 (20:18 +0000)]
[Msan] Fix use of mmap(MAP_ANONYMOUS) in the unit tests on FreeBSD
Differential Revision: http://reviews.llvm.org/D6929

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

2 weeks ago[Msan] Fix tests reading /proc files on FreeBSD
Viktor Kutuzov [Mon, 12 Jan 2015 20:15:33 +0000 (20:15 +0000)]
[Msan] Fix tests reading /proc files on FreeBSD
Differential Revision: http://reviews.llvm.org/D6926

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

2 weeks ago[ASan] Move the shadow on Windows 32-bit from 0x20000000 to 0x40000000
Timur Iskhodzhanov [Mon, 12 Jan 2015 17:38:58 +0000 (17:38 +0000)]
[ASan] Move the shadow on Windows 32-bit from 0x20000000 to 0x40000000

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

2 weeks ago[asan] Fix uninit in coverage.
Evgeniy Stepanov [Mon, 12 Jan 2015 17:13:20 +0000 (17:13 +0000)]
[asan] Fix uninit in coverage.

pc_fd was not initialized to (-1) on some code paths, resulting in the program
erroneously closing stdin when reinitializing coverage.

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

2 weeks ago[asan] Pass activation options in the android test runner.
Evgeniy Stepanov [Mon, 12 Jan 2015 17:10:05 +0000 (17:10 +0000)]
[asan] Pass activation options in the android test runner.

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

2 weeks agoFix two extra semicolon warnings
Ehsan Akhgari [Mon, 12 Jan 2015 17:03:02 +0000 (17:03 +0000)]
Fix two extra semicolon warnings

Reviewers: timurrrr

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6890

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

2 weeks ago[ASan] Handle SIGBUS on Linux.
Jay Foad [Mon, 12 Jan 2015 13:46:37 +0000 (13:46 +0000)]
[ASan] Handle SIGBUS on Linux.

Summary:
On Linux in some situations we can get SIGBUS instead of SIGSEGV on
stack overflow, so asan should handle SIGBUS as well as SIGSEGV.

https://code.google.com/p/address-sanitizer/issues/detail?id=369

Reviewers: samsonov, glider

Reviewed By: glider

Subscribers: glider, llvm-commits

Differential Revision: http://reviews.llvm.org/D6923

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

3 weeks agoAdd FreeBSD support for __clear_cache.
Roman Divacky [Sun, 11 Jan 2015 18:21:11 +0000 (18:21 +0000)]
Add FreeBSD support for __clear_cache.

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

3 weeks agoRevert "Reapply debug info changes now that more precise column information is availa...
David Blaikie [Fri, 9 Jan 2015 23:27:12 +0000 (23:27 +0000)]
Revert "Reapply debug info changes now that more precise column information is available."

While the clang patch is reverted pending investigation/fixes.

This reverts commit r225001.

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

3 weeks agoRemove AsanInterceptsSignal in favor of (equivalent) IsDeadlySignal.
Alexey Samsonov [Fri, 9 Jan 2015 23:03:31 +0000 (23:03 +0000)]
Remove AsanInterceptsSignal in favor of (equivalent) IsDeadlySignal.

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

3 weeks ago[sanitizer] use the right memory order
Kostya Serebryany [Fri, 9 Jan 2015 21:01:34 +0000 (21:01 +0000)]
[sanitizer] use the right memory order

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

3 weeks ago[asan] Adding a regression test for https://code.google.com/p/address-sanitizer/issue...
Kuba Brecka [Fri, 9 Jan 2015 00:26:45 +0000 (00:26 +0000)]
[asan] Adding a regression test for https://code.google.com/p/address-sanitizer/issues/detail?id=368

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

3 weeks ago[asan] make a test consume 2x less RAM (we observe flaky bot failures that seem like...
Kostya Serebryany [Thu, 8 Jan 2015 23:37:09 +0000 (23:37 +0000)]
[asan] make a test consume 2x less RAM (we observe flaky bot failures that seem like OOMs)

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

3 weeks agoFix memory leaks in GetListOfModules() users.
Alexey Samsonov [Thu, 8 Jan 2015 22:31:14 +0000 (22:31 +0000)]
Fix memory leaks in GetListOfModules() users.

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

3 weeks ago[Sanitizer] Remove the hardcoded limit of address ranges in LoadedModule.
Alexey Samsonov [Thu, 8 Jan 2015 22:03:05 +0000 (22:03 +0000)]
[Sanitizer] Remove the hardcoded limit of address ranges in LoadedModule.

This should fix https://code.google.com/p/address-sanitizer/issues/detail?id=368.

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

3 weeks ago[Sanitizers] Fix internal_lseek() to work on FreeBSD
Viktor Kutuzov [Thu, 8 Jan 2015 13:28:22 +0000 (13:28 +0000)]
[Sanitizers] Fix internal_lseek() to work on FreeBSD
Differential Revision: http://reviews.llvm.org/D6825

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

3 weeks agoXFAIL AArch64 UBsan test, just like ARM
Renato Golin [Wed, 7 Jan 2015 20:03:47 +0000 (20:03 +0000)]
XFAIL AArch64 UBsan test, just like ARM

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

3 weeks ago[asan] add flag quarantine_size_mb, deprecate quarantine_size
Kostya Serebryany [Wed, 7 Jan 2015 02:37:52 +0000 (02:37 +0000)]
[asan] add flag quarantine_size_mb, deprecate quarantine_size

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

3 weeks ago[TSan] Fix Go build.
Alexey Samsonov [Wed, 7 Jan 2015 02:12:41 +0000 (02:12 +0000)]
[TSan] Fix Go build.

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

3 weeks ago[Sanitizer] Change the runtime flag representation.
Alexey Samsonov [Wed, 7 Jan 2015 00:38:00 +0000 (00:38 +0000)]
[Sanitizer] Change the runtime flag representation.

This mirrors r225239 to all the rest sanitizers:
ASan, DFSan, LSan, MSan, TSan, UBSan.

Now the runtime flag type, name, default value and
description is located in the single place in the
.inc file.

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

3 weeks ago[asan] add a flag soft_rss_limit_mb
Kostya Serebryany [Tue, 6 Jan 2015 23:53:32 +0000 (23:53 +0000)]
[asan] add a flag soft_rss_limit_mb

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

3 weeks ago[Sanitizer] Improve unit tests in COMPILER_RT_DEBUG=ON mode.
Alexey Samsonov [Tue, 6 Jan 2015 20:58:40 +0000 (20:58 +0000)]
[Sanitizer] Improve unit tests in COMPILER_RT_DEBUG=ON mode.

Propagate -DSANITIZER_DEBUG definition to unit tests.
Make sure unit tests depend on compiler-rt headers.

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

3 weeks agoUse -DSANITIZER_DEBUG=1 if COMPILER_RT_DEBUG=ON, now that PR22083 is fixed.
Alexey Samsonov [Tue, 6 Jan 2015 20:25:34 +0000 (20:25 +0000)]
Use -DSANITIZER_DEBUG=1 if COMPILER_RT_DEBUG=ON, now that PR22083 is fixed.

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

3 weeks ago[ubsan] disable coverage-levels.cc on darwin until we can investigate what's wrong...
Kostya Serebryany [Tue, 6 Jan 2015 18:48:49 +0000 (18:48 +0000)]
[ubsan] disable coverage-levels.cc on darwin until we can investigate what's wrong there.

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

3 weeks ago[asan] Bump the self-imposed stack limit from 128k to 256k. PowerPC64
Jay Foad [Tue, 6 Jan 2015 10:01:15 +0000 (10:01 +0000)]
[asan] Bump the self-imposed stack limit from 128k to 256k. PowerPC64
Linux has 64k pages, so the old limit was only two pages. With ASLR the
initial sp might be right at the start of the second page, so the stack
will immediately grow down into the first page; and if you use all pages
of a limited stack then asan hits a kernel bug to do with how stack
guard pages are reported in /proc/self/maps:
http://lkml.iu.edu//hypermail/linux/kernel/1501.0/01025.html

We should still fix the underlying problems, but in the mean time this
patch makes the test work with 64k pages as well as it does with 4k
pages.

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