summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r301904 causing tsan test failure in x86_64-linux-autoconfPierre Gousseau2017-05-021-21/+0
| | | | llvm-svn: 301909
* [asan] Add strndup/__strndup interceptors if targeting linux.Pierre Gousseau2017-05-021-0/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D31457 llvm-svn: 301904
* Define a suppression for known leaks on pthread_exit call.Alex Shlyapnikov2017-04-201-6/+3
| | | | | | | | | | | | Summary: Refer to D32194 for the context. Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32303 llvm-svn: 300886
* Turn symbolization on for ASan unit test.Alex Shlyapnikov2017-04-191-4/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: On PowerPC and ARM (possibly, need to verify), couple tests involving pthread_exit fail due to leaks detected by LSan. pthread_exit tries to perform unwinding that leads to dlopen'ing libgcc_s.so. dlopen mallocs "libgcc_s.so" string which confuses LSan, it fails to realize that this allocation happens in dynamic linker and should be ignored. Symbolized leak report is required to define a suppression for this known problem. Reviewers: eugenis Subscribers: aemerson, rengolin, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32194 Turn symbolization on for PPC and Thumb only to do not slow down other platforms. llvm-svn: 300748
* Fix memory leaks in address sanitizer darwin testsFrancis Ricci2017-04-121-0/+1
| | | | | | | | | | | | Summary: These leaks are detected by leak sanitizer for darwin. Reviewers: glider, kubamracek, kcc, alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31978 llvm-svn: 300080
* Reapply "Enable LSan for arm Linux"Maxim Ostapenko2017-04-111-0/+8
| | | | | | This patch reapplies r299923 with typo fixed in BLX macros. llvm-svn: 299948
* Revert r299923, it doesn't build in bootstrap builds.Nico Weber2017-04-111-8/+0
| | | | | | | | | | | | | | | FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.arm.dir/sanitizer_linux.cc.o lib/sanitizer_common/sanitizer_linux.cc:1340:24: error: invalid instruction BLX(ip) ^ lib/sanitizer_common/sanitizer_linux.cc:1313:19: note: expanded from macro 'BLX' # define BLX(R) "mov lr, pc; bx" #R "\n" ^ <inline asm>:6:13: note: instantiated into assembly here mov lr, pc; bxip ^~~~ llvm-svn: 299943
* [lsan] Enable LSan for arm LinuxMaxim Ostapenko2017-04-111-0/+8
| | | | | | | | This patch enables LSan for arm Linux. Differential Revision: https://reviews.llvm.org/D29586 llvm-svn: 299923
* [powerpc] deactivate ManyThreadsTest asan test on powerpc64Bill Seurer2017-03-271-1/+2
| | | | | | | | | | | | This test case occassionally hangs when run on powerpc. This is also a problem on AArch64 (see https://bugs.llvm.org/show_bug.cgi?id=24389). Reactivate this when the problem is fixed. This could also be related to the same problem as with the tests ThreadedOneSizeMallocStressTest, ThreadedMallocStressTest, and several others that do not run reliably on powerpc. llvm-svn: 298873
* Some ASan bots (AArch64 at least) use SEGV for a unit test error instead of ↵Filipe Cabecinhas2017-03-141-1/+1
| | | | | | SIGBUS llvm-svn: 297728
* [asan] Split SIGSEGV / SIGBUS handling so we can handle only one of them and ↵Filipe Cabecinhas2017-03-131-1/+1
| | | | | | | | | | | | | | not the other. Summary: This is useful in some platforms where one of these signals is special. Reviewers: kubamracek, kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D30783 llvm-svn: 297665
* [asan] Remove `using std::vector` and `using std::map`Alexander Kornienko2017-02-064-5/+4
| | | | | | Looks like these are not needed anymore. llvm-svn: 294200
* [powerpc] deactivate ThreadedOneSizeMallocStressTest asan test on powerpc64Bill Seurer2017-01-251-0/+5
| | | | | | | This has not reliably worked on powerpc since r279664. Re-enable this once the problem is tracked down and fixed. llvm-svn: 293066
* [powerpc] deactivate ThreadedMallocStressTest asan test on powerpc64Bill Seurer2017-01-241-0/+4
| | | | | | | This has not reliably worked on powerpc since r279664. Re-enable this once the problem is tracked down and fixed. llvm-svn: 292945
* Revert "[sancov] moving sancov rt to sancov/ directory"Mike Aizatsky2017-01-121-3/+0
| | | | | | | | This reverts commit https://reviews.llvm.org/rL291734 Reason: mac breakage http://lab.llvm.org:8080/green//job/clang-stage1-configure-RA_build/28798/consoleFull#1657087648e9a0fee5-ebcc-4238-a641-c5aa112c323e llvm-svn: 291736
* [sancov] moving sancov rt to sancov/ directoryMike Aizatsky2017-01-121-0/+3
| | | | | | | | Subscribers: kubabrecka, mgorny Differential Revision: https://reviews.llvm.org/D28541 llvm-svn: 291734
* Make cmake link flag naming consistentFrancis Ricci2017-01-101-33/+33
| | | | | | | | | | | | | | | | | | | Summary: The build system was inconsistent in its naming conventions for link flags. This patch changes all uses of LINKFLAGS to LINK_FLAGS, for consistency with cmake's LINK_FLAGS property. This patch should make it easier to search the source code for uses of link flags, as well as providing the benefit of improved style and consistency. Reviewers: compnerd, beanz Subscribers: kubabrecka, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28506 llvm-svn: 291539
* Enable weak hooks on darwinFrancis Ricci2017-01-091-0/+5
| | | | | | | | | | | | | | | | Summary: By default, darwin requires a definition for weak interface functions at link time. Adding the '-U' link flag with each weak function allows these weak interface functions to be used without definitions, which mirrors behavior on linux and windows. Reviewers: compnerd, eugenis Subscribers: kubabrecka, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D28203 llvm-svn: 291417
* [compiler-rt] Set valid PC calling __asan_report_error ↵Vitaly Buka2017-01-051-1/+2
| | | | | | | | | | | | SetErrorReportCallbackTest Reviewers: eugenis Subscribers: kubabrecka, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D28376 llvm-svn: 291176
* Decrease kLargeMalloc block size in ASAN unit tests.Evgeniy Stepanov2016-12-281-1/+3
| | | | | | | | | | | | | | | | | Summary: Make kLargeMalloc big enough to be handled by secondary allocator and small enough to fit into quarantine for all configurations. It become too big to fit into quarantine on Android after D27873. Reviewers: eugenis Patch by Alex Shlyapnikov. Subscribers: danalbert, llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D28142 llvm-svn: 290689
* [asan] Fix test broken by r290540Vitaly Buka2016-12-271-12/+14
| | | | | | | | | | Reviewers: ahatanak, eugenis, myatsina Subscribers: kubabrecka, zizhar, llvm-commits Differential Revision: https://reviews.llvm.org/D28128 llvm-svn: 290621
* [inline-asm]No error for conflict between inputs\outputs and clobber listMarina Yatsina2016-12-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Updated test according to commit 290539: According to extended asm syntax, a case where the clobber list includes a variable from the inputs or outputs should be an error - conflict. for example: const long double a = 0.0; int main() { char b; double t1 = a; __asm__ ("fucompp": "=a" (b) : "u" (t1), "t" (t1) : "cc", "st", "st(1)"); return 0; } This should conflict with the output - t1 which is st, and st which is st aswell. The patch fixes it. Commit on behald of Ziv Izhar. Differential Revision: https://reviews.llvm.org/D15075 llvm-svn: 290540
* Improve ThreadedQuarantineTest heap memory measurements.Evgeniy Stepanov2016-12-221-1/+7
| | | | | | | | | | | | | | | | Summary: Warm up ASAN caches in ThreadedQuarantineTest to get more predictable incremental heap memory usage measurements. Reviewers: eugenis Patch by Alex Shlyapnikov. Subscribers: aemerson, kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D28061 llvm-svn: 290371
* Increase the treshold in unit test to accomodate for qurantine size increase.Evgeniy Stepanov2016-12-211-1/+2
| | | | | | | | | | | | Reviewers: eugenis Patch by Alex Shlyapnikov. Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D28029 llvm-svn: 290279
* [asan] Allow re-exec in instrumented unit tests on Darwin (fix unit tests on ↵Kuba Mracek2016-11-301-1/+10
| | | | | | | | | | macOS <=10.10) This fixes https://llvm.org/bugs/show_bug.cgi?id=30285. On macOS 10.10 and lower, instrumented unit tests still need to be able to re-exec to make interceptors work. Differential Revision: https://reviews.llvm.org/D24699 llvm-svn: 288224
* [asan/win] Fix incremental linking vs. global registrationReid Kleckner2016-11-231-2/+0
| | | | | | | | | | The MSVC incremental linker pads every global out to 256 bytes in case it changes size after an incremental link. So, skip over null entries in the DSO-wide asan globals array. This only works if the global padding size is divisible by the size of the asan global object, so add some defensive CHECKs. llvm-svn: 287780
* [asan] Create a .ASAN$G(A-Z) section for global registrationReid Kleckner2016-11-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: The expectation is that new instrumented code will add global variable metadata to the .ASAN$GL section, and we will use this new code to iterate over it. This technique seems to break when using incremental linking, which seems to align every global to a 256 byte boundary. Presumably this is so that it can incrementally cope with global changing size. Clang already passes -incremental:no as a linker flag when you invoke it to do the link step. The two tests added for this feature will fail until the LLVM instrumentation change in D26770 lands, so they are marked XFAIL for now. Reviewers: pcc, kcc, mehdi_amini, kubabrecka Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D26771 llvm-svn: 287246
* [tests] Use __SSE2__ (rather than __i686__...) for SSE2 ASAN testMichal Gorny2016-11-171-1/+1
| | | | | | | | | | | | | Use the __SSE2__ to determine whether SSE2 is enabled in the ASAN tests rather than relying on either of the __i686__ and __x86_64__. The former is only set with explicit -march=i686, and therefore misses most of the x86 CPUs that support SSE2. __SSE2__ is in turn defined if the current settings (-march, -msse2) indicate that SSE2 is supported which should be more reliable. Differential Revision: https://reviews.llvm.org/D26763 llvm-svn: 287245
* [asan] Add more dynamic CRT mode testsReid Kleckner2016-11-022-2/+27
| | | | | | | | | | | | Only tests using %clang_cl_asan were using the dynamic CRT before this. The unit tests and lit tests using %clangxx_asan were using the static CRT. Many cross-platform tests fail with the dynamic CRT, so I had to add win32-(static|dynamic)-asan lit features. Also deletes some redundant tests in TestCases/Windows that started failing with this switch. llvm-svn: 285821
* [asan] Stop appending -lm, -pthread and other linker options on Darwin for ↵Kuba Brecka2016-09-231-6/+7
| | | | | | | | | | ASan unit tests On Darwin, -lm, -pthread and others are implied. -pthread currently produces a warning (compiler option unused). Differential Revision: https://reviews.llvm.org/D24698 llvm-svn: 282260
* [compiler-rt] Do not introduce __sanitizer namespace globallyAnna Zaks2016-09-151-0/+2
| | | | | | | | | | | | The definitions in sanitizer_common may conflict with definitions from system headers because: The runtime includes the system headers after the project headers (as per LLVM coding guidelines). lib/sanitizer_common/sanitizer_internal_defs.h pollutes the namespace of everything defined after it, which is all/most of the sanitizer .h and .cc files and the included system headers with: using namespace __sanitizer; // NOLINT This patch solves the problem by introducing the namespace only within the sanitizer namespaces as proposed by Dmitry. Differential Revision: https://reviews.llvm.org/D21947 llvm-svn: 281657
* [powerpc] Move #if to appease warnings-as-errors testsBill Seurer2016-09-081-3/+2
| | | | | | Previous patch added a #if which causes some unused identifier warnings. llvm-svn: 280976
* [powerpc] Move #if to appease warnings-as-errors testsBill Seurer2016-09-071-3/+4
| | | | | | | Previous patch added a #if which caused a variable and function to be unused. llvm-svn: 280846
* [powerpc] Disable ManyThreadsWithStatsStressTest test for ppc64Bill Seurer2016-09-071-0/+4
| | | | | | | | Since r279664 this test causes frequent failures of test runs for ppc64le and occasional failures for ppc64be which makes buildbot results unreliable. If the underlying problem is fixed it can be re-enabled. llvm-svn: 280823
* [asan] Fix OOB_char on arm 32bitVitaly Buka2016-08-231-1/+1
| | | | | | | | | | | | | | | | Summary: This does not actually fixes the test. AddressSanitizer::OOB_char behavior is inconsistent but it somehow usually works. On arm it runs more iterations than expected. And adding a new test with AddressSanitizerInterface prefix, even empty, somehow breaks OOB_char test. So I will rename my test to make the bot green and will continue to investigate the test. Reviewers: krasin Subscribers: aemerson, rengolin, kubabrecka, llvm-commits, samparker Differential Revision: https://reviews.llvm.org/D23790 llvm-svn: 279501
* [asan] Add __asan_set_shadow_*Vitaly Buka2016-08-182-0/+37
| | | | | | | | | | | | | | | | Summary: We are poisoning small allocas using store instruction from instrumented code. For larger allocas we'd like to insert function calls instead of multiple stores. PR27453 Reviewers: kcc, eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23616 llvm-svn: 279019
* [compiler-rt] Fix warnings in interception codeEtienne Bergeron2016-07-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch is re-introducing the code to fix the dynamic hooking on windows and to fix a compiler warning on Apple. Related patches: * https://reviews.llvm.org/D22641 * https://reviews.llvm.org/D22610 * https://reviews.llvm.org/rL276311 * https://reviews.llvm.org/rL276490 Both architecture are using different techniques to hook on library functions (memchr, strcpy,...). On Apple, the function is not dynamically hooked and the symbol always points to a valid function (i.e. can't be null). The REAL macro returns the symbol. On windows, the function is dynamically patch and the REAL(...) function may or may not be null. It depend on whether or not the function was hooked correctly. Also, on windows memcpy and memmove are the same. ``` #if !defined(__APPLE__) [...] # define REAL(x) __interception::PTR_TO_REAL(x) # define ASSIGN_REAL(dst, src) REAL(dst) = REAL(src) [...] #else // __APPLE__ [...] # define REAL(x) x # define ASSIGN_REAL(x, y) [...] #endif // __APPLE__ Reviewers: rnk Subscribers: kcc, hans, kubabrecka, llvm-commits, bruno, chrisha Differential Revision: https://reviews.llvm.org/D22758 llvm-svn: 276885
* Revert "fix https://reviews.llvm.org/D22610" and "[compiler-rt] Fix ↵Bruno Cardoso Lopes2016-07-221-2/+0
| | | | | | | | | | | | memmove/memcpy overlap detection on windows" This currently fails ~500 tests on Darwin: http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/20456/ This reverts commit 4cfee0dff1facb8fa2827d25c5943bfef96d1a8f and dbd91205d578cb61ab77be06087e9f65ba8a7ec8. llvm-svn: 276490
* [compiler-rt] Fix memmove/memcpy overlap detection on windowsEtienne Bergeron2016-07-211-0/+2
| | | | | | | | | | | | | | | | | | | | Summary: The memcpy and memmove functions are the same on windows. The overlap detection logic is incorrect. printf-1 test: ``` stdin>:2:114: note: possible intended match here ==877412==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x0000002bf2a8,0x0000002bf2ad) and [0x0000002bf2a9, 0x0000002bf2ae) overlap ``` ^ Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: https://reviews.llvm.org/D22610 llvm-svn: 276299
* [compiler-rt] Disable a test failing on windows.Etienne Bergeron2016-07-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The unittest is not working on windows. The "regexp.h" is not available and gtest-port won't support regexp with operator '|'. The test wasn't failing on 32-bits because of this check: ``` if (SANITIZER_WORDSIZE != 64 || ASAN_AVOID_EXPENSIVE_TESTS) return; ``` ``` [ RUN ] AddressSanitizer.HugeMallocTest C:/src/llvm/llvm/utils/unittest/googletest\src/gtest-port.cc(272): error: Failed Syntax error at index 30 in simple regular expression "is located 1 bytes to the left|AddressSanitizer failed to allocate": '|' is unsupported. C:/src/llvm/llvm/projects/compiler-rt/lib/asan/tests/asan_test.cc(308): error: Death test: Ident((char*)malloc(n_megs << 20))[-1] = 0 Result: died but not with expected error. Expected: is located 1 bytes to the left|AddressSanitizer failed to allocate ``` See gtest-port.h: ``` #elif GTEST_OS_WINDOWS // <regex.h> is not available on Windows. Use our own simple regex // implementation instead. # define GTEST_USES_SIMPLE_RE 1 ``` Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D22257 llvm-svn: 275181
* [compiler-rt] Fix VisualStudio virtual folders layoutEtienne Bergeron2016-07-111-7/+8
| | | | | | | | | | | | | | | | | | | | 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 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 llvm-svn: 274386
* tab to whitespacesEtienne Bergeron2016-07-011-2/+2
| | | | llvm-svn: 274382
* [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
* [compiler-rt] Fix multi-configuration output pathsEtienne Bergeron2016-05-161-6/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [ASan] Add shadow offset for SystemZ.Marcin Koscielnicki2016-04-301-0/+2
| | | | | | | | This is the compiler-rt counterpart to D19650. Differential Revision: http://reviews.llvm.org/D19652 llvm-svn: 268162
* [ASan] Reenable __builtin_setjmp test on PowerPC, disable on SystemZ.Marcin Koscielnicki2016-04-281-6/+5
| | | | | | | | | | | | Since __builtin_setjmp has been fixed by rL267943, the test now works on PowerPC. Enable it. On the other hand, the SystemZ backend doesn't currently support __builtin_setjmp. Disable it. Differential Revision: http://reviews.llvm.org/D19657 llvm-svn: 267946
* Move -fms-compatibility-version=19 into target cflagsReid Kleckner2016-03-221-5/+0
| | | | | | | This reduces cflags duplication and allows us to build sanitizer_common/tests with clang and the VS 2015 STL. llvm-svn: 264017
* [asan] Pass -fms-compatibility-version=19 with VS 2015Reid Kleckner2016-03-211-0/+5
| | | | | | | This resolves errors about char16_t and char32_t when compiling 2015 STL headers with clang. llvm-svn: 263973
* [sanitizer] On OS X, verify that interceptors work and abort if not, take 2Kuba Brecka2016-03-172-1/+6
| | | | | | | | | | On OS X 10.11+, we have "automatic interceptors", so we don't need to use DYLD_INSERT_LIBRARIES when launching instrumented programs. However, non-instrumented programs that load TSan late (e.g. via dlopen) are currently broken, as TSan will still try to initialize, but the program will crash/hang at random places (because the interceptors don't work). This patch adds an explicit check that interceptors are working, and if not, it aborts and prints out an error message suggesting to explicitly use DYLD_INSERT_LIBRARIES. TSan unit tests run with a statically linked runtime, where interceptors don't work. To avoid aborting the process in this case, the patch replaces `DisableReexec()` with a weak `ReexecDisabled()` function which is defined to return true in unit tests. Differential Revision: http://reviews.llvm.org/D18212 llvm-svn: 263695
OpenPOWER on IntegriCloud