summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/sanitizer_common
Commit message (Collapse)AuthorAgeFilesLines
...
* Bypass potential libc's sysconf interceptorsAlex Shlyapnikov2017-03-231-0/+25
| | | | | | | | | | | | | | | | | | Summary: sysconf(_SC_PAGESIZE) is called very early during sanitizer init and any instrumented code (sysconf() wrapper/interceptor will likely be instrumented) calling back to sanitizer before init is done will most surely crash. 2nd attempt, now with glibc version checks (D31092 was reverted). Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D31221 llvm-svn: 298613
* Revert "Bypass potential libc's sysconf wrappers for sysconf(_SC_PAGESIZE) call"Vitaly Buka2017-03-211-21/+0
| | | | | | | | Bot can't find <sys/auxv.h> This reverts commit r298305. llvm-svn: 298343
* Bypass potential libc's sysconf wrappers for sysconf(_SC_PAGESIZE) callAlex Shlyapnikov2017-03-201-0/+21
| | | | | | | | | | | | | | | Summary: sysconf(_SC_PAGESIZE) is called very early, during sanitizer init and any instrumented code (a wrapper/interceptor will likely be instrumented) calling back to sanitizer before init is done will most surely crash. Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D31092 llvm-svn: 298305
* [sanitizer] Bail out with warning if user dlopens shared library with ↵Maxim Ostapenko2017-03-091-0/+12
| | | | | | | | | | | | RTLD_DEEPBIND flag People keep hitting on spurious failures in malloc/free routines when using sanitizers with shared libraries dlopened with RTLD_DEEPBIND (see https://github.com/google/sanitizers/issues/611 for details). Let's check for this flag and bail out with warning message instead of failing in random places. Differential Revision: https://reviews.llvm.org/D30504 llvm-svn: 297370
* [asan] Re-enable a test on i386-darwin.Anna Zaks2017-02-211-1/+0
| | | | | | | | This test has been reverted in r279918 due to flaky atos support in the OS some machines in the buildbot fleet were running. This should not be a problem anymore. llvm-svn: 295766
* [sancov] sanitizer coverage initialization testMike Aizatsky2017-02-091-0/+73
| | | | | | | | | | Summary: Reflects the change in https://reviews.llvm.org/D29662 Subscribers: kubamracek Differential Revision: https://reviews.llvm.org/D29721 llvm-svn: 294533
* [sancov] Disable failing test for MIPS.Simon Dardis2017-02-032-2/+2
| | | | | | Currently unsupported. llvm-svn: 294033
* [lsan] Disable sem_init_glibc.cc testcase for LSan x86.Maxim Ostapenko2017-02-031-1/+1
| | | | | | | | | | This test relies on sanitizer common interceptor to pick the oldest version of sem_init function from Glibc. But LSan actually doesn't intercept sem_init, thus the new implementation is called that causes test failure. Disable it for LSan x86, the proper fix would require to check Glibc version at runtime and adjust GET_SEM_VALUE(V) accordingly. llvm-svn: 294001
* [compiler-rt] Fix incorrect use of snprintfVitaly Buka2017-02-021-0/+28
| | | | | | | | | | | | | | Summary: snprintf returns buffer size needed for printing. If buffer was small, calling code receives incorrectly symbolized buffer and fail. Reviewers: eugenis Subscribers: kubamracek, dberris, kcc Differential Revision: https://reviews.llvm.org/D29440 llvm-svn: 293930
* [asan] Support handle_sigfpe on DarwinJustin Bogner2017-02-011-0/+0
| | | | llvm-svn: 293746
* [sanitizer] Support SANITIZER_INTERCEPTOR_HOOKS on DarwinJustin Bogner2017-02-011-0/+0
| | | | | | | This basically already worked other than weak symbols needing definitions on darwin. llvm-svn: 293741
* Remove XFAIL from the sanitizer guard test for darwinJustin Bogner2017-02-011-3/+4
| | | | | | | This works as of "Support sanitizer guard section on darwin" in the llvm repo. llvm-svn: 293734
* [lsan] Renable LSan for x86 LinuxMaxim Ostapenko2017-01-314-1/+13
| | | | | | | | | The missed clang part was committed at https://reviews.llvm.org/rL293609 thus we can reenable LSan for x86 Linux. Differential Revision: https://reviews.llvm.org/D28609 llvm-svn: 293610
* Revert "[lsan] Enable LSan for x86 Linux."Evgeniy Stepanov2017-01-234-13/+1
| | | | | | | Breaks tests on i686/Linux due to missing clang driver support: error: unsupported option '-fsanitize=leak' for target 'i386-unknown-linux-gnu' llvm-svn: 292844
* [lsan] Enable LSan for x86 Linux.Maxim Ostapenko2017-01-234-1/+13
| | | | | | | | | | | | | People keep asking LSan to be available on 32 bit targets (e.g. https://github.com/google/sanitizers/issues/403) despite the fact that false negative ratio might be huge (up to 85%). This happens for big real world applications that may contain random binary data (e.g. browser), but for smaller apps situation is not so terrible and LSan still might be useful. This patch adds initial support for x86 Linux (disabled by default), ARM32 is in TODO list. We used this patch (well, ported to GCC) on our 32 bit mobile emulators and it worked pretty fine thus I'm posting it here to initiate further discussion. Differential Revision: https://reviews.llvm.org/D28609 llvm-svn: 292775
* [sancov] introducing SANCOV_OPTIONSMike Aizatsky2017-01-061-0/+34
| | | | | | | Reintroducing https://reviews.llvm.org/rL291068 Define options function everywhere but linux. llvm-svn: 291267
* Revert "[sancov] introducing SANCOV_OPTIONS"Mike Aizatsky2017-01-051-35/+0
| | | | | | | | and related changes https://llvm.org/svn/llvm-project/compiler-rt/trunk@291068 llvm-svn: 291141
* [sancov] enabling tests on ppc and s390Mike Aizatsky2017-01-051-1/+2
| | | | | | | | The reason they should have failed: absent sancov. In this test (vs the trace_pc_guard test) sancov is not yet called (not implemented). llvm-svn: 291080
* [sancov] introducing SANCOV_OPTIONSMike Aizatsky2017-01-051-0/+34
| | | | | | | | | | | | | | Summary: At this point SANCOV_OPTIONS are not functional but it is our intent to move here sanitizer coverage flags from various sanitizers _OPTIONS. Reviewers: kcc Subscribers: kubabrecka, mgorny Differential Revision: https://reviews.llvm.org/D28311 llvm-svn: 291068
* [sanitizers] dont dump coverage if not asked toMike Aizatsky2016-12-151-3/+9
| | | | llvm-svn: 289835
* [sanitizers] -DAG is order-independent checkMike Aizatsky2016-12-131-3/+3
| | | | llvm-svn: 289606
* [sancov] Disable failing test on SystemZ as wellUlrich Weigand2016-12-132-2/+2
| | | | | | | This doesn't work at all on big-endian systems, even just reading in the magic bytes in the binary .sancov file header gets byte order wrong. llvm-svn: 289539
* [sancov] Mark as unstable on ARM, not XFAIL, since it does pass on some configRenato Golin2016-12-132-4/+4
| | | | llvm-svn: 289526
* [sanitizers] dso order is random, test shouldnt depend on itMike Aizatsky2016-12-131-3/+3
| | | | llvm-svn: 289516
* [sanitizers] powerpc4 is also unsupported platformMike Aizatsky2016-12-132-2/+2
| | | | llvm-svn: 289515
* [sanitizers] disabling dso test as well where appropriateMike Aizatsky2016-12-131-1/+1
| | | | llvm-svn: 289508
* [sanitizers] trace-pc-guard doesn't work on mac as wellMike Aizatsky2016-12-131-1/+1
| | | | | | | | fatal error: error in backend: Global variable '__sancov_gen_' has an invalid section specifier '__sancov_guards': mach-o section specifier requires a segment and section separated by a comma. llvm-svn: 289507
* [sanitizers] sancov really works on x86 onlyMike Aizatsky2016-12-131-1/+1
| | | | llvm-svn: 289505
* [sancov] __sanitizer_dump_coverage apiMike Aizatsky2016-12-122-0/+107
| | | | | | | | Subscribers: kubabrecka, mgorny Differential Revision: https://reviews.llvm.org/D26758 llvm-svn: 289498
* [asan] Disable yet another unstable test under AArch64Renato Golin2016-12-071-0/+1
| | | | llvm-svn: 288953
* [sanitizers] mac prints null differentlyMike Aizatsky2016-12-051-1/+1
| | | | llvm-svn: 288726
* [sanitizers] __sanitizer_get_module_and_offset_for_pc interface functionMike Aizatsky2016-12-051-0/+63
| | | | | | | | | | | | Summary: The function computes full module name and coverts pc into offset. Reviewers: kcc Subscribers: kubabrecka Differential Revision: https://reviews.llvm.org/D26820 llvm-svn: 288711
* [sanitizer] Add macOS minimum deployment target to all compiler invocations ↵Kuba Mracek2016-11-291-8/+1
| | | | | | | | | | in lit tests The Clang driver on macOS decides the deployment target based on various things, like your host OS version, the SDK version and some environment variables, which makes lit tests pass or fail based on your environment. Let's make sure we run all lit tests with `-mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}` (10.9 unless overriden). Differential Revision: https://reviews.llvm.org/D26929 llvm-svn: 288186
* [sanitizers] Get the proper printf/scanf version when long double transition ↵Marcin Koscielnicki2016-11-282-0/+26
| | | | | | | | | | | is involved. See D19555 for rationale. As it turns out, this treatment is also necessary for scanf/printf. Differential Revision: https://reviews.llvm.org/D27118 llvm-svn: 288064
* [sanitizer] Fix the dedup_token_length_test.cc testcase to not fail when ↵Kuba Mracek2016-11-221-7/+5
| | | | | | | | user's home directory contains "bar" Differential Revision: https://reviews.llvm.org/D24605 llvm-svn: 287696
* [lsan] [aarch64] Fix printing of pointers in make check tests - updateStrahinja Petrovic2016-11-141-0/+19
| | | | | | | | | This patch replaces fprintf with print_address function in LSAN tests. This is necessary because of different printing of pointers in fprintf and sanitizer's print function. Differential Revision: https://reviews.llvm.org/D26084. llvm-svn: 286816
* [sanitizers] Update sanitizers test to better match glibc internalsDiana Picus2016-10-051-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reapply 282061. 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 The logic is complicated a bit by the fact that the sanitizers always pick the oldest version of the symbol available in glibc, which creates discrepancies between old platforms which contain several versions od the sem_init symbol, and newer platforms which contain only one. 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: 283299
* 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
* [sanitizer] rename __sanitizer_symbolize_data to ↵Kostya Serebryany2016-09-191-1/+1
| | | | | | __sanitizer_symbolize_global (to avoid conflict with another definition) llvm-svn: 281902
* [sanitizer] add __sanitizer_symbolize_data (can only print the names of the ↵Kostya Serebryany2016-09-191-0/+11
| | | | | | globals for now) llvm-svn: 281886
* [sanitizer] fix a potential buffer overflow due to __sanitizer_symbolize_pc ↵Kostya Serebryany2016-09-091-1/+9
| | | | | | (need to put a zero after strncmp). LOL llvm-svn: 281015
* [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] Enable sanitizer_common tests on Win64Reid Kleckner2016-07-221-3/+1
| | | | llvm-svn: 276440
* [sanitizers] add interceptor for memmem; add weak hooks for strncasecmp, ↵Kostya Serebryany2016-07-151-0/+82
| | | | | | strcasecmp, strstr, strcasestr, memmem llvm-svn: 275621
* [compiler-rt] Fix VisualStudio virtual folders layoutEtienne Bergeron2016-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: This patch is a refactoring of the way cmake 'targets' are grouped. It won't affect non-UI cmake-generators. Clang/LLVM are using a structured way to group targets which ease navigation through Visual Studio UI. The Compiler-RT projects differ from the way Clang/LLVM are grouping targets. This patch doesn't contain behavior changes. Reviewers: kubabrecka, rnk Subscribers: wang0109, llvm-commits, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D21952 llvm-svn: 275111
* [sanitizers] introduce yet another API function: ↵Kostya Serebryany2016-06-161-2/+14
| | | | | | __sanitizer_install_malloc_and_free_hooks llvm-svn: 272943
OpenPOWER on IntegriCloud