summaryrefslogtreecommitdiff
path: root/test/msan
AgeCommit message (Collapse)Author
2017-12-12[msan] LIT: Add lld testing configRoman Lebedev
Summary: A follow-up for D39508, with memory sanitizer changes. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: mgorny, mehdi_amini, kcc, #sanitizers, llvm-commits Tags: #sanitizers, #lld Differential Revision: https://reviews.llvm.org/D40768 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320514 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12[CMake] Support runtimes and monorepo layouts when looking for libcxxPetr Hosek
This also slightly refactors the code that's checking the directory presence which allows eliminating one unnecessary variable. Differential Revision: https://reviews.llvm.org/D40637 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320446 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Update sanitizer tests for C++14 default in ClangTim Northover
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320251 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Revert change in test/msan/textdomain.cc for NetBSDKamil Rytarowski
SVN r. 320226 This breaks Linux. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320236 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Fix test/msan/iconv.cc on NetBSDKamil Rytarowski
Summary: NetBSD still uses the old POSIX iconv(3) signature with the 2nd const argument. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41017 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320228 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Fix test/msan/textdomain.cc on NetBSDKamil Rytarowski
Summary: This tests must be linked with -lintl for the gettext(3) features. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41013 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320226 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Disable test/msan/tsearch.cc on NetBSDKamil Rytarowski
Summary: This test uses GNU-specific extension to libc: tdestroy() and as-is is not compatible with NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41011 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320225 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Disable test/msan/pvalloc.cc on NetBSDKamil Rytarowski
Summary: The pvalloc(3) function is a non-standard extension missing on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41014 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320224 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Fix test/msan/ifaddrs.cc for NetBSDKamil Rytarowski
Summary: NetBSD requires to include <sys/socket.h> for struct sockaddr. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41015 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Disable test/msan/ftime.cc on NetBSDKamil Rytarowski
Summary: ftime(3) has been removed from libc/NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41018 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-25[msan] Intercept __strxfrm_l.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316613 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-25Add NetBSD improvements in sanitizersKamil Rytarowski
Summary: Changes: * Add initial msan stub support. * Handle NetBSD specific pthread_setname_np(3). * NetBSD supports __attribute__((tls_model("initial-exec"))), define it in SANITIZER_TLS_INITIAL_EXEC_ATTRIBUTE. * Add ReExec() specific bits for NetBSD. * Simplify code and add syscall64 and syscall_ptr for !NetBSD. * Correct bunch of syscall wrappers for NetBSD. * Disable test/tsan/map32bit on NetBSD as not applicable. * Port test/tsan/strerror_r to a POSIX-compliant OSes. * Disable __libc_stack_end on NetBSD. * Disable ReadNullSepFileToArray() on NetBSD. * Define struct_ElfW_Phdr_sz, detected missing symbol by msan. * Change type of __sanitizer_FILE from void to char. This helps to reuse this type as an array. Long term it will be properly implemented along with SANITIZER_HAS_STRUCT_FILE setting to 1. * Add initial NetBSD support in lib/tsan/go/buildgo.sh. * Correct referencing stdout and stderr in tsan_interceptors.cc on NetBSD. * Document NetBSD x86_64 specific virtual memory layout in tsan_platform.h. * Port tests/rtl/tsan_test_util_posix.cc to NetBSD. * Enable NetBSD tests in test/msan/lit.cfg. * Enable NetBSD tests in test/tsan/lit.cfg. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis, kcc, dvyukov Reviewed By: dvyukov Subscribers: #sanitizers, llvm-commits, kubamracek Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D39124 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316591 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10Factor out "stable-runtime" feature and enable it on all android.Evgeniy Stepanov
This is a very poorly named feature. I think originally it meant to cover linux only, but the use of it in msan seems to be about any aarch64 platform. Anyway, this change should be NFC on everything except Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315389 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-05[msan] Check sigset_t and sigaction arguments.Evgeniy Stepanov
Summary: Check sigset_t arguments in ppoll, sig*wait*, sigprocmask interceptors, and the entire "struct sigaction" in sigaction. This can be done because sigemptyset/sigfullset are intercepted and signal masks should be correctly marked as initialized. Reviewers: vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D37367 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312576 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-04[msan] Switch the pvalloc overflow test to a lit testBenjamin Kramer
The test was not passing on targets where allocator_may_return_null defaults to true. Change the test to a lit test so that we can test both situations. Patch by Kostya Kortchinsky! Differential Revision: https://reviews.llvm.org/D36302 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310033 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-18[Sanitizers] ASan/MSan/LSan allocators set errno on failure.Alex Shlyapnikov
Summary: ASan/MSan/LSan allocators set errno on allocation failures according to malloc/calloc/etc. expected behavior. MSan allocator was refactored a bit to make its structure more similar with other allocators. Also switch Scudo allocator to the internal errno definitions. TSan allocator changes will follow. Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D35275 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308344 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-16[msan] Add missing include for fix test on WindowsVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308122 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28[Sanitizers] Operator new() interceptors always die on allocation errorAlex Shlyapnikov
Summary: Operator new interceptors behavior is now controlled by their nothrow property as well as by allocator_may_return_null flag value: - allocator_may_return_null=* + new() - die on allocation error - allocator_may_return_null=0 + new(nothrow) - die on allocation error - allocator_may_return_null=1 + new(nothrow) - return null Ideally new() should throw std::bad_alloc exception, but that is not trivial to achieve, hence TODO. Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D34731 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306604 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07[tsan]: Fix GNU version of strerror_r interceptorVitaly Buka
GNU version of strerror_r returns a result pointer that doesn't match the input buffer. The result pointer is in fact a pointer to some internal storage. TSAN was recording a write to this location, which was incorrect. Fixed https://github.com/google/sanitizers/issues/696 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01[asan] Add strndup/__strndup interceptors.Pierre Gousseau
Recommit of r302781 with Vitaly Buka's fix for non zero terminated strings. Differential Revision: https://reviews.llvm.org/D31457 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@304399 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-18Revert r302781 and subsequent attempts to disable part of it.Daniel Jasper
The Msan unit tests are still broken and by this point, I think we should start over. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303339 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-18Fixup r303324 - temporary disable stndup interceptor, due to r302781 being buggyDiana Picus
r303324 missed one of the tests added by r302781. This commit applies the same fix as r303324 to the missed test (strndup.cc). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303338 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11Renumber test line number expectations after r302783.Benjamin Kramer
Also remove a confused stable-runtimes requirement. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302801 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11[msan] add a regression test for PR32842Alexander Potapenko
Make sure MSan doesn't miss a bug comparing two integers with defined low bits. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302788 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11[MSAN] test failed randomly on ARM when XFAILED for MIPSRenato Golin
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302786 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11mips] XFAIL wcsncpy.cc test.Simon Dardis
The stack unwinder fails to unwind the stack past the interceptor stack frame, resulting in a test failure. XFAIL this for now. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302783 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11[asan] Recommit of r301904: Add strndup/__strndup interceptorsPierre Gousseau
Fix undeclared __interceptor_malloc in esan_interceptors.cc Fix undeclared strnlen on OSX Differential Revision: https://reviews.llvm.org/D31457 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302781 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-09[compiler-rt][mips] Fix a test for mips.Simon Dardis
GCC 4.9.2 likes the specialize one of the memcpys in msan_interceptors.cc, leading to test failure. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302561 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02Revert r301904 causing tsan test failure in x86_64-linux-autoconfPierre Gousseau
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301909 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02[asan] Add strndup/__strndup interceptors if targeting linux.Pierre Gousseau
Differential Revision: https://reviews.llvm.org/D31457 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10[msan] Make test to fall-back to IPv6 if IPv4 is not available.Vitaly Buka
Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31896 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10[msan] Replace AF_INET with AF_UNIX to avoid IPv4 vs IPv6 issues.Vitaly Buka
Summary: This reverts commit 79cf16bf224d6ac9fb9e0356c5947ebc4fd6ff92. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31895 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299860 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30[sanitizer] Move fread and fwrite interceptors to sanitizer_commonMaxim Ostapenko
{M, T, E}San have fread and fwrite interceptors, let's move them to sanitizer_common to enable ASan checks as well. Differential Revision: https://reviews.llvm.org/D31456 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299061 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16[msan] Intercept getloadavg.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@297923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15[msan] Relax lit check in wcsncpy.ccEric Liu
Summary: The CHECK failed when the name is __interceptor_wcsncpy Reviewers: bkramer, eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D30975 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@297828 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-14[msan] Intercept wcsncpy, wcsnlen.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@297793 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24[msan] Test for alloca handling.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@296051 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15[msan] Intercept getutent and friends.Evgeniy Stepanov
Differential Revision: https://reviews.llvm.org/D27791 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@289878 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08[MSAN][MIPS] Fix fork.cc test on MIPSSagar Thakur
Summary: For platforms which support slow unwinder only, we restrict the store context size to 1, basically only storing the current pc. We do this because the slow unwinder which is based on libunwind is not async signal safe and causes random freezes in forking applications as well as in signal handlers. Reviewed by eugenis. Differential: D23107 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@289027 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06Replace "|&" with "2>&1 |" to support bash pre-4Evgeniy Stepanov
Summary: Old bash release (3.2) on SLES11 chokes on new redirection shortcut. Patch by Brian Cain. Reviewers: eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D27443 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@288854 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29[sanitizer] Add macOS minimum deployment target to all compiler invocations ↵Kuba Mracek
in lit tests The Clang driver on macOS decides the deployment target based on various things, like your host OS version, the SDK version and some environment variables, which makes lit tests pass or fail based on your environment. Let's make sure we run all lit tests with `-mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}` (10.9 unless overriden). Differential Revision: https://reviews.llvm.org/D26929 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@288186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11[MSAN][MIPS] Fix test Linux/syscalls_sigaction.cc on mips64Sagar Thakur
Changed the kernel sigaction structure in test syscalls_sigaction.cc for MIPS according to the structure defined in kernel. Reviewed by eugenis. Differential: https://reviews.llvm.org/D25814 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@286583 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07Use -fsanitize-recover instead of -mllvm -msan-keep-going: tests.Evgeniy Stepanov
Summary: Use -fsanitize-recover instead of -mllvm -msan-keep-going: unit tests. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26355 Patch by Aleksey Shlyapnikov. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@286149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-23[compiler-rt] Remove redundant --check-prefix=CHECK from testMandeep Singh Grang
Reviewers: eugenis, rengolin Subscribers: dberris Differential Revision: https://reviews.llvm.org/D25892 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@284932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21Fix typo (ordered comparison between pointer and 0).Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@284886 91177308-0d34-0410-b5e6-96231b3b80d8
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-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-08-25msan: Enable 48-bit VMA support on aarch64Adhemerval Zanella
This patch adds 48-bits VMA support for msan on aarch64. As current mappings for aarch64, 48-bit VMA also supports PIE executable. The 48-bits segments only cover the usual PIE/default segments plus some more segments (262144GB total, 0.39% total VMA). Memory avaliability can be increase by adding multiple application segments like 39 and 42 mapping (some mappings were added on this patch as well). Tested on 39 and 48-bit VMA kernels on aarch64. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279752 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18[mips][msan] Fix all the XPASSes following r278793 and r278795Daniel Sanders
All msan tests are now passing for mipsel and mips64el except for allocator_mapping.cc which is marked unsupported. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16[MSAN][MIPS] Changed memory mapping to support pie executable.Sagar Thakur
Reviewed by eugenis Differential: D22993 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278793 91177308-0d34-0410-b5e6-96231b3b80d8