summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* [sanitizer] Try to fix LargeMmapAllocator test on WindowsReid Kleckner2016-07-261-2/+4
| | | | | | | | | | | | | This test attempts to allocate 100 512MB aligned pages of memory. This is implemented in the usual way by allocating size + alignment bytes and aligning the result. As a result, this test allocates 51.2GB of memory. Windows allocates swap for all memory allocated, and our bots do not have this much swap available. Avoid the failure by using a more reasonable alignment, like 16MB, as we do on 32-bit. llvm-svn: 276779
* Try to fix more Windows portability issues in sanitizer testsReid Kleckner2016-07-221-2/+6
| | | | | | | | | | | | | | Add a %stdcxx11 lit substitution for -std=c++11. Windows defaults to -std=c++14 when VS 2015 is used because the STL requires it. Harcoding -std=c++11 in the ASan tests actually downgrades the C++ standard level, leading to test failures. Relax a FileCheck pattern in use-after-scope-types.cc. Disable the sanitizer_common OOM tests. They fail on bots with low swap, and cause other concurrently running tests to OOM. llvm-svn: 276454
* [sanitizer] allocator: introduce kUseSeparateSizeClassForBatch (false by ↵Kostya Serebryany2016-07-221-0/+19
| | | | | | default). When true, it will cause all TransferBatches to be allocated on a separate dedicated size class, which improves security and may potentially simplify memory reclamation. However in the current state this may cause up to 3% extra memory usage. Subsequent changes should bring this overhead down llvm-svn: 276377
* [sanitizer] allocator: remove kPopulateSize and only use ↵Kostya Serebryany2016-07-211-1/+1
| | | | | | SizeClassMap::MaxCached; ensure that TransferBatch size is a power of two, refactor TransferBatch creation/destruction into separate functions. llvm-svn: 276318
* [sanitizers] split sanitizer_allocator.h into a number of smaller .h files; NFCKostya Serebryany2016-07-201-0/+1
| | | | llvm-svn: 276195
* [sanitizers] Allocate 12MB for stack instead of 134MBReid Kleckner2016-07-122-2/+4
| | | | | | | | | | The thread registry test was failing to allocate 25 threads with stack size 134MB, which is pretty reasonable. Also print the error code in our pthread wrappers in case this happens again. llvm-svn: 275209
* [compiler-rt] Fix VisualStudio virtual folders layoutEtienne Bergeron2016-07-111-3/+3
| | | | | | | | | | | | | | | | | | | | Summary: This patch is a refactoring of the way cmake 'targets' are grouped. It won't affect non-UI cmake-generators. Clang/LLVM are using a structured way to group targets which ease navigation through Visual Studio UI. The Compiler-RT projects differ from the way Clang/LLVM are grouping targets. This patch doesn't contain behavior changes. Reviewers: kubabrecka, rnk Subscribers: wang0109, llvm-commits, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D21952 llvm-svn: 275111
* [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 llvm-svn: 274785
* [compiler-rt] Fix sanitizer memory allocator on win64.Etienne Bergeron2016-07-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 274772
* [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 llvm-svn: 274764
* [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 llvm-svn: 274265
* [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 llvm-svn: 274264
* [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 llvm-svn: 274234
* [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 llvm-svn: 274231
* [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 llvm-svn: 274174
* [compiler-rt] Fix passing debug information to unittest.Etienne Bergeron2016-06-291-0/+4
| | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 274153
* [sanitizer] Stop unwinding the stack when a close-to-zero PC is foundKuba Brecka2016-06-271-0/+13
| | | | | | | | 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 llvm-svn: 273886
* [compiler-rt] Fix multi-configuration output pathsEtienne Bergeron2016-05-161-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When using a multi-configuration build (i.e. MSVC) the output path where libraries are dropped is incorrect. Example: ``` C:\src\llvm\examples>d:\src\llvm\build\Release\bin\clang-cl.exe -fsanitize=address test.cc LINK : fatal error LNK1181: cannot open input file 'd:\src\llvm\build\Release\bin\..\lib\clang\3.9.0\lib\windows\clang_rt.asan-i386.lib' ``` The dropped executable path contains the configuration 'Release': ``` 'd:\src\llvm\build\Release\bin\..\lib\clang\3.9.0\lib\windows\Release\clang_rt.asan-i386.lib' ``` The variable 'RUNTIME_OUTPUT_DIRECTORY' is used to specify the output directory. But CMAKE is appending the current configuration (i.e. Debug, Release). see: https://cmake.org/cmake/help/v3.0/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.html ``` "Multi-configuration generators (VS, Xcode) append a per-configuration subdirectory to the specified directory." ``` To avoid this problem, the configuration specific variable must be set: 'RUNTIME_OUTPUT_DIRECTORY_DEBUG', 'RUNTIME_OUTPUT_DIRECTORY_RELEASE', and so on. Reviewers: ddunbar, chapuni, rnk Subscribers: kubabrecka, llvm-commits Differential Revision: http://reviews.llvm.org/D20261 llvm-svn: 269658
* [sanitizer] add a function MmapNoAccess that mmaps a protected region ↵Kostya Serebryany2016-04-231-1/+2
| | | | | | *somewhere*; use MmapNoAccess in the Allocator when SpaceBeg is not a constant. In this mode the allocator will be a bit more hardened llvm-svn: 267256
* Revert "[sanitizer] Allow the sanitizer allocator to use a non-fixed address ↵Renato Golin2016-04-221-2/+1
| | | | | | | | | range. An allocator with a non-fixed address range will be attack-resistan. NFC for the sanitizers at this point." This reverts commit r267094, because it broke a lot of MSAN tests in AArch64. Being NFC and all, this needs some deeper investigation before it goes in again. llvm-svn: 267136
* [sanitizer] Allow the sanitizer allocator to use a non-fixed address range. ↵Kostya Serebryany2016-04-221-1/+2
| | | | | | An allocator with a non-fixed address range will be attack-resistan. NFC for the sanitizers at this point. llvm-svn: 267094
* [sanitizer] update the sanitizer_allocator_testlibKostya Serebryany2016-04-201-4/+5
| | | | llvm-svn: 266934
* [sanitizers] Fixup to r266494; the Unit test should not run on WindowsAnna Zaks2016-04-161-0/+2
| | | | | | | The test is failing on Windows because we do not have a definition for DemangleSwiftAndCXX nor DemangleCXXABI, which I am replacing, on Windows. llvm-svn: 266499
* [sanitizers] Teach the internal demangler about Swift namesAnna Zaks2016-04-151-0/+10
| | | | | | | | | Add support for Swift names when symbolicating sanitizer traces. This is now relevant since TSan and ASan support have been added to Swift on OS X. Differential Revision: http://reviews.llvm.org/D19135 llvm-svn: 266494
* [sanitizer] [SystemZ] Add virtual space size.Marcin Koscielnicki2016-04-141-0/+4
| | | | | | | | | This teaches sanitizer_common about s390 and s390x virtual space size. s390 is unusual in that it has 31-bit virtual space. Differential Revision: http://reviews.llvm.org/D18896 llvm-svn: 266296
* [Compiler-rt] Fix ioctl codes for MIPS in sanitizer_ioctl_testMohit K. Bhakkad2016-03-111-2/+4
| | | | | | | | | | Reviewers: samsonov Subscribers: jaydeep, sagar, llvm-commits Differential Revision: http://reviews.llvm.org/D17985 llvm-svn: 263199
* [Sanitizer] Introduce ListOfModules object and use it to replace ↵Alexey Samsonov2016-02-221-4/+4
| | | | | | | | | | | | | | | | | | | | 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
* Fixed non-NULL terminating array bug in SanitizerCommon.StartSubprocessTest ↵Zia Ansari2016-02-151-1/+1
| | | | | | | | that caused them to fail sometimes and act flaky. Differential Revision: http://reviews.llvm.org/D17228 llvm-svn: 260876
* using /system/bin/sh on android in tests.Mike Aizatsky2016-01-271-3/+8
| | | | | | | | Subscribers: tberghammer, danalbert, srhines Differential Revision: http://reviews.llvm.org/D16654 llvm-svn: 259001
* [sanitizers] extracted process management functionsMike Aizatsky2016-01-261-0/+30
| | | | | | Differential Revision: http://reviews.llvm.org/D16546 llvm-svn: 258849
* Revert "[sanitizers] extracted process management functions"Mike Aizatsky2016-01-251-23/+0
| | | | | | This reverts commit e5b34d5a2bf4c882bc647dd26a8cea2adc76f63c. llvm-svn: 258713
* [sanitizers] extracted process management functionsMike Aizatsky2016-01-251-0/+23
| | | | | | Differential Revision: http://reviews.llvm.org/D16542 llvm-svn: 258710
* Fix the cross compilation of unit tests. NFC (second attempt)Sumanth Gundapaneni2016-01-141-1/+1
| | | | | | | | | | | | | | | | With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compiling environment, the unit tests fail to link. This patch does the following changes >Rename COMPILER_RT_TEST_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS to reflect the way it's used. >Add COMPILER_RT_TEST_COMPILER_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to build/compile the unit tests >Add COMPILER_RT_UNITTEST_LINKFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to link the unit tests (if needed) Differential Revision: http://reviews.llvm.org/D16165 llvm-svn: 257783
* Revert r257686 "With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross ↵Hans Wennborg2016-01-131-1/+1
| | | | | | | | | | | | | | | compiling" This broke the build. For example, from http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/1191/steps/cmake%20stage%201/logs/stdio: -- Compiler-RT supported architectures: aarch64 CMake Error at projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:170 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): projects/compiler-rt/lib/CMakeLists.txt:4 (include) llvm-svn: 257694
* With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compilingSumanth Gundapaneni2016-01-131-1/+1
| | | | | | | | | | | | | | | environment, the unit tests fail to link. This patch does the following changes >Rename COMPILER_RT_TEST_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS to reflect the way it's used. >Add COMPILER_RT_TEST_COMPILER_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to build/compile the unit tests >Add COMPILER_RT_UNITTEST_LINKFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to link the unit tests (if needed) Differential Revision:http://reviews.llvm.org/D15082 llvm-svn: 257686
* [libsanitizer] Fix bugs and wiki links to point to GitHub.Alexander Potapenko2015-12-041-1/+1
| | | | llvm-svn: 254738
* [compiler-rt] Do not pull in min and max macros from windows.hAnna Zaks2015-11-201-0/+2
| | | | | | This should fix Windows buildbot breakage triggered by r253690. llvm-svn: 253701
* [compiler-rt] Add internal implementations for strlcat and strlcpyAnna Zaks2015-11-201-0/+54
| | | | | | | | | | The compiler-rt should make use of strlcpy() rather than strncpy(). Using internal_strncpy() may be fine with appropriate bounds checking or enforcement of nul-termination elsewhere, but it's just good practice these days to avoid using strncpy() in new code. A patch by Jeremy Sequoia! Differential Revision: http://reviews.llvm.org/D14714 llvm-svn: 253690
* Reapply: [asan] On OS X, log reports to syslog and os_traceAnna Zaks2015-11-201-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When ASan currently detects a bug, by default it will only print out the text of the report to stderr. This patch changes this behavior and writes the full text of the report to syslog before we terminate the process. It also calls os_trace (Activity Tracing available on OS X and iOS) with a message saying that the report is available in syslog. This is useful, because this message will be shown in the crash log. For this to work, the patch makes sure we store the full report into error_message_buffer unconditionally, and it also strips out ANSI escape sequences from the report (they are used when producing colored reports). I've initially tried to log to syslog during printing, which is done on Android right now. The advantage is that if we crash during error reporting or the produced error does not go through ScopedInErrorReport, we would still get a (partial) message in the syslog. However, that solution is very problematic on OS X. One issue is that the logging routine uses GCD, which may spawn a new thread on its behalf. In many cases, the reporting logic locks threadRegistry, which leads to deadlocks. Reviewed at http://reviews.llvm.org/D13452 (In addition, add sanitizer_common_libcdep.cc to buildgo.sh to avoid build failures on Linux.) llvm-svn: 253688
* Revert "Reapply: [asan] On OS X, log reports to syslog and os_trace"Juergen Ributzka2015-11-041-24/+0
| | | | | | | Looks like this commit is deadlocking the ASAN tests on the green dragon bot (http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA/). llvm-svn: 252076
* Reapply: [asan] On OS X, log reports to syslog and os_traceAnna Zaks2015-10-281-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When ASan currently detects a bug, by default it will only print out the text of the report to stderr. This patch changes this behavior and writes the full text of the report to syslog before we terminate the process. It also calls os_trace (Activity Tracing available on OS X and iOS) with a message saying that the report is available in syslog. This is useful, because this message will be shown in the crash log. For this to work, the patch makes sure we store the full report into error_message_buffer unconditionally, and it also strips out ANSI escape sequences from the report (they are used when producing colored reports). I've initially tried to log to syslog during printing, which is done on Android right now. The advantage is that if we crash during error reporting or the produced error does not go through ScopedInErrorReport, we would still get a (partial) message in the syslog. However, that solution is very problematic on OS X. One issue is that the logging routine uses GCD, which may spawn a new thread on its behalf. In many cases, the reporting logic locks threadRegistry, which leads to deadlocks. Reviewed at http://reviews.llvm.org/D13452 (In addition, add sanitizer_common_libcdep.cc to buildgo.sh to avoid build failures on Linux.) llvm-svn: 251577
* Revert "[asan] On OS X, log reports to syslog and os_trace"Anna Zaks2015-10-271-24/+0
| | | | | | | | This reverts commit 251447. (Which caused failures on a Linux bot.) llvm-svn: 251467
* [asan] On OS X, log reports to syslog and os_traceAnna Zaks2015-10-271-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | When ASan currently detects a bug, by default it will only print out the text of the report to stderr. This patch changes this behavior and writes the full text of the report to syslog before we terminate the process. It also calls os_trace (Activity Tracing available on OS X and iOS) with a message saying that the report is available in syslog. This is useful, because this message will be shown in the crash log. For this to work, the patch makes sure we store the full report into error_message_buffer unconditionally, and it also strips out ANSI escape sequences from the report (they are used when producing colored reports). I've initially tried to log to syslog during printing, which is done on Android right now. The advantage is that if we crash during error reporting or the produced error does not go through ScopedInErrorReport, we would still get a (partial) message in the syslog. However, that solution is very problematic on OS X. One issue is that the logging routine uses GCD, which may spawn a new thread on its behalf. In many cases, the reporting logic locks threadRegistry, which leads to deadlocks. Reviewed at http://reviews.llvm.org/D13452 llvm-svn: 251447
* [asan] Tune down SizeClassAllocator tests.Evgeniy Stepanov2015-10-011-1/+1
| | | | | | | This should make the Android/x86 bot (running on a Nexus Player) less flaky. llvm-svn: 249044
* [asan] Disable ThreadSelfTest on Android.Evgeniy Stepanov2015-09-081-1/+1
| | | | | | | | Also #ifdef out the implementation of ThreadSelf() and ThreadSelfOffset() helper functions that are broken and unused on Android. llvm-svn: 247053
* [CMake] Unify build rules for sanitizer_common for Apple and non-Apple ↵Alexey Samsonov2015-08-271-1/+2
| | | | | | | | | platforms. Additionally, link safestack runtime on OS X with nolibc version of sanitizer_common runtime, as we do on Linux. llvm-svn: 246227
* Unit test the CRLF change to suppression parsingReid Kleckner2015-08-271-2/+3
| | | | | | It's a simpler, faster, and more portable. llvm-svn: 246171
* [CMake] Fix building unit tests on DarwinChris Bieneman2015-08-201-0/+3
| | | | | | | | | | | | | | | | Summary: There are a number of issues with unit tests on Darwin. These patches address the following: * Unit tests should be passed -arch (-m32/-m64 isn't sufficient) * Unit tests should be passed ${DARWIN_osx_CFLAGS} because they're being built for OS X * Test architectures should be filtered based on base system capabilities (i.e. don't try running x86_64h tests on pre-haswell hardware). Reviewers: bogner, filcab, kubabrecka Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12174 llvm-svn: 245580
* [Sanitizer] Initialize common flags to default values in unit tests.Alexey Samsonov2015-08-181-0/+2
| | | | llvm-svn: 245363
* [Windows] Implement FileExists, ReadFromFile, and FindPathToBinaryReid Kleckner2015-08-102-7/+47
| | | | | | | | | | | | Summary: These are needed to talk to llvm-symbolizer on Windows. Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11920 llvm-svn: 244533
OpenPOWER on IntegriCloud