summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/sanitizer_common/TestCases
Commit message (Collapse)AuthorAgeFilesLines
...
* [asan] Disable tests more selectively.Akira Hatanaka2016-08-271-1/+1
| | | | | | | Add "target-arch+host-os" to the feature list to enable disabling the tests I committed in r279614 and r279880 more selectively. llvm-svn: 279918
* [asan] Use "REQUIRES: x86_64-target-arch" to disable the test on i386.Akira Hatanaka2016-08-271-1/+1
| | | | | | | My attempt to disable this test on i386 by adding "UNSUPPORTED: i386-apple" in r279880 wasn't succesful, so I'm using REQUIRES instead. llvm-svn: 279916
* [asan] Mark symbolize_pc.cc as UNSUPPORTED on i386-apple.Akira Hatanaka2016-08-261-0/+1
| | | | | | | | atos currently doesn't work well when loaded from 32-bit binaries, which was causing some of the bots to fail. Disable this test until we can come up with a better fix. llvm-svn: 279880
* [sanitizer] add __sanitizer_symbolize_pc. ↵Kostya Serebryany2016-08-251-0/+21
| | | | | | https://github.com/google/sanitizers/issues/322 llvm-svn: 279780
* [sanitizers] add interceptor for memmem; add weak hooks for strncasecmp, ↵Kostya Serebryany2016-07-151-0/+82
| | | | | | strcasecmp, strstr, strcasestr, memmem llvm-svn: 275621
* [sanitizers] introduce yet another API function: ↵Kostya Serebryany2016-06-161-2/+14
| | | | | | __sanitizer_install_malloc_and_free_hooks llvm-svn: 272943
* Fix test for Darwin: ASAN is calling abort by default on Darwin, which not ↵Mehdi Amini2016-05-311-5/+5
| | | | | | detects as a crash llvm-svn: 271323
* [sanitizers] introduce a common run-time option dedup_token_length to help ↵Kostya Serebryany2016-05-281-0/+40
| | | | | | with report deduplication, off by default for now. See https://github.com/google/sanitizers/issues/684 llvm-svn: 271085
* [sanitizers] introduce __sanitizer_set_report_fd so that we can re-route the ↵Kostya Serebryany2016-05-271-0/+37
| | | | | | sanitizer logging to another fd from inside the process llvm-svn: 271046
* [asan] Don't raise false alarm to recv/recvfrom when MSG_TRUNC is present.Maxim Ostapenko2016-05-171-0/+36
| | | | | | | | | | | | | | | | | | Fix https://llvm.org/bugs/show_bug.cgi?id=27673. Currenty ASan checks the return value of real recv/recvfrom to see if the written bytes fit in the buffer. That works fine most of time. However, there is an exception: (from the RECV(2) man page) MSG_TRUNC (since Linux 2.2) ... return the real length of the packet or datagram, even when it was longer than the passed buffer. ... Some programs combine MSG_TRUNC, MSG_PEEK and a single-byte buffer to peek the incoming data size without reading (much of) them. In this case, the return value is usually longer than what's been written and ASan raises a false alarm here. To avoid such false positive reports, we can use min(res, len) in COMMON_INTERCEPTOR_WRITE_RANGE checks. Differential Revision: http://reviews.llvm.org/D20280 llvm-svn: 269749
* [sanitizer] [SystemZ] Add ptrace support bits.Marcin Koscielnicki2016-04-261-0/+20
| | | | | | Differential Revision: http://reviews.llvm.org/D19134 llvm-svn: 267548
* [sanitizer] Fix sem_init_glibc.cc test on __HAVE_64B_ATOMIC arches.Evgeniy Stepanov2016-04-071-4/+15
| | | | | | | | | | | | | | | | | | | | | glibc can use one of 2 layouts for semaphores: architectures that don't HAVE_64B_ATOMIC use an uint32_t field with semaphore value, then a private field, then a waiting thread count field - this is the layout currently assumed by the test. However, HAVE_64B_ATOMIC arches use a fused uint64_t field that contains the value in low bits and waiting thread count in high bits, followed by a private field. This resulted in taking private field from the wrong offset on 64-bit atomic platforms (the test still passed, but didn't actually test the private field). On big-endian platforms, this resulted in a fail, since the first 4 bytes overlay the thread count field, and not the value field. Found while porting ASan to s390x. Patch by Marcin Kościelnicki. llvm-svn: 265715
* [sanitizer] Add strnlen to the common interceptorsDerek Bruening2016-03-231-0/+12
| | | | | | | | | | | | | | | | | | | Summary: Adds strnlen to the common interceptors, under the existing flag intercept_strlen. Removes the now-duplicate strnlen interceptor from asan and msan. This adds strnlen to tsan, which previously did not intercept it. Adds a new test of strnlen to the sanitizer_common test cases. Reviewers: samsonov Subscribers: zhaoqin, llvm-commits, kcc Differential Revision: http://reviews.llvm.org/D18397 llvm-svn: 264195
* [sanitizer_common tests] Make Darwin a Posix system and bring the ↵Filipe Cabecinhas2016-03-102-1/+1
| | | | | | | | | | | | | | | | | | | 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
* [test/sanitizer-common] Linux/sanitizer_set_death_callback_test.cc -> ↵Filipe Cabecinhas2016-03-091-0/+0
| | | | | | Posix/sanitizer_set_death_callback_test.cc llvm-svn: 263018
* [test/sanitizer-common] Move getpass.cc from Linux into PosixFilipe Cabecinhas2016-03-091-0/+4
| | | | llvm-svn: 263017
* [sanitizer-common] Use @LINE in test.Filipe Cabecinhas2016-03-071-5/+5
| | | | llvm-svn: 262828
* [tests] Remove "supported-target" in favor of "target-arch" lit features.Alexey Samsonov2016-02-233-3/+3
| | | | | | | | | | 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
* Fix PR26608: Make sanitizer_common tests more portable.Alexey Samsonov2016-02-173-5/+6
| | | | llvm-svn: 261150
* [MSan] Add a test case for r258339.Alexey Samsonov2016-01-211-2/+12
| | | | llvm-svn: 258413
* [tsan] don't crash on closedir(0)Kostya Serebryany2016-01-081-0/+5
| | | | llvm-svn: 257223
* [asan] fix fopen interceptor to not crash if path is NULLKostya Serebryany2015-12-211-0/+6
| | | | llvm-svn: 256182
* [asan] try to fix ARM botsKostya Serebryany2015-12-151-0/+2
| | | | llvm-svn: 255594
* [asan] add option: handle_sigillKostya Serebryany2015-12-151-0/+25
| | | | llvm-svn: 255588
* [compiler-rt] Enable ptrace sanitizer for armAdhemerval Zanella2015-10-261-4/+15
| | | | | | | | | | This patch enables the ptrace syscall interceptors for arm and adds support for both PTRACE_GETVFPREGS and PTRACE_SETVFPREGS used to get the VFP register from ARM. The ptrace tests is also updated with arm and PTRACE_GETVFPREGS tests. llvm-svn: 251321
* [asan] Zero initialize sem_t in sem_init.Evgeniy Stepanov2015-10-121-0/+32
| | | | | | | | | | Old version of sem_init (GLIBC_2.0) fails to initialize parts of sem_t that are used in sem_timedwait. This is fixed in GLIBC_2.1, but since ASan interceptors downgrade sem_* to the oldest available version, this can introduce bugs that are only present in sanitized build. Workaround by zero-initializing sem_t in sem_init. llvm-svn: 250113
* New MSan mapping layout (compiler-rt part).Evgeniy Stepanov2015-10-081-2/+2
| | | | | | | | | | | | | | | | | | 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
* [LSAN] Mark death callback as unstable while we investigate the cause in AArch64Renato Golin2015-10-061-0/+2
| | | | llvm-svn: 249398
* [MSan] Enable MSAN for aarch64Adhemerval Zanella2015-09-161-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [Sanitizers] Make abort_on_error common flag.Alexey Samsonov2015-08-273-0/+48
| | | | | | | | | | | | | | Summary: Teach all sanitizers to call abort() instead of _exit() after printing an error report, if requested. This behavior is the default on Mac OS. Reviewers: kcc, kubabrecka Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12332 llvm-svn: 246205
* [Sanitizer] Test churn: use %env_tool_opts in sanitizer_common lit tests.Alexey Samsonov2015-08-269-26/+26
| | | | | | | | This follows the approach we use in ASan and UBSan lit tests to setup tool options in a portable way, and to provide a nice way to specify testsuite-wide defaults. llvm-svn: 246058
* [TSan] Support __sanitizer_set_death_callback().Alexey Samsonov2015-08-221-15/+5
| | | | llvm-svn: 245776
* [LSan] Support __sanitizer_set_death_callback in standalone LSan.Alexey Samsonov2015-08-211-1/+0
| | | | llvm-svn: 245758
* [ASAN/AArch64] Disable forkpty tests until we can fix themRenato Golin2015-08-081-0/+1
| | | | | | | Reported in PR24400. Disable until it works, so we can keep the rest tested and green. llvm-svn: 244398
* [sanitizer] 2-nd attempt. Add the flag handle_sigfpe that is default true to ↵Kostya Serebryany2015-08-061-0/+30
| | | | | | handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski. This time the test is enabled only on x86-64 (it broke on ARM) llvm-svn: 244234
* Revert "[sanitizer] Add the flag handle_sigfpe that is default true to ↵Renato Golin2015-08-061-27/+0
| | | | | | | | handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski" This reverts commit r244136, it was breaking the ARM bots for too long. We should investigate it offline. llvm-svn: 244210
* [sanitizer] Add the flag handle_sigfpe that is default true to handle SIGFPE ↵Kostya Serebryany2015-08-051-0/+27
| | | | | | crashes same as SIGSEV crashes, patch by Karl Skomski llvm-svn: 244136
* [AArch64] Stable runtime required for proc maps testRenato Golin2015-08-051-1/+1
| | | | llvm-svn: 244105
* [asan] Enable asan for aarch64Adhemerval Zanella2015-08-051-0/+1
| | | | | | | | | | | | | | | | This patch enables asan for aarch64/linux. It marks it as 'unstable-release', since some tests are failing due either kernel missing support of non-executable pages in mmap or environment instability (infinite loop in juno reference boards). It sets decorate_proc_maps test to require stable-release, since the test expects the shadow memory to not be executable and the support for aarch64 is only added recently by Linux (da141706aea52c1a9 - 4.0). It also XFAIL static_tls test for aarch64 linker may omit the __tls_get_addr call as a TLS optimization. llvm-svn: 244054
* Revert r243604, it (very likely) caused PR24312.Nico Weber2015-07-301-2/+2
| | | | llvm-svn: 243615
* [CMake] Pass -march=i686 when targeting i686 (PR24222)Hans Wennborg2015-07-301-2/+2
| | | | | | | | | | | | | | | | Clang will not define __i686__, even when the target triple is i686, without -march=i686. With this patch, the compiler-rt build will successfully detect that Clang can target i686. The open_memstream.cc test is a little funny. Before my patch, it was invoked with "-m32 -m64". To make it work after my -march change, I had to add '-march=x86-64'. Differential Revision: http://reviews.llvm.org/D11618 llvm-svn: 243604
* [sanitizer] Implement include_if_exists with process name substitution.Evgeniy Stepanov2015-07-211-4/+29
| | | | | | | | | include_if_exists=/path/to/sanitizer/options reads flags from the file if it is present. "%b" in the include file path (for both variants of the flag) is replaced with the basename of the main executable. llvm-svn: 242853
* asan: fix a testDmitry Vyukov2015-07-191-4/+7
| | | | | | | Page size is not necessary 4096. Use sysconf to obtain page size. llvm-svn: 242651
* [sanitizer] De-flake one test.Evgeniy Stepanov2015-07-191-1/+2
| | | | | | | signal_segv_handler.cc occasionally fails due to a suspected kernel bug. Increasing the mapped region size seems to make the test pass reliably. llvm-svn: 242647
* [msan] Fix open_memstream handling.Evgeniy Stepanov2015-07-171-9/+21
| | | | | | | | For open_memstream() files, buffer pointer is only valid immediately after fflush() or fclose(). Fix the fclose() interceptor to unpoison after the REAL(fclose) call, not before it. llvm-svn: 242535
* sanitizer_common: fix and re-enable signal_segv_handler testDmitry Vyukov2015-06-291-2/+3
| | | | | | | | | struct sigaction was not initialized. As the result if SA_RESETHAND is set in sa_flags, then the handler is reset after first invocation leading to crash. Initialize struct sigaction to zero. Reviewed in http://reviews.llvm.org/D10803 llvm-svn: 240965
* [sanitizer] Disable signal_segv_handler test.Evgeniy Stepanov2015-06-251-0/+2
| | | | | | Random failures on the bots. llvm-svn: 240668
* Tests: disable test of /proc filesystem on Darwin.Tim Northover2015-06-021-1/+1
| | | | | | | We don't have it. I'm not entirely sure "Posix" is a good name for that directory, but perhaps we should see how it develops. llvm-svn: 238874
* Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.Evgeniy Stepanov2015-05-292-0/+69
| | | | | | | | | | | | | | | | | | This is done by creating a named shared memory region, unlinking it and setting up a private (i.e. copy-on-write) mapping of that instead of a regular anonymous mapping. I've experimented with regular (sparse) files, but they can not be scaled to the size of MSan shadow mapping, at least on Linux/X86_64 and ext3 fs. Controlled by a common flag, decorate_proc_maps, disabled by default. This patch has a few shortcomings: * not all mappings are annotated, especially in TSan. * our handling of memset() of shadow via mmap() puts small anonymous mappings inside larger named mappings, which looks ugly and can, in theory, hit the mapping number limit. llvm-svn: 238621
* [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, ↵Yury Gribov2015-05-285-0/+68
| | | | | | | | | | strpbrk. Patch by Maria Guseva. Differential Revision: http://reviews.llvm.org/D9017 llvm-svn: 238406
OpenPOWER on IntegriCloud