tsan: ignore interceptors coming from specified libraries

LibIgnore allows to ignore all interceptors called from a particular set
of dynamic libraries. LibIgnore remembers all "called_from_lib" suppressions
from the provided SuppressionContext; finds code ranges for the libraries;
and checks whether the provided PC value belongs to the code ranges.

Also make malloc and friends interceptors use SCOPED_INTERCEPTOR_RAW instead of
SCOPED_TSAN_INTERCEPTOR, because if they are called from an ignored lib,
then must call our internal allocator instead of libc malloc.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191897 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: intercept _exit so that we can override exit status



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191898 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: fix false positive in localtime()



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191899 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: include lsan into presubmit check


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191902 91177308-0d34-0410-b5e6-96231b3b80d8
asan/msan/tsan: move _exit interceptor to common interceptors



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191903 91177308-0d34-0410-b5e6-96231b3b80d8
asan/msan: fix "unused function 'OnExit'" warning


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191904 91177308-0d34-0410-b5e6-96231b3b80d8
asan/msan/tsan: fix broken linux syscalls

Currently the following source code:

u64 NanoTime() {
  kernel_timeval tv = {};
  internal_syscall(__NR_gettimeofday, &tv, 0);
  return (u64)tv.tv_sec * 1000*1000*1000 + tv.tv_usec * 1000;
}

generates the following assembly:

Dump of assembler code for function __sanitizer::NanoTime():
=> 0x00007ff30657d380 <+0>:	lea    -0x10(%rsp),%rdi
   0x00007ff30657d385 <+5>:	xor    %esi,%esi
   0x00007ff30657d387 <+7>:	mov    $0x60,%eax
   0x00007ff30657d38c <+12>:	syscall 
   0x00007ff30657d38e <+14>:	mov    $0,%eax
   0x00007ff30657d393 <+19>:	retq   

with this change:

Dump of assembler code for function __sanitizer::NanoTime():
=> 0x00007faab834f380 <+0>:	movq   $0x0,-0x10(%rsp)
   0x00007faab834f389 <+9>:	movq   $0x0,-0x8(%rsp)
   0x00007faab834f392 <+18>:	lea    -0x10(%rsp),%rdi
   0x00007faab834f397 <+23>:	xor    %esi,%esi
   0x00007faab834f399 <+25>:	mov    $0x60,%eax
   0x00007faab834f39e <+30>:	syscall 
   0x00007faab834f3a0 <+32>:	mov    -0x8(%rsp),%rax
   0x00007faab834f3a5 <+37>:	mov    -0x10(%rsp),%rcx
   0x00007faab834f3aa <+42>:	imul   $0x3e8,%rax,%rdx
   0x00007faab834f3b1 <+49>:	imul   $0x3b9aca00,%rcx,%rax
   0x00007faab834f3b8 <+56>:	add    %rdx,%rax
   0x00007faab834f3bb <+59>:	retq   




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191908 91177308-0d34-0410-b5e6-96231b3b80d8
tsan: add memory_limit_mb flag

The flag allows to bound maximum process memory consumption (best effort).
If RSS reaches memory_limit_mb, tsan flushes all shadow memory.



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191913 91177308-0d34-0410-b5e6-96231b3b80d8
Refactor the usage of strip_path_prefix option and make it more consistent across sanitizers

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