summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/sanitizer_common/TestCases/Linux
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[sanitizers] Update sanitizers test to better match glibc internals"Diana Picus2016-09-211-8/+2
| | | | | | This reverts commit r282061 because it broke the clang-cuda-build bot. llvm-svn: 282064
* [sanitizers] Update sanitizers test to better match glibc internalsDiana Picus2016-09-211-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | One of the tests relying on sem_t's layout gets the wrong value for versions of glibc newer than 2.21 on platforms that don't have 64-bit atomics (e.g. ARM). This commit fixes the test to work with: * versions of glibc >= 2.21 on platforms with 64-bit atomics: unchanged * versions of glibc >= 2.21 on platforms without 64-bit atomics: the semaphore value is shifted by SEM_VALUE_SHIFT (which is set to 1 in glibc's internal headers) * versions of glibc < 2.21: unchanged See the glibc 2.23 sources: * sysdeps/nptl/internaltypes.h (struct new_sem for glibc >= 2.21 and struct old_sem for glibc < 2.21) * nptl/sem_getvalue.c This was uncovered on one of the new buildbots that we are trying to move to production. Differential Revision: https://reviews.llvm.org/D24766 llvm-svn: 282061
* [sanitizers] add interceptor for memmem; add weak hooks for strncasecmp, ↵Kostya Serebryany2016-07-151-0/+82
| | | | | | strcasecmp, strstr, strcasestr, memmem llvm-svn: 275621
* [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_common tests] Make Darwin a Posix system and bring the ↵Filipe Cabecinhas2016-03-101-0/+61
| | | | | | | | | | | | | | | | | | | 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-40/+0
| | | | | | Posix/sanitizer_set_death_callback_test.cc llvm-svn: 263018
* [test/sanitizer-common] Move getpass.cc from Linux into PosixFilipe Cabecinhas2016-03-091-33/+0
| | | | llvm-svn: 263017
* [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-171-1/+1
| | | | llvm-svn: 261150
* [tsan] don't crash on closedir(0)Kostya Serebryany2016-01-081-0/+5
| | | | llvm-svn: 257223
* [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
* [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-271-0/+20
| | | | | | | | | | | | | | 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-264-10/+10
| | | | | | | | 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
* 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
* 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
* [asan] under handle_abort=1 option intercept SIGABRT in addition to ↵Kostya Serebryany2015-05-051-0/+24
| | | | | | SIGSEGV/SIGBUS. Among other things this will allow to set up a death callback for SIGABRT and thus properly handle assert() in lib/Fuzzer llvm-svn: 236474
* [Sanitizer] Fix getpwnam test on ppc64le Fedora 21.Jay Foad2015-04-231-1/+2
| | | | | | | | | | | | | | | | Summary: On ppc64le Fedora 21, getpwnam_r("no-such-user", ...) returns ENOENT instead of 0. Tolerate this in the test case. Reviewers: eugenis Reviewed By: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9233 llvm-svn: 235654
* tsan: fix signal handling during stop-the-worldDmitry Vyukov2015-03-051-0/+41
| | | | | | | | | | | | | | | | | | | | | Long story short: stop-the-world briefly resets SIGSEGV handler to SIG_DFL. This breaks programs that handle and continue after SIGSEGV (namely JVM). See the test and comments for details. This is reincarnation of reverted r229678 (http://reviews.llvm.org/D7722). Changed: - execute TracerThreadDieCallback only on tracer thread - reset global data in TracerThreadSignalHandler/TracerThreadDieCallback - handle EINTR from waitpid Add 3 new test: - SIGSEGV during leak checking - StopTheWorld operation during signal storm from an external process - StopTheWorld operation when the program generates and handles SIGSEGVs http://reviews.llvm.org/D8032 llvm-svn: 231367
* [Sanitizer] Restrict open_memstream to x86_64. Fixes PR22714.Alexey Samsonov2015-03-021-0/+1
| | | | llvm-svn: 230996
* [MSan][MIPS] Fix for some failing tests on MIPS64Mohit K. Bhakkad2015-02-181-3/+11
| | | | | | | | | | | | | | 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 llvm-svn: 229656
* [asan] use getrusage as an alternative to reading /proc/self/statm. Also ↵Kostya Serebryany2015-01-292-1/+7
| | | | | | move GetRSS to sanitizer_linux_libcdep.cc (no change in the function itself) llvm-svn: 227416
* [sanitizer] Move sched_getparam test under Linux/.Evgeniy Stepanov2015-01-221-0/+13
| | | | llvm-svn: 226832
* [asan] make a test consume 2x less RAM (we observe flaky bot failures that ↵Kostya Serebryany2015-01-081-10/+10
| | | | | | seem like OOMs) llvm-svn: 225478
* [asan] add a flag soft_rss_limit_mbKostya Serebryany2015-01-061-0/+62
| | | | llvm-svn: 225323
* [asan] new flag: hard_rss_limit_mbKostya Serebryany2014-12-161-0/+35
| | | | llvm-svn: 224353
* [asan] introduce __sanitizer_set_death_callback, deprecate ↵Kostya Serebryany2014-12-151-0/+49
| | | | | | __asan_set_death_callback llvm-svn: 224286
* Disable XFAIL on ARM since the x86_64 specific code is isolatedRenato Golin2014-11-051-2/+0
| | | | llvm-svn: 221347
* Get the Linux ptrace test working on PowerPC64Jay Foad2014-11-051-1/+18
| | | | | | | | | | | | | | The test refers to user_regs_struct.rip so it can only ever have worked on x86-64. Put this code inside an appropriate #if, and add a similar case for PowerPC64. (If we do likewise for ARM we can probably remove the XFAILs, but I have no way of testing that.) Those changes are enough to get the test working for me on big-endian PowerPC64 Fedora 19. Differential Revision: http://reviews.llvm.org/D6108 llvm-svn: 221337
* Mark sanitizer tests XFAIL on ARMv7Renato Golin2014-10-081-0/+1
| | | | | | | | | ASAN, UBSAN and profile tests that don't work with arm-linux-gnueabi and android also don't work on armv7l-linux-gnueabihf. Some of the tests have known causes, others not yet. In order to get a green bot, I'm disabling those tests for now and will investigate when the priority rises. llvm-svn: 219343
* [sanitizer] move mlock interceptor from asan/tsan/msan to common; no ↵Kostya Serebryany2014-08-251-0/+13
| | | | | | functionality change intended llvm-svn: 216407
* Add regression test for PR15823Alexey Samsonov2014-08-181-0/+11
| | | | llvm-svn: 215941
* [sanitizer] Intercept timerfd_settime, timerfd_gettime.Evgeniy Stepanov2014-08-071-0/+52
| | | | llvm-svn: 215112
OpenPOWER on IntegriCloud