summaryrefslogtreecommitdiff
path: root/lib/msan/tests/msan_test.cc
AgeCommit message (Collapse)Author
2017-11-30Linux needs to include sys/uio.h for readv, preadvStephan Bergmann
...at least when building against glibc-2.26-16.fc27.x86_64 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319412 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-08-02[msan] Check for pvalloc overflowKostya Kortchinsky
Summary: CheckForPvallocOverflow was introduced with D35818 to detect when pvalloc would wrap when rounding up to the next multiple of the page size. Add this check to MSan's pvalloc implementation. This time I made sure I was actually running (and writing) the correct tests, and that they are passing... Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36164 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-31[msan] Reverting D36093Kostya Kortchinsky
Summary: Reverting D36093 until I can figure out how to launch the correct tests :/ My apologies. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36120 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309637 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-31[msan] Check for pvalloc overflowKostya Kortchinsky
Summary: `CheckForPvallocOverflow` was introduced with D35818 to detect when pvalloc would wrap when rounding up to the next multiple of the page size. Add this check to MSan's pvalloc implementation. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36093 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309601 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27[msan] Intercept wcscat, wcsncat.Evgeniy Stepanov
Also move wcslen, wscnlen to common interceptors. Reviewers: vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D34656 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306482 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-12[msan] Remove a failing test from MemorySanitizer.ICmpRelationalAlexander Potapenko
This is a follow-up to r302787, which broke MemorySanitizer.ICmpRelational. MSan is now reporting a false positive on the following test case: TestForNotPoisoned((poisoned(-1, 0x80000000U) >= poisoned(-1, 0U))) , which is sort of anticipated, because we're approximating the comparison with an OR of the arguments' shadow values. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302887 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-10[msan] Fix getmntent{_r} for empty /etc/fstabAdhemerval Zanella
Some configuration (for instance default docker ubuntu images) uses a default empty and invalid /etc/fstab configuration file. It makes any call to getmntent return NULL and it leads to failures on Msan-aarch64{-with-call}-Test/MemorySanitizer.getmntent{_r}. This patch fixes it by creating a temporary file with some valid entries (although not valid for the system) to use along with setmntent/getmntent. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302639 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-13[msan] Fix msan_test.cc by checking bind results before assuming IPv6 supported.Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300250 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13Revert "[msan] Fix msan_test broken after r299884."Vitaly Buka
This does not fix the test, it still fails to bind. This reverts commit r300150. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300249 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13[msan] Fix msan_test broken after r299884.Vitaly Buka
Bind to ANY as some machines may have IPv6 support but without IPv6 on loopback interface. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31998 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300150 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13[msan] Fix invalid use of vector constructor introduced by r299884.Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300149 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10[msan] Choose in runtime if IPv4 or IPv6 are supported.Vitaly Buka
Summary: This reverts commit cab5051c691ce27a7ffac41e8e76ceb222ad9549. Reviewers: eugenis Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D31894 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10[msan] Wrap sockaddr_in and socket for future IPv6 support.Vitaly Buka
Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31893 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10[msan] Reorder unittests for future parametrization.Vitaly Buka
Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31892 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-29[sanitizers] Fix get_groups interceptor in sanitizer ↵Kostya Serebryany
(https://reviews.llvm.org/D31332, patch by Martin Liška) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299036 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-03[msan] Test for _mm_getcsr and _mm_setcsr (r296848).Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@296849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-20[msan] Disable prlimit test on glibc < 2.13.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279352 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31__builtin_ia32_storeups is no more. Replace it with xmmintrin.h intrinsic.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09[MSan] Add a test for vararg with lots of non-vararg arguments.Marcin Koscielnicki
This is a testcase for http://llvm.org/PR27646, hitting the bug on x86_64, aarch64, mips. Differential Revision: http://reviews.llvm.org/D19944 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29[msan] Tests for vector compare intrinsics.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20[msan] Implement GetPageSize in the test.Evgeniy Stepanov
Instead of calling a sanitizer_common function, implement GetPageSize in the test directly. MSan runtime does not export __sanitizer::* symbols, and the current code breaks when the test and the runtime library are in the separate link units (ex. when the test is built as a shared library). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-18[msan] Don't hardcode 4kiB page size in msan_test.cc.Marcin Koscielnicki
This breaks the valloc test on PowerPC, which has 64kiB pages. Since getting page size portably is nontrivial, and there's already a function for that in __sanitizer, just use it. Unfortunately, sanitizer_common.h conflicts with the interface headers inclucded by msan_test.cc (and a few of its own macros), so we have to declare it manually. Differential Revision: http://reviews.llvm.org/D19227 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-18[MSan] [PowerPC] Add loadable library name for testing.Marcin Koscielnicki
Differential Revision: http://reviews.llvm.org/D19217 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266646 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25[Compiler-rt][MSan]Fix shmat testcase: Pass SHMLBA-alligned address to shmatMohit K. Bhakkad
Reviewers: samsonov Subscribers: jaydeep, sagar, llvm-commits Differential Revision: http://reviews.llvm.org/D17262 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17[msan] Extend prlimit test.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17[msan] Intercept prlimit.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16[Compiler-rt][MSan][MIPS] Resolve gethostbyname_r_erange for MIPSMohit K. Bhakkad
Reviewers: eugenis, kcc, samsonov Subscribers: jaydeep, sagar, llvm-commits Differential Revision: http://reviews.llvm.org/D17135 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260946 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12Fix MemorySanitizer.ptrtoint test on big-endian targets.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260749 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24[compiler-rt] [msan] Couple of fixes for msan with libc++Adhemerval Zanella
This patch adds some fixes for MSAN with libc++ for aarch64: 1. Adds the libmsan_loadable name for aarch64. 2. Fixes some pthread_attr_setstacksize for aarch64, since glibc sets the mininum stack size to be higher than the x86_64 default (16KB vs 128KB). 3. Fixes a swprintf null char constant definition. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254015 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-26[compiler-rt] Add common interceptor for wcrtomb. Eric Fiselier
Summary: Currently there is a libc++ test failing under MSAN because wcrtomb is not intercepted. This patch adds an interceptor for it. Reviewers: samsonov, eugenis Subscribers: tberghammer, danalbert, srhines, llvm-commits Differential Revision: http://reviews.llvm.org/D12311 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245994 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26[msan] Fix MsanTest to pass in track_origins=2 mode.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@230639 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-18[MSan][MIPS] Fix for some failing tests on MIPS64Mohit K. Bhakkad
Enabling internal ptrace for mips, which fixes some ptrace related tests. Along with this fixing some other failures. Reviewers: Reviewers: eugenis, kcc, samsonov Subscribers: dsanders, sagar, lldb-commits Differential Revision: http://reviews.llvm.org/D7332 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229656 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17[Msan] Fix the unit tests' PathToLoadable() to work on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7587 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229491 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[msan] Fix UnalignedLoad/UnalignedStore tests.Evgeniy Stepanov
Add alignment attrubutes to ensure that the tests actually test unaligned access irrespective of the stack layout. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229398 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Improve the EXPECT_NOT_POISONED() macro to provide the original line ↵Viktor Kutuzov
number Differential Revision: http://reviews.llvm.org/D7341 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229389 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Make unit tests that use mempcpy() passing on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7588 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229388 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Disable the fgetgrent_r unit test on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7343 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229387 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Disable fcvt unit tests on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7340 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229386 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Fix the getgrnam_r unit test to pass on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7339 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229385 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Fix the sigaction unit test to build on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7335 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229384 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16[Msan] Fix the ether unit test to build on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7334 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229383 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04[Msan] Fix the pthread_attr_get unit test to build on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7342 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@228125 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02Fix missed #endif in rL227790.Viktor Kutuzov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227797 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02[Msan] Disable unit tests for non-FreeBSD functions on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7252 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227790 91177308-0d34-0410-b5e6-96231b3b80d8