summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/msan/tests
Commit message (Collapse)AuthorAgeFilesLines
* [msan] Blacklist __gxx_personality_v0.Evgenii Stepanov2019-10-312-4/+35
| | | | | | | | | | | | | | | | | | | | Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=31877. Fixes https://github.com/google/sanitizers/issues/1155. Enables exceptions in msan/tsan buid of libcxx, and in msan tests. -fdepfile-entry stuff is a workaround for https://reviews.llvm.org/D69290 (default blacklist missing from -MMD output). Reviewers: pcc, dvyukov Subscribers: mgorny, christof, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D69587
* Remove NOLINTs from compiler-rtVitaly Buka2019-09-111-22/+22
| | | | llvm-svn: 371687
* compiler-rt: Rename .cc file in lib/msan/tests to .cppNico Weber2019-08-014-6/+11
| | | | | | Like r367463, but for msan/tests. llvm-svn: 367563
* [compiler-rt][tests] Propagate COMPILER_RT_UNITTEST_LINK_FLAGSHubert Tong2019-05-011-1/+2
| | | | | | | | | | | | | | | | | | | | `COMPILER_RT_UNITTEST_LINK_FLAGS` is dropped in many places, unlike `COMPILER_RT_UNITTEST_CFLAGS`. This patch attempts to remove that inconsistency. Previously reviewed as part of D58951. Reviewers: sfertile, peter.smith, pzheng, phosek, Hahnfeld, nemanjai, jasonliu Reviewed By: sfertile Subscribers: jsji, kubamracek, dberris, mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60143 llvm-svn: 359733
* [Sanitizer] Add interceptor for wctombPavel Labath2019-03-291-0/+10
| | | | | | | | | | | | | | | | | Summary: This is required to avoid msan false positives for code using this function (although generally one should avoid using this function in favor of wcrtomb). Reviewers: eugenis, EricWF, vitalybuka Subscribers: srhines, kubamracek, fedor.sergeev, delcypher, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D59548 llvm-svn: 357240
* [msan] Fix BMI2 detection in msan tests, take 2.Jonas Hahnfeld2019-03-151-1/+1
| | | | | | | It's not enough if only one bit is present, we need to check that both are set. This finally fixes the test failures for me. llvm-svn: 356242
* [msan] Fix BMI2 detection in msan tests.Evgeniy Stepanov2019-03-121-1/+1
| | | | llvm-svn: 355885
* [msan] Properly guard tests added by r355348; NFCHubert Tong2019-03-081-4/+2
| | | | | | | r355348 uses builtins without proper guards, breaking the test on various platforms. llvm-svn: 355718
* [msan] Instrument x86 BMI intrinsics.Evgeniy Stepanov2019-03-041-1/+147
| | | | | | | | | | | | | | | | Summary: They simply shuffle bits. MSan needs to do the same with shadow bits, after making sure that the shuffle mask is fully initialized. Reviewers: pcc, vitalybuka Subscribers: hiraditya, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58858 llvm-svn: 355348
* [Sanitizer] Add interceptor for pthread_sigmaskPavel Labath2019-02-261-0/+8
| | | | | | | | | | | | | | | | | | | | | | Summary: pthread_sigmask is just like sigprocmask, except that its behavior in multithreaded programs is explicitly specified. Sanitizers were lacking a common interceptor for pthread_sigmask (although some specific sanitizers defined custom version), which lead to false positives (at least in msan) when using this function. The interceptor implementation, and its test are based on the equivalent code for sigprocmask. Reviewers: eugenis, vitalybuka Subscribers: kubamracek, delcypher, jfb, jdoerfert, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58382 llvm-svn: 354874
* [compiler-rt] Build custom libcxx with libcxxabiJonas Hahnfeld2019-02-171-9/+7
| | | | | | | | | | | | | | | This changes add_custom_libcxx to also build libcxxabi and merges the two into a static and hermetic library. There are multiple advantages: 1) The resulting libFuzzer doesn't expose C++ internals and looks like a plain C library. 2) We don't have to manually link in libstdc++ to provide cxxabi. 3) The sanitizer tests cannot interfere with an installed version of libc++.so in LD_LIBRARY_PATH. Differential Revision: https://reviews.llvm.org/D58013 llvm-svn: 354212
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-194-16/+12
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Skip unsupported MSan tests on NetBSDKamil Rytarowski2018-10-091-0/+4
| | | | | | libm functions remquol and lgammal are missing on NetBSD. llvm-svn: 344042
* Disable MSan tests of prlimit on FreeBSDDimitry Andric2018-06-131-1/+1
| | | | | | | Like NetBSD, FreeBSD does not have prlimit(2), so do not attempt to use it during the MSan tests. llvm-svn: 334659
* Port msan_test.cc to NetBSDKamil Rytarowski2018-05-191-61/+76
| | | | | | | | | | | | | | | | | | | | | Summary: The changes allows building this file on NetBSD, mostly by disabling the unsupported functions and adding OS-specific system includes. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D46712 llvm-svn: 332791
* [msan] Don't check divisor shadow in fdiv.Evgeniy Stepanov2018-05-181-1/+0
| | | | | | | | | | | | | | | | Summary: Floating point division by zero or even undef does not have undefined behavior and may occur due to optimizations. Fixes https://bugs.llvm.org/show_bug.cgi?id=37523. Reviewers: kcc Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D47085 llvm-svn: 332761
* [Fuzzer] Avoid the unnecessary rebuild of the custom libc++Petr Hosek2018-03-071-1/+1
| | | | | | | | | | | | This changes the add_custom_libcxx macro to resemble the llvm_ExternalProject_Add. The primary motivation is to avoid unnecessary libFuzzer rebuilds that are being done on every Ninja/Make invocation. The libc++ should be only rebuilt whenever the libc++ source itself changes. Differential Revision: https://reviews.llvm.org/D43213 llvm-svn: 326921
* [CMake] Remove -stdlib= which is unused when passing -nostdinc++Jonas Hahnfeld2018-02-011-0/+3
| | | | | | | | | This avoids the warnings when building with LLVM_ENABLE_LIBCXX which automatically adds -stdlib=libc++ to CMAKE_CXX_FLAGS. Differential Revision: https://reviews.llvm.org/D42238 llvm-svn: 323969
* [sanitizer] Add interceptors for readlinkat, name_to_handle_at, ↵Vitaly Buka2018-01-301-0/+7
| | | | | | | | | | | | | | | | | | | | | open_by_handle_at Summary: Also move existing readlink msan interceptor to sanitizer_common. Fixes google/sanitizers#908 Patch by Oliver Chang Reviewers: vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42630 llvm-svn: 323825
* Reland "[Fuzzer] Parametrize add_custom_libcxx"Petr Hosek2018-01-211-2/+3
| | | | | | | | | | | | | add_custom_libcxx uses the just built compiler and installs the built libc++, e.g. for testing, neither of which is desirable in case of Fuzzer where the libc++ should be built using the host compiler and it's only linked into the libFuzzer and should never be installed. This change introduces additional arguments to add_custom_libcxx to allow parametrizing its behavior. Differential Revision: https://reviews.llvm.org/D42330 llvm-svn: 323054
* Revert "[Fuzzer] Parametrize add_custom_libcxx"Petr Hosek2018-01-201-2/+1
| | | | | | This reverts commit r323032: failing on the sanitizer-x86_64-linux-autoconf bot. llvm-svn: 323033
* [Fuzzer] Parametrize add_custom_libcxxPetr Hosek2018-01-201-1/+2
| | | | | | | | | | | | | add_custom_libcxx uses the just built compiler and installs the built libc++, e.g. for testing, neither of which is desirable in case of Fuzzer where the libc++ should be built using the host compiler and it's only linked into the libFuzzer and should never be installed. This change introduces additional arguments to add_custom_libcxx to allow parametrizing its behavior. Differential Revision: https://reviews.llvm.org/D42330 llvm-svn: 323032
* Set of corrections for MSan/NetBSDKamil Rytarowski2017-12-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Changes: - Don't attempt to intercept GLIBC specific functions like __strtol_internal. This is required to stop intercepting it as we leak dlerror(3) for dlsym(3) that cannot manage to find a symbol. - Correct interception of fstatat(2). - Don't run a test for fgetgrent_r() that is missing on NetBSD. - Correct link_map location (offset) in Obj_Entry on x86_64 and i386. - Stop intercepting getpshared-like functions in pthread(3). This is feature is not enabled by default on NetBSD as it's unfinished. - Switch intercepting from UTMP to UTMPX functions. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis, kcc Reviewed By: vitalybuka Subscribers: llvm-commits, srhines, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41053 llvm-svn: 320663
* [CMake] Support runtimes and monorepo layouts when looking for libcxxPetr Hosek2017-12-121-1/+1
| | | | | | | | | 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 llvm-svn: 320446
* [msan] add strtouq msan interceptorVitaly Buka2017-12-051-0/+1
| | | | | | | | | | | | Summary: Fixes https://github.com/google/sanitizers/issues/892 Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40853 llvm-svn: 319843
* [msan] Fix return type of mbrtowcVitaly Buka2017-11-301-7/+9
| | | | | | | | | | | | Summary: Fixes https://github.com/google/oss-fuzz/issues/1009 Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40676 llvm-svn: 319484
* Linux needs to include sys/uio.h for readv, preadvStephan Bergmann2017-11-301-0/+3
| | | | | | ...at least when building against glibc-2.26-16.fc27.x86_64 llvm-svn: 319412
* [msan] Switch the pvalloc overflow test to a lit testBenjamin Kramer2017-08-041-6/+0
| | | | | | | | | | | | 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 llvm-svn: 310033
* [msan] Check for pvalloc overflowKostya Kortchinsky2017-08-021-0/+6
| | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 309883
* [msan] Reverting D36093Kostya Kortchinsky2017-07-311-11/+0
| | | | | | | | | | | | | | | | 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 llvm-svn: 309637
* [msan] Check for pvalloc overflowKostya Kortchinsky2017-07-311-0/+11
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 309601
* [compiler-rt] Add missing quotation marks to msan_compile invocationKrzysztof Parzyszek2017-07-281-1/+1
| | | | llvm-svn: 309430
* [sanitizer tests CMake] Factor out CMake logic for compiling sanitizer testsGeorge Karpenkov2017-07-281-22/+15
| | | | | | | | | | | 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. llvm-svn: 309405
* [msan] Intercept wcscat, wcsncat.Evgeniy Stepanov2017-06-271-0/+42
| | | | | | | | | | | | | | Also move wcslen, wscnlen to common interceptors. Reviewers: vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D34656 llvm-svn: 306482
* [asan] Add strndup/__strndup interceptors.Pierre Gousseau2017-06-011-2/+11
| | | | | | | | Recommit of r302781 with Vitaly Buka's fix for non zero terminated strings. Differential Revision: https://reviews.llvm.org/D31457 llvm-svn: 304399
* Revert r302781 and subsequent attempts to disable part of it.Daniel Jasper2017-05-181-4/+2
| | | | | | | The Msan unit tests are still broken and by this point, I think we should start over. llvm-svn: 303339
* [msan] Remove a failing test from MemorySanitizer.ICmpRelationalAlexander Potapenko2017-05-121-2/+4
| | | | | | | | | | | 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. llvm-svn: 302887
* [asan] Recommit of r301904: Add strndup/__strndup interceptorsPierre Gousseau2017-05-111-2/+4
| | | | | | | | | Fix undeclared __interceptor_malloc in esan_interceptors.cc Fix undeclared strnlen on OSX Differential Revision: https://reviews.llvm.org/D31457 llvm-svn: 302781
* [msan] Fix getmntent{_r} for empty /etc/fstabAdhemerval Zanella2017-05-101-2/+46
| | | | | | | | | | | | | 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. llvm-svn: 302639
* Revert r301904 causing tsan test failure in x86_64-linux-autoconfPierre Gousseau2017-05-021-4/+2
| | | | llvm-svn: 301909
* [asan] Add strndup/__strndup interceptors if targeting linux.Pierre Gousseau2017-05-021-2/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D31457 llvm-svn: 301904
* [msan] Fix msan_test.cc by checking bind results before assuming IPv6 supported.Vitaly Buka2017-04-131-4/+13
| | | | llvm-svn: 300250
* Revert "[msan] Fix msan_test broken after r299884."Vitaly Buka2017-04-131-2/+2
| | | | | | | | This does not fix the test, it still fails to bind. This reverts commit r300150. llvm-svn: 300249
* [msan] Fix msan_test broken after r299884.Vitaly Buka2017-04-131-2/+2
| | | | | | | | | | | | | 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 llvm-svn: 300150
* [msan] Fix invalid use of vector constructor introduced by r299884.Vitaly Buka2017-04-131-1/+1
| | | | llvm-svn: 300149
* [msan] Choose in runtime if IPv4 or IPv6 are supported.Vitaly Buka2017-04-102-9/+54
| | | | | | | | | | | | Summary: This reverts commit cab5051c691ce27a7ffac41e8e76ceb222ad9549. Reviewers: eugenis Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D31894 llvm-svn: 299884
* [msan] Wrap sockaddr_in and socket for future IPv6 support.Vitaly Buka2017-04-101-51/+77
| | | | | | | | | | Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31893 llvm-svn: 299859
* [msan] Reorder unittests for future parametrization.Vitaly Buka2017-04-101-68/+68
| | | | | | | | | | Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31892 llvm-svn: 299858
* [sanitizers] Fix get_groups interceptor in sanitizer ↵Kostya Serebryany2017-03-291-0/+15
| | | | | | (https://reviews.llvm.org/D31332, patch by Martin Liška) llvm-svn: 299036
* [msan] Test for _mm_getcsr and _mm_setcsr (r296848).Evgeniy Stepanov2017-03-031-0/+12
| | | | llvm-svn: 296849
OpenPOWER on IntegriCloud