Commit Graph

6671 Commits

Author SHA1 Message Date
Mohit K. Bhakkad 72c3cce484 [Compiler-rt][MSan]Fix shmat testcase: Pass SHMLBA-alligned address to shmat
Reviewers: samsonov

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 261837
2016-02-25 08:07:44 +00:00
Saleem Abdulrasool 2b972dfebb builtins: adjust the clobbers list for android __clear_cache
Adjust the clobbers list.  This use to work with older versions of gcc, but now
will error on newer versions (tested against 5.3) (as well as clang).

Patch by Tee Hao Wei!

llvm-svn: 261821
2016-02-25 04:04:37 +00:00
Chris Bieneman e8c7d77955 [CMake] Fix a really simple, silly bug from r261797
This should fix bots with CMake older than 2.8.12.

llvm-svn: 261801
2016-02-24 22:42:47 +00:00
Chris Bieneman 956eceae9f [CMake] Default CMAKE_MACOSX_RPATH to On, this is the default with CMP0042
Summary: Building the sanitizer libraries without rpaths causes all sorts of problems when you try to use them. This simple fix should make it all work.

Reviewers: samsonov, zaks.anna

Subscribers: llvm-commits

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

llvm-svn: 261797
2016-02-24 22:29:42 +00:00
Sagar Thakur b6917b42f4 [MSAN] Fix memcmp_test on MIPS
Summary: As per the test the 4th element of both arrays are not initialized and hence will contain garbage values. Memcmp returns the difference between the garbage values of the 4th element which will be different on every run of the test. And since the return value of memcmp is returned from main, we are getting random exit code every time.

Reviewers: kcc, eugenis
Subscribers: mohit.bhakkad, jaydeep, llvm-commits
Differential: http://reviews.llvm.org/D17534
llvm-svn: 261739
2016-02-24 13:48:14 +00:00
Dmitry Vyukov cb35474ba5 tsan: disable ignore_lib4.cc test on powerpc64 and aarch64
Fails on bots:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/1555/steps/ninja%20check%201/logs/FAIL%3A%20ThreadSanitizer-powerpc64%3A%3A%20ignore_lib4.cc
http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/725/steps/ninja%20check-tsan/logs/stdio
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/1468/steps/ninja%20check%202/logs/FAIL%3A%20ThreadSanitizer-aarch64%3A%3A%20ignore_lib4.cc
http://lab.llvm.org:8011/builders/clang-native-aarch64-full/builds/2787/steps/ninja%20check%202/logs/FAIL%3A%20ThreadSanitizer-aarch64%3A%3A%20ignore_lib4.cc

llvm-svn: 261728
2016-02-24 09:14:46 +00:00
Mohit K. Bhakkad 2c56f33dbf [MSan] fix process_vm_readv test: Exit silently if syscall is not implemeted
Reviewers: eugenis

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 261723
2016-02-24 08:14:41 +00:00
Mohit K. Bhakkad 28bb3d9046 [MSan] Mark dlerror.cc expected failure for MIPS
Reviewers: samsonov

Subscribers: jaydeep, sagar, llvm-commits, aemerson

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

llvm-svn: 261721
2016-02-24 07:08:33 +00:00
Alexey Samsonov ee7023f79a [tests] Portability fixup for r261713.
llvm-svn: 261715
2016-02-24 01:28:51 +00:00
Alexey Samsonov 0dc3d24d5d [tests] Resolve old TODOs in ASan unit tests.
llvm-svn: 261713
2016-02-24 00:41:29 +00:00
Alexey Samsonov 41172a304a [tests] Don't compile CFI C tests in C++ mode.
llvm-svn: 261708
2016-02-24 00:16:57 +00:00
Chris Bieneman 497a0ac23f [CMake] Support component-based installation for runtime libraries
This enables targets like "install-ubsan" and "install-asan" to install all associated runtime libraries.

llvm-svn: 261700
2016-02-23 21:55:38 +00:00
Chris Bieneman 86792ea718 [CMake] Assign components and dependencies during add_compiler_rt_resource_file
This makes it so that component-based installations will include resource files (i.e. blacklists). My next patch will add support for component-based installations.

llvm-svn: 261699
2016-02-23 21:50:39 +00:00
Vedant Kumar 120f6301ed [profile] Fix iteration over profile data entries
Fix a crash when gathering value profile data on i386 Darwin.

The Darwin linker shrinks sections containing aligned structures when
padding is not explicitly added to the end of the structure. When
iterating over these structures, be sure to not walk past the end of the
section.

No tests added, since running `ninja check-profile` on i386 Darwin is
enough to reproduce the original crash.

llvm-svn: 261683
2016-02-23 20:46:14 +00:00
Dmitry Vyukov 0c202893ae tsan: clean up code after r261658
llvm-svn: 261660
2016-02-23 17:58:23 +00:00
Dmitry Vyukov b2be098026 tsan: fix signal handling in ignored libraries
The first issue is that we longjmp from ScopedInterceptor scope
when called from an ignored lib. This leaves thr->in_ignored_lib set.
This, in turn, disables handling of sigaction. This, in turn,
corrupts tsan state since signals delivered asynchronously.
Another issue is that we can ignore synchronization in asignal
handler, if the signal is delivered into an IgnoreSync region.
Since signals are generally asynchronous, they should ignore
memory access/synchronization/interceptor ignores.
This could lead to false positives in signal handlers.

llvm-svn: 261658
2016-02-23 17:16:26 +00:00
Alexey Samsonov 4d35491a12 [tests] Run test that uses gnu asm syntax on Posix only.
llvm-svn: 261609
2016-02-23 04:10:53 +00:00
Alexey Samsonov 4e796d0c9f [tests] Remove "supported-target" in favor of "target-arch" lit features.
Test cases definitely should not care about the complete set of architectures
supported by compiler-rt - they should only care about current
architecture that the test suite was configured for.

Introduce new lit feature to reflect this, and convert tests to use it.

llvm-svn: 261603
2016-02-23 01:58:56 +00:00
Alexey Samsonov e26c87d10e [tests] Always specify correct config.target_arch when configuring test suite.
llvm-svn: 261601
2016-02-23 01:34:17 +00:00
Alexey Samsonov 8e3cbde27d [Sanitizer] Introduce ListOfModules object and use it to replace GetListOfModules().
Summary:
This removes the hard limit on the number of loaded modules (used to be
16K), and makes it easier to use LoadedModules w/o causing a memory
leak: ListOfModules owns the modules, and makes sure to properly clean
them in destructor.

Remove filtering functionality that is only needed in one place (LSan).

Reviewers: aizatsky

Subscribers: llvm-commits, kcc

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

llvm-svn: 261554
2016-02-22 18:52:51 +00:00
Mohit K. Bhakkad 452417ac12 [MSan] Make unaligned load/store functions compatible for both endians
Reviewers: eugenis

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 261513
2016-02-22 06:16:28 +00:00
Andrey Turetskiy bc0122bca9 [CMake] Add partial support for MSVC in compiler-rt builtins, by Roman Shirokiy.
This enables MSVC build of complex number arithmetic compiler-rt builtins.

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

llvm-svn: 261432
2016-02-20 12:56:04 +00:00
Chris Bieneman 953d593cd7 [CMake] Adding a CMake cache file that matches Apple's build configs
This should have no impact on anyone, but we're going to use it from GreenDragon to make our builders match what we ship.

llvm-svn: 261377
2016-02-19 22:59:18 +00:00
Mike Aizatsky 635ade9305 [sancov] use GetLoadedModules for list of modules rather than sanitizer's list.
llvm-svn: 261376
2016-02-19 22:55:21 +00:00
Mike Aizatsky 361a7bb338 [sancov] requiring dynamic asan.
llvm-svn: 261362
2016-02-19 20:47:25 +00:00
Xinliang David Li 3d731c5e44 minor test runline cleanup
llvm-svn: 261361
2016-02-19 20:28:51 +00:00
Mike Aizatsky 731942565b [sancov] using static asan
We are not able to recover coverage points from dynamically linked
binaries at this point without symbols in @plt tables.

llvm-svn: 261352
2016-02-19 18:46:30 +00:00
Xinliang David Li f56aeef645 [PGO] Enable profile-rt testing on all supported targets
Differential Revision: http://reviews.llvm.org/D17361

llvm-svn: 261344
2016-02-19 17:52:28 +00:00
Reid Kleckner 12813b0def [Windows] Simplify more tests now that Clang supports EH
Remove TestCases/Windows/throw_catch.cc, since it is redundant with the
portable test TestCases/throw_catch.cc.

llvm-svn: 261342
2016-02-19 17:36:54 +00:00
Reid Kleckner 00203bc60b [Windows] Add 10s timeout to some WaitForSingleObject calls
I ran the test suite yesterday and when I came back this morning the
queue_user_work_item.cc test was hung. This could be why the
sanitizer-windows buildbot keeps randomly timing out. I updated all the
usages of WaitForSingleObject involving threading events. I'm assuming
the API can reliably wait for subprocesses, which is what the majority
of call sites use it for.

While I'm at it, we can simplify some EH tests now that clang can
compile C++ EH.

llvm-svn: 261338
2016-02-19 17:30:38 +00:00
Richard Trieu ec3d332748 Change comma to semi-colon, no functionality change.
Cleanup for upcoming Clang warning -Wcomma.

llvm-svn: 261269
2016-02-18 22:07:42 +00:00
Reid Kleckner 973dacf691 Un-XFAIL the last C++ EH test, it was fixed by r261258
llvm-svn: 261263
2016-02-18 21:24:30 +00:00
Xinliang David Li 0fc35d0a42 Add test coverage for default linker
llvm-svn: 261261
2016-02-18 21:11:37 +00:00
Reid Kleckner 7c8e2c37ba Clang on Windows supports exceptions, un XFAIL the passing tests
llvm-svn: 261236
2016-02-18 18:33:58 +00:00
Reid Kleckner 0765fbc332 [WinASan] Fix page size and mmap granularity confusion
We were erroneously reporting 16K as the page size on Windows because
the code that does the shadow mapping was using page size instead of
allocation granularity. After fixing that, we can resolve the FIXMEs in
the Windows implementations of GetPageSize and GetMmapGranularity by
calling GetSystemInfo instead of returning hard-coded, incorrect
answers.

llvm-svn: 261233
2016-02-18 17:58:22 +00:00
Ed Maste 371310e1ae [tsan] Disable sysroot flag on FreeBSD
FreeBSD does not install a number of Clang-provided headers for the
compiler in the base system due to incompatibilities between FreeBSD's     
and Clang's versions. As a workaround do not use --sysroot=. on FreeBSD    
until this is addressed.

llvm.org/pr26651
Differential Revision:	http://reviews.llvm.org/D17383

llvm-svn: 261229
2016-02-18 17:35:30 +00:00
Jonas Hahnfeld 9bf3acd5ff [compiler-rt] Return correct size of struct pthread for glibc-2.12.2
There seems to be a difference between 2.12.1 and 2.12.2 in 64-bit build.
Tested on Scientific Linux 6.6, based on RHEL.

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

llvm-svn: 261193
2016-02-18 07:08:26 +00:00
Kostya Serebryany d4590c7304 [sanitizer-coverage] implement -fsanitize-coverage=trace-pc. This is similar to trace-bb, but has a different API. We already use the equivalent flag in GCC for Linux kernel fuzzing. We may be able to use this flag with AFL too
llvm-svn: 261159
2016-02-17 21:34:43 +00:00
Alexey Samsonov 2af1e3e963 PR26606: Make abort_on_error.cc test more portable.
llvm-svn: 261157
2016-02-17 21:25:12 +00:00
Alexey Samsonov 51a8de9f7a Fix PR26608: Make sanitizer_common tests more portable.
llvm-svn: 261150
2016-02-17 21:00:50 +00:00
Alexey Samsonov 394f1d4159 [TSan] PR26609: Fix two test cases.
llvm-svn: 261148
2016-02-17 20:40:10 +00:00
Alexey Samsonov 54831a842e [tests] Slightly improve a fix in r260669.
llvm-svn: 261142
2016-02-17 19:35:51 +00:00
Ed Maste cef252ea4c [tsan] Fix signal number definitions for FreeBSD
The change in r253983 for OS X also applies to FreeBSD.

llvm-svn: 261121
2016-02-17 18:25:27 +00:00
Ed Maste a36d555c33 [tsan] Fix build warnings on FreeBSD
The change in r252165 for OS X applies to FreeBSD as well.

llvm-svn: 261120
2016-02-17 18:22:50 +00:00
Chris Bieneman 5a5b21d5be [CMake] [NFC] Move macro definitions out of config-ix.cmake
This change should have no functional impact, it just moves some macro definitions out of config-ix.cmake into CompilerRTUtils.cmake.

This step will allow these macros to be re-used by the separated builtin build.

llvm-svn: 261108
2016-02-17 16:57:38 +00:00
Chris Bieneman a58d0651cb [CMake] Push the dependency on AddLLVM into the test and unites layers
Compiler-rt only relies on LLVM for lit support. Pushing this dependency down into the test and unitest layers will allow builtin libraries to be built without LLVM.

llvm-svn: 261105
2016-02-17 16:38:54 +00:00
Jonas Hahnfeld ffed72bbeb [compiler-rt][msan] Ensure initialisation before calling __msan_unpoison
__msan_unpoison uses intercepted memset which currently leads to a SEGV
when linking with libc++ under CentOS 7.

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

llvm-svn: 261073
2016-02-17 07:12:18 +00:00
Evgeniy Stepanov f55ebf0e39 [msan] Extend prlimit test.
llvm-svn: 261049
2016-02-17 01:34:56 +00:00
Evgeniy Stepanov d308f92d02 [msan] Intercept prlimit.
llvm-svn: 261048
2016-02-17 01:26:57 +00:00
Mohit K. Bhakkad 6987e59cd1 [Compiler-rt][MSan][MIPS] Resolve gethostbyname_r_erange for MIPS
Reviewers: eugenis, kcc, samsonov

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 260946
2016-02-16 08:33:37 +00:00