summaryrefslogtreecommitdiff
path: root/lib/msan/tests
AgeCommit message (Collapse)Author
2017-12-05[msan] add strtouq msan interceptorVitaly Buka
Summary: Fixes https://github.com/google/sanitizers/issues/892 Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40853 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30[msan] Fix return type of mbrtowcVitaly Buka
Summary: Fixes https://github.com/google/oss-fuzz/issues/1009 Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40676 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319484 91177308-0d34-0410-b5e6-96231b3b80d8
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-07-28[compiler-rt] Add missing quotation marks to msan_compile invocationKrzysztof Parzyszek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309430 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28[sanitizer tests CMake] Factor out CMake logic for compiling sanitizer testsGeorge Karpenkov
Currently there's a large amount of CMake logic duplication for compiling sanitizer tests. If we add more sanitizers, the duplication will get even worse. This change factors out common compilation commands into a macro available to all sanitizers. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309405 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
2017-01-10Make cmake link flag naming consistentFrancis Ricci
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291539 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
2016-01-14Fix the cross compilation of unit tests. NFC (second attempt)Sumanth Gundapaneni
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13Revert r257686 "With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross ↵Hans Wennborg
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) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compilingSumanth Gundapaneni
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257686 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-10-21[msan] Build unit test shared library code with -fPIC.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250957 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-08Fix msan tests build.Evgeniy Stepanov
CMake build rules listed -I flags for two different libc++ header locations which broke when libc++ headers started using include_next. Also change -I to -isystem to avoid compiler warning about include_next. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249759 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-07-31[CMake] Don't build libc++ with MSan-with-calls instrumentation.Alexey Samsonov
Instead, refactor the build rules so that we build libc++ with MSan for each supported architecture. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@243785 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19CMake: Stop using LLVM's custom parse_arguments. NFCFilipe Cabecinhas
Summary: Use CMake's cmake_parse_arguments() instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc): http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments Since I was already changing these calls, I changed ARCH and LIB into ARCHS and LIBS to make it more clear that they're lists of arguments. Reviewers: eugenis, samsonov, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10529 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240120 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04[Sanitizer] Fix/suppress compiler warnings in unit tests.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@231293 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