summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2016-09-23[msan] Disable flaky fork.cc on PPC64.Evgeniy Stepanov
This test is very flaky on PPC64 (both BE and LE), but not on other platforms. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23Fix the following tests when running under cross-compilation:Chad Rosier
Profile-aarch64 :: Linux/comdat_rename.test Profile-aarch64 :: Linux/extern_template.test Profile-aarch64 :: Linux/instrprof-comdat.test Profile-aarch64 :: Linux/instrprof-cs.c The issue is that the created (aarch64) binaries were attempting to run natively instead of running through %run, which guarantees running in the proper environment if the compilation was configured correctly. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282264 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23[compiler-rt] Fix a broken asan 64-bit test using ld_preloadEtienne Bergeron
Summary: The 'asan_preload_test-1.cc' is not working with the i686 architecture. To repro the error, run on a linux 64-bit: ``` ninja check-asan-dynamic ``` The following error occurs: ``` -- Exit Code: 1 Command Output (stderr): -- /home/llvm/llvm/projects/compiler-rt/test/asan/TestCases/Linux/asan_preload_test-1.cc:18:12: error: expected string not found in input // CHECK: AddressSanitizer: heap-buffer-overflow ^ <stdin>:1:1: note: scanning from here ERROR: ld.so: object 'libclang_rt.asan-i686.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ^ <stdin>:2:10: note: possible intended match here ==25982==AddressSanitizer CHECK failed: /home/llvm/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:736 "((__interception::real_memcpy)) != (0)" (0x0, 0x0) ``` The unittest is running (where %shared_libasan is replaced by libclang_rt.asan-i686.so): ``` // RUN: env LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s ``` But the executable also has a dependancy on libclang_rt.asan-i386.so (added by the clang driver): ``` linux-gate.so.1 => (0xf77cc000) libclang_rt.asan-i386.so => not found libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf76ba000) libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7673000) libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7656000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf74a7000) ``` By looking to the clang driver (tools.cpp) we can see that every x86 architecture are mapped to 'i386'. ``` StringRef MyArch; switch (getToolChain().getArch()) { case llvm::Triple::arm: MyArch = "arm"; break; case llvm::Triple::x86: MyArch = "i386"; break; case llvm::Triple::x86_64: MyArch = "amd64"; break; default: llvm_unreachable("Unsupported architecture"); } ``` This patch is implementing the same mapping but in the compiler-rt unittest. Reviewers: rnk, vitalybuka Subscribers: aemerson, kubabrecka, dberris, llvm-commits, chrisha Differential Revision: https://reviews.llvm.org/D24838 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22cfi: Fixes for check-cfi when configured as an external project.Peter Collingbourne
Differential Revision: https://reviews.llvm.org/D24817 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22tsan: support pie binaries on newer kernelsDmitry Vyukov
4.1+ Linux kernels map pie binaries at 0x55: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d1fd836dcf00d2028c700c7e44d2c23404062c90 Currently tsan does not support app memory at 0x55 (https://github.com/google/sanitizers/issues/503). Older kernels also map pie binaries at 0x55 when ASLR is disables (most notably under gdb). This change extends tsan mapping for linux/x86_64 to cover 0x554-0x568 app range and fixes both 4.1+ kernels and gdb. This required to slightly shrink low and high app ranges and move heap. The mapping become even more non-linear, since now we xor lower bits. Now even a continuous app range maps to split, intermixed shadow ranges. This breaks ShadowToMemImpl as it assumes linear mapping at least within a continuous app range (however it turned out to be already broken at least on arm64/42-bit vma as uncovered by r281970). So also change ShadowToMemImpl to hopefully a more robust implementation that does not assume a linear mapping. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22[ESan][MIPS] Fix tests struct-simple.cpp on MIPSSagar Thakur
For mips assember '#' is the start of comment. We get assembler error messages if # is used in the struct names. Therefore using '$' which works for all architectures. Differential: D24335 Reviewed by: zhaoqin git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282142 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21Remove obsolete XFAIL.Nico Weber
The sanitizer-windows bot is currently red because this test unexpectedly passes. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282095 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21Revert "[sanitizers] Update sanitizers test to better match glibc internals"Diana Picus
This reverts commit r282061 because it broke the clang-cuda-build bot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282064 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21[sanitizers] Update sanitizers test to better match glibc internalsDiana Picus
One of the tests relying on sem_t's layout gets the wrong value for versions of glibc newer than 2.21 on platforms that don't have 64-bit atomics (e.g. ARM). This commit fixes the test to work with: * versions of glibc >= 2.21 on platforms with 64-bit atomics: unchanged * versions of glibc >= 2.21 on platforms without 64-bit atomics: the semaphore value is shifted by SEM_VALUE_SHIFT (which is set to 1 in glibc's internal headers) * versions of glibc < 2.21: unchanged See the glibc 2.23 sources: * sysdeps/nptl/internaltypes.h (struct new_sem for glibc >= 2.21 and struct old_sem for glibc < 2.21) * nptl/sem_getvalue.c This was uncovered on one of the new buildbots that we are trying to move to production. Differential Revision: https://reviews.llvm.org/D24766 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282061 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20[scudo] Fix a bug in the new Secondary AllocatorKostya Kortchinsky
Summary: GetActuallyAllocatedSize() was not accounting for the last page of the mapping being a guard page, and was returning the wrong number of actually allocated bytes, which in turn would mess up with the realloc logic. Current tests didn't find this as the size exercised was only serviced by the Primary. Correct the issue by subtracting PageSize, and update the realloc test to exercise paths in both the Primary and the Secondary. Reviewers: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24787 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282030 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20XFAIL cfi/stats.cpp on Windows until we fix LLDReid Kleckner
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20[asan] Fix GlobalAddressDescription::Print()Filipe Cabecinhas
Summary: Check bug_type for nullptr before calling internal_strcmp Reviewers: kcc, vitalybuka, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24773 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282012 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19[scudo] Modify Scudo to use its own Secondary AllocatorKostya Kortchinsky
Summary: The Sanitizer Secondary Allocator was not entirely ideal was Scudo for several reasons: decent amount of unneeded code, redundant checks already performed by the front end, unneeded data structures, difficulty to properly protect the secondary chunks header. Given that the second allocator is pretty straight forward, Scudo will use its own, trimming all the unneeded code off of the Sanitizer one. A significant difference in terms of security is that now each secondary chunk is preceded and followed by a guard page, thus mitigating overflows into and from the chunk. A test was added as well to illustrate the overflow & underflow situations into the guard pages. Reviewers: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24737 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19[sanitizer] rename __sanitizer_symbolize_data to ↵Kostya Serebryany
__sanitizer_symbolize_global (to avoid conflict with another definition) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19[sanitizer] add __sanitizer_symbolize_data (can only print the names of the ↵Kostya Serebryany
globals for now) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281886 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17[tsan] Update fork_atexit.cc to consistently print to stderr (and not stdout)Kuba Brecka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17[tsan] Update signal_cond.cc to write to stderr intead of stdoutKuba Brecka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16[asan] Remove the test as the fix is going to be removedVitaly Buka
Summary: I need to redu solution, existing is not good enough. PR28267 Reviewers: eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24490 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281687 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14[asan] add heap_profile=1 to asan to periodically print the heap profile. So ↵Kostya Serebryany
far this is a very basic heap-profile functionality git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281546 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14[asan] Enable -asan-use-private-alias on Darwin/Mach-O, add test for ODR ↵Kuba Brecka
false positive with LTO (compiler-rt part) The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (https://github.com/google/sanitizers/issues/647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case. Differential Revision: https://reviews.llvm.org/D24292 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281472 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14[tsan] Fix hanging gcd-apply and gcd-apply-race tests on macOS SierraKuba Brecka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281462 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13[asan] alloc_dealloc_mismatch=0 by default on Android.Evgeniy Stepanov
All known (to me) Android deployments are disabling this flag anyway. The in-tree script (asan_device_setup) does that, too. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281410 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13[asan] Remove lit -j5 flag for android tests.Evgeniy Stepanov
It makes the tests extremely slow due to high latency of the test launcher. The main reason for -j5 was high memory usage with handle_abort=1, which is now disabled in the test runner. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13[asan] Re-poison all redzones on activation.Evgeniy Stepanov
When running with start_deactivated=1 in ASAN_OPTIONS, heap redzones are not poisoned until the first instrumented module is loaded. This can cause false negatives even on memory allocated after activation, because redzones are normally poisoned only once when a new allocator region is mapped. This change attempts to fix it by iterating over all existing allocator chunks and poisoning their redzones. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13[asan] Add missing include for rand()Jonas Hahnfeld
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09[sanitizer] Add interceptor for ttyname_rKeno Fischer
Reviewers: eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24375 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281116 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09[asan] Disable handle_abort in Android tests.Evgeniy Stepanov
The same thing is already done on Mac. handle_abort slows down tests significantly because it triggers tombstone collection on Android; also, it changes failed test outcome from "not-crash" to "crash" (as in "bin/not --crash"). This change adds handle_abort=0 to asan options on android (test only!), and also tweaks android_run.py to semi-correctly pass the crash/no-crash status to the caller. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281075 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09[asan] Since r280945 fixed the OS X abort() problem, merge ↵Filipe Cabecinhas
scariness_score_test.cc and make it a general test. Summary: Merges back both scariness_score_test.cc files, since the Linux-specific version shouldn't be needed any more. Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24347 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09[sanitizer] fix a potential buffer overflow due to __sanitizer_symbolize_pc ↵Kostya Serebryany
(need to put a zero after strncmp). LOL git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281015 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08Revert "[ESan][MIPS] Adds support for MIPS64"Qin Zhao
Summary: This reverts commit 62b3eecdbe72af0255f0639b0446087a47efbf48. (D23799) The CL cause 13 ESan test failure on x86_64: Failing Tests (13): EfficiencySanitizer-x86_64 :: TestCases/large-stack-linux.c EfficiencySanitizer-x86_64 :: TestCases/libc-intercept.c EfficiencySanitizer-x86_64 :: TestCases/mmap-shadow-conflict.c EfficiencySanitizer-x86_64 :: TestCases/struct-simple.cpp EfficiencySanitizer-x86_64 :: TestCases/verbose-simple.c EfficiencySanitizer-x86_64 :: TestCases/workingset-early-fault.c EfficiencySanitizer-x86_64 :: TestCases/workingset-memset.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-midreport.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-samples.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-signal-posix.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-simple.cpp EfficiencySanitizer-x86_64 :: Unit/circular_buffer.cpp EfficiencySanitizer-x86_64 :: Unit/hashtable.cpp Unexpected Failures: 13 Reviewers: bruening, slthakur Subscribers: sdardis, kubabrecka, beanz Differential Revision: https://reviews.llvm.org/D24350 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280954 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08[tsan] Support C++11 call_once in TSan on DarwinKuba Brecka
This patch adds a wrapper for call_once, which uses an already-compiled helper __call_once with an atomic release which is invisible to TSan. To avoid false positives, the interceptor performs an explicit atomic release in the callback wrapper. Differential Revision: https://reviews.llvm.org/D24188 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08[asan] Test that asan does not report use-after-scope if program jumped over ↵Vitaly Buka
variable declaration. Summary: Test to check if PR28267 workaround works. PR28267 PR27453 Reviewers: eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24323 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07[sanitizer] Fix a conflict between abort_on_error and handle_abort.Evgeniy Stepanov
Reset the SIGABRT signal handler before calling abort(). Also, change the error message when catching SIGABRT to say "ABRT" instead of "SEGV". git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280885 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07[ESan][MIPS] Adds support for MIPS64Sagar Thakur
With this patch 10 out of 13 tests are passing. Following is the list of failing tests: struct-simple.cpp workingset-signal-posix.cpp mmap-shadow-conflict.c Reviewed by bruening Differential: D23799 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280795 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-02[asan] Move scariness_score_test.cc to a common subdirectoryFilipe Cabecinhas
Summary: Only one of the tests in it doesn't work on OS X. On Windows it seems that everything that is being moved is also supported. The abort() test wasn't copied over (original case 22). This is because it doesn't work on OS X. Reviewers: kcc, eugenis, vitalybuka Subscribers: kubabrecka, llvm-commits git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01Un-XFAIL cfi/stats.cpp, it passes since fixing llvm-symbolizer to look for ↵Reid Kleckner
dwarf again git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280422 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01Revert "Copy over most of the scariness_score test to the general tests"Filipe Cabecinhas
This reverts commit r280361 until we have the proper change in place. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280398 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01[CMake] Adding compiler-rt-test-depends targetChris Bieneman
This exposes a target for building the compiler-rt test dependencies and matches llvm-test-depends. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280393 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01Try to fix another profile testRenato Golin
Another CFG optimisation patch (280364) has broken bad profile tests, and this is a similar attempt to fix the test without changing the semantics. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280373 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01Fix profile test assuming dumb compilerRenato Golin
Commit r280364 has introduced some call-graph optmisations making a profiler test "fail" due to not expecting the compiler to be "smart", and fold constants across functions. This commit works around the issue, leaving the origial semantics intact. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280365 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01Copy over most of the scariness_score test to the general testsFilipe Cabecinhas
The abort() test wasn't copied over (original case 22). This is because it doesn't work on OS X. If theres no buildbot problem with this test later today, I will minimize the Linux version. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280361 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30XFAIL cfi/stats.cpp on Windows until we fix our DIA usageReid Kleckner
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280106 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30[mips][tsan] XFAIL on every MIPS platform an x86_64-specific test.Vasileios Kalintiris
The map32bit.cc test uses the MMAP_32BIT flag which is supported only on x86-64. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30[asan] Mark failing test as UNSUPPORTED.Akira Hatanaka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280055 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30[asan] Disable test on darwin botVitaly Buka
According logs asan detects the bug but string with file name is not found. I will investigate and fix the test. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280038 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29[asan] Attempt to fix test on darwin botVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29[asan] Remove runtime flag detect_stack_use_after_scopeVitaly Buka
Summary: We are going to use store instructions to poison some allocas. Runtime flag will require branching in instrumented code on every lifetime intrinsic. We'd like to avoid that. Reviewers: eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23967 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-27[asan] Disable tests more selectively.Akira Hatanaka
Add "target-arch+host-os" to the feature list to enable disabling the tests I committed in r279614 and r279880 more selectively. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-27[asan] Use "REQUIRES: x86_64-target-arch" to disable the test on i386.Akira Hatanaka
My attempt to disable this test on i386 by adding "UNSUPPORTED: i386-apple" in r279880 wasn't succesful, so I'm using REQUIRES instead. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-27[asan] restrict release_to_os_test.cc to x86_64Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279898 91177308-0d34-0410-b5e6-96231b3b80d8