summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r274865-r274870Alina Sbirlea2016-07-083-820/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274872 91177308-0d34-0410-b5e6-96231b3b80d8
* Added comments identifing code sourceAlina Sbirlea2016-07-081-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274870 91177308-0d34-0410-b5e6-96231b3b80d8
* Check cpuid supported for i386.Alina Sbirlea2016-07-081-1/+29
| | | | | | | | | | Summary: Reviewers: Subscribers: git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274868 91177308-0d34-0410-b5e6-96231b3b80d8
* Add default initialization. Add unit test.Alina Sbirlea2016-07-082-1/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274867 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format itAlina Sbirlea2016-07-081-40/+38
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274866 91177308-0d34-0410-b5e6-96231b3b80d8
* Add runtime support for __cpu_model (__builtin_cpu_supports)Alina Sbirlea2016-07-082-1/+771
| | | | | | | | | | | | | | | | | | | Summary: This aims to add support for __cpu_model and address Bug 25510. It uses the code from lib/Support/Host.cpp for cpu detection, and creates __cpu_model with that info. Tested on OSX, it builts successfully, but the current version does *not* resolve Bug 25510. The __cpu_model symbol is present in the library but it only gets loaded with -all_load. This patch will not land until this issue is clarified. Built on Linux as well (though libgcc is the default). The use of "asm" required -std=gnu99, hence the cmake change. Corrections on better addressing this are welcome. Note: See additional comments on D20988 (committed as r271921). Reviewers: llvm-commits, joerg, echristo, mehdi_amini Subscribers: mehdi_amini Differential Revision: http://reviews.llvm.org/D21033 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274865 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Fix minimal stack reserved for unittest on MSVC buildEtienne Bergeron2016-07-072-4/+7
| | | | | | | | | | | | | | Summary: Some unittest were not able to run in 64-bit because they need more than 2MB of stack and the default allocated stack with MSVC linker is 1MB. Reviewers: rnk Subscribers: wang0109, chrisha, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D22101 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274785 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Enhance unittest coverage for lib interceptionEtienne Bergeron2016-07-072-24/+127
| | | | | | | | | | | | | | Summary: This patch is adding more unittests for testing the interception of 32-bits code. Reviewers: rnk Subscribers: llvm-commits, wang0109, chrisha Differential Revision: http://reviews.llvm.org/D22077 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274775 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Fix sanitizer memory allocator on win64.Etienne Bergeron2016-07-073-4/+13
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch is fixing unittests for sanitizer memory allocator. There was two issues: 1) The VirtualAlloc can't reserve twice a memory range. The memory space used by the SizeClass allocator is reserved with NoAccess and pages are commited on demand (using MmapFixedOrDie). 2) The address space is allocated using two VirtualAlloc calls. The first one for the memory space, the second one for the AdditionnalSpace (after). On windows, they need to be freed separately. Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D21900 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274772 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Fix AllocatorCacheDeallocNewThread unittestEtienne Bergeron2016-07-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The unittest was not freeing the mapped memory. ``` Repeating all tests (iteration 1) . . . Note: Google Test filter = Allocator.AllocatorCacheDeallocNewThread [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from Allocator [ RUN ] Allocator.AllocatorCacheDeallocNewThread [ OK ] Allocator.AllocatorCacheDeallocNewThread (3 ms) [----------] 1 test from Allocator (4 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (5 ms total) [ PASSED ] 1 test. Repeating all tests (iteration 2) . . . Note: Google Test filter = Allocator.AllocatorCacheDeallocNewThread [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from Allocator [ RUN ] Allocator.AllocatorCacheDeallocNewThread ==4504==WARNING: SanitizerTool failed to mprotect 0x010000003000 (1099511640064) bytes at 0x010000000000 (error code: 48 7) ==4504==Sanitizer CHECK failed: D:/src/llvm/llvm/projects/compiler-rt/lib\sanitizer_common/sanitizer_allocator.h:329 ((kSpaceBeg)) == ((reinterpret_cast<uptr>( MmapFixedNoAccess(kSpaceBeg, TotalSpaceSize)))) (1099511627776, 0) ``` Reviewers: rnk Subscribers: llvm-commits, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D22094 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274764 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Avoid false positives with GCD data callbacksKuba Brecka2016-07-072-0/+62
| | | | | | | | | | This patch adds synchronization between the creation of the GCD data object and destructor’s execution. It’s far from perfect, because ideally we’d want to synchronize the destruction of the last reference (via dispatch_release) and the destructor’s execution, but intercepting objc_release is problematic. Differential Revision: http://reviews.llvm.org/D21990 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274749 91177308-0d34-0410-b5e6-96231b3b80d8
* [esan|cfrag] Handle binaries built with -esan-aux-field-info=falseQin Zhao2016-07-072-20/+28
| | | | | | | | | | | | | | | | Summary: Handles binaries built with -esan-aux-field-info=false and print less information. Updates test struct-simple.cpp. Reviewers: aizatsky Subscribers: llvm-commits, bruening, eugenis, kcc, zhaoqin, kubabrecka, vitalybuka Differential Revision: http://reviews.llvm.org/D22020 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274727 91177308-0d34-0410-b5e6-96231b3b80d8
* [esan|wset] Ensure SIGSEGV is not blockedDerek Bruening2016-07-068-6/+105
| | | | | | | | | | | | | | | | | | | | Summary: Adds interception of sigprocmask and pthread_sigmask to esan so that the working set tool can prevent SIGSEGV from being blocked. A blocked SIGSEGV results in crashes due to our lazy shadow page allocation scheme. Adds new sanitizer helper functions internal_sigemptyset and internal_sigismember. Adds a test to workingset-signal-posix.cpp. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D22063 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274672 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix cmake generation on Apple for interception unittestsEtienne Bergeron2016-07-061-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274671 91177308-0d34-0410-b5e6-96231b3b80d8
* [esan|wset] Further reduce flakiness of sampling testDerek Bruening2016-07-061-3/+7
| | | | | | | Enhances the sampling test to try and reduce flakiness further by increasing the workload to ensure a few samples are gathered. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274669 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Disable interception tests on AppleEtienne Bergeron2016-07-061-3/+1
| | | | | | | | | | | | | | | Summary: The CMake generation is not working on Apple. This patch is disabling the generation until it's fixed. Reviewers: rnk Subscribers: tberghammer, chrisha, danalbert, llvm-commits, srhines Differential Revision: http://reviews.llvm.org/D22066 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274667 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Handle null in internal_sigaction_syscallDerek Bruening2016-07-061-0/+2
| | | | | | | | | | | | | | Summary: Adds support for nullptr as the action parameter to internal_sigaction_syscall(). Reviewers: aizatsky Subscribers: kubabrecka, vitalybuka, zhaoqin, kcc, eugenis, llvm-commits Differential Revision: http://reviews.llvm.org/D22061 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274665 91177308-0d34-0410-b5e6-96231b3b80d8
* [compilter-rt] Add unittests for interception libraryEtienne Bergeron2016-07-066-1/+382
| | | | | | | | | | | | | | Summary: This patch is adding unittests for the interception library. Reviewers: rnk Subscribers: majnemer, llvm-commits, wang0109, chrisha, tberghammer, danalbert, srhines Differential Revision: http://reviews.llvm.org/D21980 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274657 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan Win64] Implement atomic_compare_exchange_strong for 8 bitEtienne Bergeron2016-07-061-7/+9
| | | | | | | | | Patch by: Wei Wang Differential Revision: http://reviews.llvm.org/D21950 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274634 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Fix false positives with GCD dispatch_source_*Kuba Brecka2016-07-062-24/+77
| | | | | | | | | | We already have interceptors for dispatch_source API (e.g. dispatch_source_set_event_handler), but they currently only handle submission synchronization. We also need to synchronize based on the target queue (serial, concurrent), in other words, we need to use dispatch_callback_wrap. This patch implements that. Differential Revision: http://reviews.llvm.org/D21999 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274619 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to reduce flakiness in workingset-samples.cppDavid Majnemer2016-07-061-5/+5
| | | | | | | The test is matching against 'KB' but it looks like the output can be 'MB'. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274587 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Update tests according to r274578Ryan Govostes2016-07-052-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274579 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Synchronize leaving a GCD group with notificationsKuba Brecka2016-07-052-9/+73
| | | | | | | | | | In the patch that introduced support for GCD barrier blocks, I removed releasing a group when leaving it (in dispatch_group_leave). However, this is necessary to synchronize leaving a group and a notification callback (dispatch_group_notify). Adding this back, simplifying dispatch_group_notify_f and adding a test case. Differential Revision: http://reviews.llvm.org/D21927 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274549 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] dispatch_once interceptor will cause a crash/deadlock when the ↵Kuba Brecka2016-07-052-2/+43
| | | | | | | | | | | | original dispatch_once is used Because we use SCOPED_TSAN_INTERCEPTOR in the dispatch_once interceptor, the original dispatch_once can also be sometimes called (when ignores are enabled or when thr->is_inited is false). However the original dispatch_once function doesn’t expect to find “2” in the storage and it will spin forever (but we use “2” to indicate that the initialization is already done, so no waiting is necessary). This patch makes sure we never call the original dispatch_once. Differential Revision: http://reviews.llvm.org/D21976 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274548 91177308-0d34-0410-b5e6-96231b3b80d8
* [esan|cfrag] Add struct array access reportQin Zhao2016-07-022-19/+35
| | | | | | | | | | | | | | | Summary: Adds struct array access counter report. Updates test struct-simple.cpp. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, bruening, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D21595 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274421 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Fix cmake to propagate debug info to runtime unittestsEtienne Bergeron2016-07-011-2/+2
| | | | | | | | | | | | | | Summary: The debug information is not present due to a mis named variabl in the cmake files. Reviewers: rnk Subscribers: kubabrecka, wang0109, llvm-commits, chrisha Differential Revision: http://reviews.llvm.org/D21938 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274386 91177308-0d34-0410-b5e6-96231b3b80d8
* tab to whitespacesEtienne Bergeron2016-07-011-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274382 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Relax the "ignored-interceptors.mm" testcase. The test has been ↵Kuba Brecka2016-07-011-1/+1
| | | | | | flaky because it's detecting a false positive race (coming from a system library) and sometimes that race is detected after we're printing "Done". git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274346 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Re-active unittest previously broken on windows.Etienne Bergeron2016-06-301-4/+0
| | | | | | | | | | | | Summary: These tests are working fine. Reviewers: rnk Subscribers: kubabrecka, wang0109, llvm-commits, chrisha Differential Revision: http://reviews.llvm.org/D21905 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274265 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Fix TLS resource leaking in unittestEtienne Bergeron2016-06-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The thread specific key wasn't not released. Running the unittest in loop will fail after 1024 iteraions. ``` ./projects/compiler-rt/lib/sanitizer_common/tests/Sanitizer-i386-Test --gtest_filter=SanitizerCommon.PthreadDestructorIterations --gtest_repeat=2000 --gtest_break_on_failure ``` ``` Repeating all tests (iteration 1023) . . . Note: Google Test filter = SanitizerCommon.PthreadDestructorIterations [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from SanitizerCommon [ RUN ] SanitizerCommon.PthreadDestructorIterations /usr/local/google/home/etienneb/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_posix_test.cc:54: Failure Value of: pthread_key_create(&key, &destructor) Actual: 11 Expected: 0 Aborted (core dumped) ``` Reviewers: rnk Subscribers: kubabrecka, llvm-commits, chrisha Differential Revision: http://reviews.llvm.org/D21902 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274264 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Fix broken (flaky) unittests based on FlagParser.Etienne Bergeron2016-06-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The FlagParser is populating a static global class with the unrecognized flags when parsing. That global class has a dcheck that limit the number of unrecognized flag to 20. ``` class UnknownFlags { static const int kMaxUnknownFlags = 20; const char *unknown_flags_[kMaxUnknownFlags]; int n_unknown_flags_; [...] void Report() { if (!n_unknown_flags_) return; Printf("WARNING: found %d unrecognized flag(s):\n", n_unknown_flags_); for (int i = 0; i < n_unknown_flags_; ++i) Printf(" %s\n", unknown_flags_[i]); n_unknown_flags_ = 0; } }; UnknownFlags unknown_flags; ``` Unittests based on that class must reset the counter 'n_unknown_flags_' or the next usage of that class may fail arbitrary. This can be done by reporting the pending unknown flags. Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D21896 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274234 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Reset global variables in ThreadRegistryThreadedTestEtienne Bergeron2016-06-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The unittest 'ThreadRegistryThreadedTest' is failing when running in loop. There are global variables that need to be cleared. To repro: ``` projects\compiler-rt\lib\sanitizer_common\tests\Release\Sanitizer-x86_64-Test.exe --gtest_filter=SanitizerCommon.ThreadRegistryThreadedTest --gtest_repeat=2 ``` Output: ``` Repeating all tests (iteration 1) . . . Note: Google Test filter = SanitizerCommon.ThreadRegistryThreadedTest [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from SanitizerCommon [ RUN ] SanitizerCommon.ThreadRegistryThreadedTest [ OK ] SanitizerCommon.ThreadRegistryThreadedTest (1 ms) [----------] 1 test from SanitizerCommon (1 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (2 ms total) [ PASSED ] 1 test. Repeating all tests (iteration 2) . . . Note: Google Test filter = SanitizerCommon.ThreadRegistryThreadedTest [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from SanitizerCommon [ RUN ] SanitizerCommon.ThreadRegistryThreadedTest C:/src/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc(216): error: Value of: num_created[0] Actual: 2 Expected: 1 C:/src/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc(217): error: Value of: num_started[0] Actual: 2 Expected: 1 C:/src/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc(220): error: Value of: num_created[i] [...] [ FAILED ] SanitizerCommon.ThreadRegistryThreadedTest (294 ms) [----------] 1 test from SanitizerCommon (294 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (299 ms total) [ PASSED ] 0 tests. [ FAILED ] 1 test, listed below: [ FAILED ] SanitizerCommon.ThreadRegistryThreadedTest 1 FAILED TEST ``` Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D21886 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274231 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Fix broken unittest using alloca on MSVC.Etienne Bergeron2016-06-301-1/+8
| | | | | | | | | | | | | | | | | Summary: The alloca header is not present on windows. This test was committed recently: http://reviews.llvm.org/D21509 http://reviews.llvm.org/rL273889 Reviewers: rnk Subscribers: llvm-commits, wang0109, chrisha, kubabrecka Differential Revision: http://reviews.llvm.org/D21864 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274230 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Fix Sanitizer-common Unittests on win64Etienne Bergeron2016-06-292-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch is fixing unittests that are broken on windows (64-bits). Tests under 'SANITIZER_CAN_USE_ALLOCATOR64' are disabled. A custom allocator for windows based on WinHeap API will replace these tests. Tested on Win32/Win64 (Ninja and MSVC). Tested on Linux 32-bit/64-bit clang. ``` C:\src\llvm\build64\projects\compiler-rt>lib\sanitizer_common\tests\Release\Sanitizer-x86_64-Test.exe [==========] Running 101 tests from 12 test cases. [----------] Global test environment set-up. [----------] 51 tests from SanitizerCommon [ RUN ] SanitizerCommon.DefaultSizeClassMap [ OK ] SanitizerCommon.DefaultSizeClassMap (1 ms) [ RUN ] SanitizerCommon.CompactSizeClassMap [ OK ] SanitizerCommon.CompactSizeClassMap (1 ms) [ RUN ] SanitizerCommon.InternalSizeClassMap [ OK ] SanitizerCommon.InternalSizeClassMap (1 ms) [ RUN ] SanitizerCommon.SizeClassAllocator32Compact [ OK ] SanitizerCommon.SizeClassAllocator32Compact (828 ms) [ RUN ] SanitizerCommon.SizeClassAllocator32CompactMetadataStress [ OK ] SanitizerCommon.SizeClassAllocator32CompactMetadataStress (914 ms) [ RUN ] SanitizerCommon.SizeClassAllocator32MapUnmapCallback [...] [----------] 4 tests from Symbolizer [ RUN ] Symbolizer.ExtractToken [ OK ] Symbolizer.ExtractToken (0 ms) [ RUN ] Symbolizer.ExtractInt [ OK ] Symbolizer.ExtractInt (0 ms) [ RUN ] Symbolizer.ExtractUptr [ OK ] Symbolizer.ExtractUptr (0 ms) [ RUN ] Symbolizer.ExtractTokenUpToDelimiter [ OK ] Symbolizer.ExtractTokenUpToDelimiter (0 ms) [----------] 4 tests from Symbolizer (24 ms total) [----------] Global test environment tear-down [==========] 101 tests from 12 test cases ran. (5090 ms total) [ PASSED ] 101 tests. ``` Reviewers: rnk Subscribers: chrisha, wang0109, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D21817 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274174 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Fix the Asan unittest on WindowsEtienne Bergeron2016-06-291-1/+1
| | | | | | | | | | | | | | | | | Summary: The build bot is broken because the runtime library doesn't have debug information. This is broken due to a recent change: http://reviews.llvm.org/D21554 Reviewers: rnk Subscribers: kubabrecka, llvm-commits, chrisha Differential Revision: http://reviews.llvm.org/D21862 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274172 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Fix passing debug information to unittest.Etienne Bergeron2016-06-292-0/+8
| | | | | | | | | | | | | | | | | | | | Summary: On windows, the debug information was not present in the unittest executables, which make them hard to debug. The Sanitizer Unittests are compiled with a local clang build. The link pass is also done by calling clang. This pass is adding the appropriate flags to bring the right debug information to these executables. Reviewers: rnk Subscribers: kubabrecka, llvm-commits, wang0109, chrisha Differential Revision: http://reviews.llvm.org/D21838 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274153 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Stop extending the block’s lifetime in dispatch_group_asyncKuba Brecka2016-06-292-1/+46
| | | | | | | | | | The dispatch_group_async interceptor actually extends the lifetime of the executed block. This means the destructor of the block (and captured variables) is called *after* dispatch_group_leave, which changes the semantics of dispatch_group_async. This patch fixes that. Differential Revision: http://reviews.llvm.org/D21816 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274117 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix handling of padding in sendmsg control data.Evgeniy Stepanov2016-06-282-1/+130
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274074 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] In r273957, I deleted a line that shouldn't have been removed.Chris Bieneman2016-06-281-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274030 91177308-0d34-0410-b5e6-96231b3b80d8
* Adapt the "objc-race.mm" test to use ignore_interceptors_accesses=1. All ↵Kuba Brecka2016-06-281-1/+1
| | | | | | Obj-C/Darwin tests currently need this to avoid false positives. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274014 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding a comment to explain r273886 ("Stop unwinding the stack when a ↵Kuba Brecka2016-06-282-0/+6
| | | | | | close-to-zero PC is found"). NFC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274010 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Check for androidabi in CMakeLists.txt not base-config-ix.cmakeChris Bieneman2016-06-272-5/+3
| | | | | | COMPILER_RT_DEFAULT_TARGET_ABI is not set in base-config-ix.cmake, so we need to move this check into CMakeLists.txt. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273957 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Parse the triple in base-config-ix to propagate ANDROID variable ↵Chris Bieneman2016-06-272-13/+12
| | | | | | | | | | | correctly" This reverts commit r273914. This commit broke bots building compiler-rt using LLVM_BUILD_EXTERNAL_COMPILER_RT. See: http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/22221/console git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273956 91177308-0d34-0410-b5e6-96231b3b80d8
* Parse the triple in base-config-ix to propagate ANDROID variable correctlySumanth Gundapaneni2016-06-272-12/+13
| | | | | | | | | | | | The triple must be parsed in base-config-ix.cmake. Otherwise, the cmake variable ANDROID won't be set and this will confuse cmake to build unsupported targets targeted for android. Diferential revision: http://reviews.llvm.org/D21474 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273914 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Add HB edges for GCD barrier blocksKuba Brecka2016-06-273-48/+132
| | | | | | | | | | Adding support for GCD barrier blocks in concurrent queues. This uses two sync object in the same way as read-write locks do. This also simplifies the use of dispatch groups (the notifications act as barrier blocks). Differential Revision: http://reviews.llvm.org/D21604 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273893 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Treat non-barrier OSAtomic* functions as barriers to avoid false ↵Kuba Brecka2016-06-271-15/+24
| | | | | | | | | | | | positives The non-barrier versions of OSAtomic* functions are semantically mo_relaxed, but the two variants (e.g. OSAtomicAdd32 and OSAtomicAdd32Barrier) are actually aliases of each other, and we cannot have different interceptors for them, because they're actually the same function. Thus, we have to stay conservative and treat the non-barrier versions as mo_acq_rel. Differential Revision: http://reviews.llvm.org/D21733 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273890 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] fix false dynamic-stack-buffer-overflow report with constantly-sized ↵Kuba Brecka2016-06-271-0/+44
| | | | | | | | | | | | dynamic allocas, compiler-rt part See the bug report at https://github.com/google/sanitizers/issues/691. When a dynamic alloca has a constant size, ASan instrumentation will treat it as a regular dynamic alloca (insert calls to poison and unpoison), but the backend will turn it into a regular stack variable. The poisoning/unpoisoning is then broken. This patch will treat such allocas as static. Differential Revision: http://reviews.llvm.org/D21509 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273889 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Stop unwinding the stack when a close-to-zero PC is foundKuba Brecka2016-06-275-8/+25
| | | | | | | | | | On OS X, we often get stack trace in a report that ends with a 0x0 frame. To get rid of it, let's trim the stack trace when we find a close-to-zero value, which is obviously not a valid PC. Differential Revision: http://reviews.llvm.org/D14656 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273886 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: don't create sync objects on acquireDmitry Vyukov2016-06-275-14/+16
| | | | | | | | | Creating sync objects on acquire is pointless: acquire of a just created sync object if a no-op. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273862 91177308-0d34-0410-b5e6-96231b3b80d8
* Move -ldl to the correct compiler invocationRyan Govostes2016-06-271-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273844 91177308-0d34-0410-b5e6-96231b3b80d8