summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/msan
Commit message (Collapse)AuthorAgeFilesLines
* [MSan] Use COMMON_INTERCEPTOR_ENTER in libdl interceptors.Marcin Koscielnicki2016-04-251-5/+0
| | | | | | | | | | | This fixes fails in test/msan/dlerror.cc - when real dlerror calls strcmp, our strcmp interceptor now skips poison checking, since it's called in interceptor context. Strictly speaking, only the dlerror change is necessary to fix the fail, but let's also change the other two just in case. Differential Revision: http://reviews.llvm.org/D19499 llvm-svn: 267486
* Replace hardcoded comment at 'lit.site.cfg.in'Alex Denisov2016-04-162-4/+2
| | | | | | | | | | | | At the moment almost every lit.site.cfg.in contains two lines comment: ## Autogenerated by LLVM/Clang configuration. # Do not edit! The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from configure_lit_site_cfg with the note and some useful information. llvm-svn: 266520
* [sancov] enabling coverage edge pruning by default.Mike Aizatsky2016-04-061-2/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D18845 llvm-svn: 265614
* [sanitizer_common tests] Make Darwin a Posix system and bring the ↵Filipe Cabecinhas2016-03-101-0/+3
| | | | | | | | | | | | | | | | | | | stable-runtime definition from ASan tests. Summary: This is an initial setup in order to move some additional tests from Linux onto Posix. I also moved decorate_proc_maps onto the Linux directory Finally added msan's definition for "stable-runtime". Only a test requires it, and its commit message (r248014) seems to imply that AArch64 is problematic with MSan. Reviewers: samsonov, rengolin, t.p.northover, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17928 llvm-svn: 263142
* [Compiler-rt][MSan] fix param_tls_limit test for platforms where big ↵Mohit K. Bhakkad2016-03-011-4/+15
| | | | | | | | | | | | arguments are sliced in smaller ones Reviewers: eugenis Subscribers: dsanders, jaydeep, sagar, llvm-commits Differential Revision: http://reviews.llvm.org/D17129 llvm-svn: 262302
* Update the link of issueMohit K. Bhakkad2016-02-291-1/+1
| | | | llvm-svn: 262209
* [MSan] Endianness should not matter while printing a byteMohit K. Bhakkad2016-02-261-1/+1
| | | | | | | | | | | Reviewers: eugenis Subscribers: jaydeep, sagar, llvm-commits Differential Revision: http://reviews.llvm.org/D17264 Differential Revision: http://reviews.llvm.org/D17563 llvm-svn: 261982
* [MSAN] Fix memcmp_test on MIPSSagar Thakur2016-02-241-1/+4
| | | | | | | | | Summary: As per the test the 4th element of both arrays are not initialized and hence will contain garbage values. Memcmp returns the difference between the garbage values of the 4th element which will be different on every run of the test. And since the return value of memcmp is returned from main, we are getting random exit code every time. Reviewers: kcc, eugenis Subscribers: mohit.bhakkad, jaydeep, llvm-commits Differential: http://reviews.llvm.org/D17534 llvm-svn: 261739
* [MSan] fix process_vm_readv test: Exit silently if syscall is not implemetedMohit K. Bhakkad2016-02-241-7/+15
| | | | | | | | | | Reviewers: eugenis Subscribers: jaydeep, sagar, llvm-commits Differential Revision: http://reviews.llvm.org/D17560 llvm-svn: 261723
* [MSan] Mark dlerror.cc expected failure for MIPSMohit K. Bhakkad2016-02-241-1/+2
| | | | | | | | | | Reviewers: samsonov Subscribers: jaydeep, sagar, llvm-commits, aemerson Differential Revision: http://reviews.llvm.org/D17503 llvm-svn: 261721
* [tests] Remove "supported-target" in favor of "target-arch" lit features.Alexey Samsonov2016-02-231-1/+1
| | | | | | | | | | Test cases definitely should not care about the complete set of architectures supported by compiler-rt - they should only care about current architecture that the test suite was configured for. Introduce new lit feature to reflect this, and convert tests to use it. llvm-svn: 261603
* [tests] Always specify correct config.target_arch when configuring test suite.Alexey Samsonov2016-02-232-3/+6
| | | | llvm-svn: 261601
* [tests] Slightly improve a fix in r260669.Alexey Samsonov2016-02-171-1/+2
| | | | llvm-svn: 261142
* Re-commit r260230 with a fix for clang-cmake-aarch64-42vma.Daniel Sanders2016-02-122-2/+2
| | | | | | | There is now a default name_suffix ('default') which should appease the buildbot and reveal why this builder lacks a suffix. llvm-svn: 260679
* Revert r260669 while the clang-cmake-aarch64-42vma failures is investigated.Daniel Sanders2016-02-121-1/+1
| | | | | | | There's no obvious reason it should fail in this way but it's the only change on the blamelist. I suspect stale lit*.cfg's from previous builds. llvm-svn: 260672
* [msan+tsan] Bring back the tests that disappeared after r260230 and r259512.Daniel Sanders2016-02-121-1/+1
| | | | | | | | | | The lit test-suite containing the unit tests needs to be explicitly specified as an argument to lit.py since it is no longer discovered when the other tests are run (because they are one directory deeper). dfsan, lsan, and sanitizer_common don't show the same problem. llvm-svn: 260669
* [msan] Run the tests for each supported arch and suffix each one to ↵Daniel Sanders2016-02-093-10/+41
| | | | | | | | | | | | | | | | | | | | | | | distinguish them. Summary: Previously, the tests only ran for the 64-bit equivalent of the default target (see -m64). Given the supported architecture list only contains 64-bit targets, this happens to work out the same as the supported targets in most cases but may matter for X86_64/X86_64h on Darwin. For other targets, the practical effect is that the test names contain the architecture. This resolves some confusion when msan tests fail since their name no longer implies that they are trying to test the default target. Reviewers: samsonov Subscribers: tberghammer, danalbert, srhines, llvm-commits Differential Revision: http://reviews.llvm.org/D16855 llvm-svn: 260230
* [compiler-rt] [msan] Remove stable-runtime requirement for insertvalue_origin.ccAdhemerval Zanella2016-01-121-1/+0
| | | | | | | | This patch removes the requirement on stable-runtime on insertvalue_origin.cc testcase, added due a instrumentation failure on aarch64-linux. This is fixed on llvm code by r257375. llvm-svn: 257479
* [msan] Intercept ctermid, ctermid_r.Evgeniy Stepanov2015-12-141-0/+13
| | | | llvm-svn: 255566
* [compiler-rt] [msan] Variadic support for AArch64Adhemerval Zanella2015-12-141-3/+0
| | | | | | | | | Now with variadic support for msan on aarch6 there is no need for XFAIL signal_stress_test anymore. Also to garantee aligned stores for the FP/SIMD arguments enforce the '__msan_va_arg_tls' alignment to sizeof the SIMD register (16). llvm-svn: 255496
* [msan] Don't unpoison phdrs on dlopen(NULL, 0)Reid Kleckner2015-11-191-0/+17
| | | | | | | | | | | | | | | | | | | Summary: dlopen(NULL, ...) is intended to give you back a handle to the executable for use with dlsym. Casting it to link_map and using it with ForEachMappedRegion results in a crash. We also shouldn't unpoison the globals of a DSO that is already in memory. This ensures that we don't do it for the executable, but in general, MSan may have false negatives if the DSO is already loaded. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14795 llvm-svn: 253530
* [compiler-rt] [msan] Unify aarch64 mappingAdhemerval Zanella2015-10-293-30/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch unify the 39-bit and 42-bit mapping for aarch64 to use only one instrumentation algorithm. A runtime check avoid mapping 42-bit only segments for 39-bit kernels. The mapping to use now is for 39 and 42-bits: 0x00000000000ULL-0x01000000000ULL MappingDesc::INVALID 0x01000000000ULL-0x02000000000ULL MappingDesc::SHADOW 0x02000000000ULL-0x03000000000ULL MappingDesc::ORIGIN 0x03000000000ULL-0x04000000000ULL MappingDesc::SHADOW 0x04000000000ULL-0x05000000000ULL MappingDesc::ORIGIN 0x05000000000ULL-0x06000000000ULL MappingDesc::APP 0x06000000000ULL-0x07000000000ULL MappingDesc::INVALID 0x07000000000ULL-0x08000000000ULL MappingDesc::APP And only for 42-bits: 0x08000000000ULL-0x09000000000ULL MappingDesc::INVALID 0x09000000000ULL-0x0A000000000ULL MappingDesc::SHADOW 0x0A000000000ULL-0x0B000000000ULL MappingDesc::ORIGIN 0x0B000000000ULL-0x0F000000000ULL MappingDesc::INVALID 0x0F000000000ULL-0x10000000000ULL MappingDesc::APP 0x10000000000ULL-0x11000000000ULL MappingDesc::INVALID 0x11000000000ULL-0x12000000000ULL MappingDesc::APP 0x12000000000ULL-0x17000000000ULL MappingDesc::INVALID 0x17000000000ULL-0x18000000000ULL MappingDesc::SHADOW 0x18000000000ULL-0x19000000000ULL MappingDesc::ORIGIN 0x19000000000ULL-0x20000000000ULL MappingDesc::INVALID 0x20000000000ULL-0x21000000000ULL MappingDesc::APP 0x21000000000ULL-0x26000000000ULL MappingDesc::INVALID 0x26000000000ULL-0x27000000000ULL MappingDesc::SHADOW 0x27000000000ULL-0x28000000000ULL MappingDesc::ORIGIN 0x28000000000ULL-0x29000000000ULL MappingDesc::SHADOW 0x29000000000ULL-0x2A000000000ULL MappingDesc::ORIGIN 0x2A000000000ULL-0x2B000000000ULL MappingDesc::APP 0x2B000000000ULL-0x2C000000000ULL MappingDesc::INVALID 0x2C000000000ULL-0x2D000000000ULL MappingDesc::SHADOW 0x2D000000000ULL-0x2E000000000ULL MappingDesc::ORIGIN 0x2E000000000ULL-0x2F000000000ULL MappingDesc::APP 0x2F000000000ULL-0x39000000000ULL MappingDesc::INVALID 0x39000000000ULL-0x3A000000000ULL MappingDesc::SHADOW 0x3A000000000ULL-0x3B000000000ULL MappingDesc::ORIGIN 0x3B000000000ULL-0x3C000000000ULL MappingDesc::APP 0x3C000000000ULL-0x3D000000000ULL MappingDesc::INVALID 0x3D000000000ULL-0x3E000000000ULL MappingDesc::SHADOW 0x3E000000000ULL-0x3F000000000ULL MappingDesc::ORIGIN 0x3F000000000ULL-0x40000000000ULL MappingDesc::APP And although complex it provides a better memory utilization that previous one. [1] http://reviews.llvm.org/D13817 llvm-svn: 251625
* [msan] Yet another attempt to fix process_vm_readv test.Evgeniy Stepanov2015-10-271-3/+8
| | | | llvm-svn: 251372
* [msan] Fix process_vm_readv test.Evgeniy Stepanov2015-10-261-8/+4
| | | | | | | The check for the glibc version was not working as expected (dlsym was finding the interceptor instead of the libc implementation). llvm-svn: 251345
* [msan] Re-submit test for process_vm_readv.Evgeniy Stepanov2015-10-231-0/+66
| | | | | | | Includes a workaround for glibc < 2.15, which does not provide the function under test. llvm-svn: 251079
* [msan] Temporarily remove a failing test to fix the bot.Evgeniy Stepanov2015-10-221-43/+0
| | | | | | The test requires a newer glibc version that the one on the bot. llvm-svn: 251077
* [msan] Intercept process_vm_readv/writev.Evgeniy Stepanov2015-10-221-0/+43
| | | | llvm-svn: 251059
* [msan] Intercept mincore.Evgeniy Stepanov2015-10-191-0/+36
| | | | llvm-svn: 250761
* [msan] Intercept pthread_getcancel*.Evgeniy Stepanov2015-10-191-0/+19
| | | | llvm-svn: 250752
* [msan] Add __msan_copy_shadow interface function.Evgeniy Stepanov2015-10-121-0/+34
| | | | | | This can be used to annotate copies of memory that are not observed by MSan. llvm-svn: 250124
* New MSan mapping layout (compiler-rt part).Evgeniy Stepanov2015-10-082-2/+4
| | | | | | | | | | | | | | | | | | This is an implementation of https://github.com/google/sanitizers/issues/579 It has a number of advantages over the current mapping: * Works for non-PIE executables. * Does not require ASLR; as a consequence, debugging MSan programs in gdb no longer requires "set disable-randomization off". * Supports linux kernels >=4.1.2. * The code is marginally faster and smaller. This is an ABI break. We never really promised ABI stability, but this patch includes a courtesy escape hatch: a compile-time macro that reverts back to the old mapping layout. llvm-svn: 249754
* [msan] Disable allocator_mapping test on mips64 and aarch64.Evgeniy Stepanov2015-09-291-0/+5
| | | | llvm-svn: 248835
* [msan] Early allocator initialization.Evgeniy Stepanov2015-09-291-0/+31
| | | | | | | Map MSan heap space early (in __msan_init) so that user code can not accidentally (i.e. w/o MAP_FIXED) create a conflicting mapping. llvm-svn: 248829
* Disable final MSAN test in AArch64 to get the bots greenRenato Golin2015-09-181-0/+1
| | | | llvm-svn: 248014
* Disable one MSAN test in AArch64 until we have a proper fixRenato Golin2015-09-181-0/+1
| | | | llvm-svn: 248008
* [MSan] Enable MSAN for aarch64Adhemerval Zanella2015-09-168-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enabled msan for aarch64 with 39-bit VMA and 42-bit VMA. As defined by lib/msan/msan.h the memory layout used is for 39-bit is: 00 0000 0000 - 40 0000 0000: invalid 40 0000 0000 - 43 0000 0000: shadow 43 0000 0000 - 46 0000 0000: origin 46 0000 0000 - 55 0000 0000: invalid 55 0000 0000 - 56 0000 0000: app (low) 56 0000 0000 - 70 0000 0000: invalid 70 0000 0000 - 80 0000 0000: app (high) And for 42-bit VMA: 000 0000 0000 - 100 0000 0000: invalid 100 0000 0000 - 11b 0000 0000: shadow 11b 0000 0000 - 120 0000 0000: invalid 120 0000 0000 - 13b 0000 0000: origin 13b 0000 0000 - 2aa 0000 0000: invalid 2aa 0000 0000 - 2ab 0000 0000: app (low) 2ab 0000 0000 - 3f0 0000 0000: invalid 3f0 0000 0000 - 400 0000 0000: app (high) Most of tests are passing with exception of: * Linux/mallinfo.cc * chained_origin_limits.cc * dlerror.cc * param_tls_limit.cc * signal_stress_test.cc * nonnull-arg.cpp The 'Linux/mallinfo.cc' is due the fact AArch64 returns the sret in 'x8' instead of default first argument 'x1'. So a function prototype that aims to mimic (by using first argument as the return of function) won't work. For GCC one can make a register alias (register var asm ("r8")), but for clang it detects is an unused variable and generate wrong code. The 'chained_origin_limits' is probably due a wrong code generation, since it fails only when origin memory is used (-fsanitize-memory-track-origins=2) and only in the returned code (return buf[50]). The 'signal_streess_test' and 'nonnull-arg' are due currently missing variadic argument handling in memory sanitizer code instrumentation on LLVM side. Both 'dlerror' and 'param_tls_test' are unknown failures that require further investigation. All the failures are XFAIL for aarch64 for now. llvm-svn: 247809
* Explicit reference to bug highlighted byNaomi Musgrave2015-09-164-33/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test/msan/dtor-trivial.cpp. Runtime testing for poisoning vtable pointer in dtor. Summary: Runtime testing for vtable ptr poisoning in dtor. Reviewers: eugenis, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12713 Clean test case & comments. Update tests for vptr poisoning order. Simplify test to rely upon globals. Assertions verify that vtable still accessible from dtors. Testing linear inheritance and multiple inheritance for vtable poisoning. Macros for testing expected failing functions. Rename macros. Removed xfail, modified FileCheck commands, to expect test to crash. llvm-svn: 247763
* Failing test highlighting no poisoning when destructor not declared.Naomi Musgrave2015-09-082-0/+39
| | | | | | | | | | | | | | | | | | Summary: When destructor for a class is not declared, no destructor is emitted, and members are not poisoned. Test case exhibits this current bug in use-after-dtor implementation (detailed in https://github.com/google/sanitizers/issues/596). Reviewers: eugenis, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12617 Rename test files. llvm-svn: 247091
* Test triangle inheritance member poisoning.Naomi Musgrave2015-09-035-15/+380
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Verify that all members are poisoned. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D12023 Test virtual functions and virtual bases poisoning proper size. Runtime testing of destroying diamond inheritance. Explicit testing for 0 optimizations. Simplify test to only test interesting values. Test poisoning on multiple inheritance with nontrivial and trivial members. Removed unnecessary header. Testing (anonymous/)bit fields. Revised object instantiation in test to avoid undefined behavior. llvm-svn: 246817
* [sanitizer] Move sem_* to common interceptors.Evgeniy Stepanov2015-08-271-0/+22
| | | | llvm-svn: 246184
* [msan] Regression test for PR24561.Evgeniy Stepanov2015-08-251-0/+20
| | | | | | Fixed in r245980. llvm-svn: 245981
* Remove forkpty test with -Wl,-as-needed. This currently breaks inDaniel Jasper2015-08-191-1/+0
| | | | | | | various places. Let me know if you need more details about a reproduction. llvm-svn: 245417
* [msan] Intercept openpty and forkpty.Evgeniy Stepanov2015-08-181-0/+19
| | | | llvm-svn: 245345
* Removed xfail, since test is passing in line with expanded dtor sanitizing ↵Naomi Musgrave2015-08-131-2/+0
| | | | | | | | | | | | functionality Summary: Fixed test in response to buildbot failures from last night. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D12018 llvm-svn: 244952
* Revert "Removed xfail, since test is passing in line with expanded dtor ↵Daniel Jasper2015-08-131-0/+2
| | | | | | | | | sanitizing functionality" Still breaking the bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/19678/steps/ninja%20check-msan/logs/stdio llvm-svn: 244873
* Removed xfail, since test is passing in line with expanded dtor sanitizing ↵Naomi Musgrave2015-08-121-2/+0
| | | | | | | | | | | | functionality Summary: Fixed test in response to buildbot failures from last night. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D11992 llvm-svn: 244818
* Revert "Revised test to pass under updated dtor callback implementation"Daniel Jasper2015-08-121-0/+2
| | | | | | | This breaks the buildbot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/19656 llvm-svn: 244724
* Revised test to pass under updated dtor callback implementationNaomi Musgrave2015-08-121-2/+0
| | | | | | | | | | | | Summary: New implementation for dtor sanitizer callback poisons only class members, and emits poisoning callback before base dtor invoked. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D11952 Explicit dtor invocation llvm-svn: 244709
* test case for poisoning trivial membersNaomi Musgrave2015-08-101-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A virtual base class and derived class should only poison their respective members upon destruction. In particular, trivial members should be poisoned directly, non-trivial members should be poisoned by their respective destructors, and references to non-trivial members should be poisoned. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D11912 Test case avoids casting to access members Run configurations to reflect expected runtime failure on assertions. Simplified access to internal members. Updated internal member structure of base. Revised assert in main to verify successful poisoning after dtor. Verify address of pointer is poisoned. Fixed assert err. Cleaned up test by removing extraneous prints, asserts. llvm-svn: 244521
* Runtime check of poisoning derived class members.Naomi Musgrave2015-08-031-0/+47
| | | | | | | | | | | | | | | | Summary: Simple test case to verify that an instance of a derived class with virtual base is properly poisoned Reviewers: eugenis, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11733 modified test to be more concise, and check the local pointer to the destroyed object revised test to not examine padding- only explicit object members llvm-svn: 243913
OpenPOWER on IntegriCloud