summaryrefslogtreecommitdiff
path: root/test/asan/lit.cfg
AgeCommit message (Collapse)Author
2017-12-01[ubsan] Re-commit: lit changes for lld testing, future lto testing.Roman Lebedev
Summary: As discussed in https://github.com/google/oss-fuzz/issues/933, it would be really awesome to be able to use ThinLTO for fuzzing. However, as @kcc has pointed out, it is currently undefined (untested) whether the sanitizers actually function properly with LLD and/or LTO. This patch is inspired by the cfi test, which already do test with LTO (and/or LLD), since LTO is required for CFI to function. I started with UBSan, because it's cmakelists / lit.* files appeared to be the cleanest. This patch adds the infrastructure to easily add LLD and/or LTO sub-variants of the existing lit test configurations. Also, this patch adds the LLD flavor, that explicitly does use LLD to link. The check-ubsan does pass on my machine. And to minimize the [initial] potential buildbot breakage i have put some restrictions on this flavour. Please review carefully, i have not worked with lit/sanitizer tests before. The original attempt, r319525 was reverted in r319526 due to the failures in compiler-rt standalone builds. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: #sanitizers, pcc, kubamracek, mgorny, llvm-commits, mehdi_amini, inglorion, kcc Differential Revision: https://reviews.llvm.org/D39508 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01Revert "[ubsan] lit changes for lld testing, future lto testing."Roman Lebedev
This reverts commit r319525. This change has introduced a problem with the Lit tests build for compiler-rt using Gold: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/6047/steps/test%20standalone%20compiler-rt/logs/stdio llvm-lit: /b/sanitizer-x86_64-linux/build/llvm/utils/lit/lit/TestingConfig.py:101: fatal: unable to parse config file '/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg', traceback: Traceback (most recent call last): File "/b/sanitizer-x86_64-linux/build/llvm/utils/lit/lit/TestingConfig.py", line 88, in load_from_path exec(compile(data, path, 'exec'), cfg_globals, None) File "/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg", line 37, in <module> if root.host_os not in ['Linux'] or not is_gold_linker_available(): File "/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg", line 27, in is_gold_linker_available stderr = subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 390, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319529 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01[ubsan] lit changes for lld testing, future lto testing.Roman Lebedev
Summary: As discussed in https://github.com/google/oss-fuzz/issues/933, it would be really awesome to be able to use ThinLTO for fuzzing. However, as @kcc has pointed out, it is currently undefined (untested) whether the sanitizers actually function properly with LLD and/or LTO. This patch is inspired by the cfi test, which already do test with LTO (and/or LLD), since LTO is required for CFI to function. I started with UBSan, because it's cmakelists / lit.* files appeared to be the cleanest. This patch adds the infrastructure to easily add LLD and/or LTO sub-variants of the existing lit test configurations. Also, this patch adds the LLD flavor, that explicitly does use LLD to link. The check-ubsan does pass on my machine. And to minimize the [initial] potential buildbot breakage i have put some restrictions on this flavour. Please review carefully, i have not worked with lit/sanitizer tests before. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: #sanitizers, pcc, kubamracek, mgorny, llvm-commits, mehdi_amini, inglorion, kcc Differential Revision: https://reviews.llvm.org/D39508 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319525 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10Factor out "stable-runtime" feature and enable it on all android.Evgeniy Stepanov
This is a very poorly named feature. I think originally it meant to cover linux only, but the use of it in msan seems to be about any aarch64 platform. Anyway, this change should be NFC on everything except Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315389 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-06Factor out default_(a|ub)sanitizer_opts in lit.Evgeniy Stepanov
Reviewers: vitalybuka Subscribers: srhines, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D38644 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05[sanitizer] Move %ld_flags_rpath_exe to common and use it in more tests.Evgeniy Stepanov
Reviewers: vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D38527 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315010 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16[sanitizer] Move android_commoands from asan into sanitizer_commonVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16[asan] Remove not-androidVitaly Buka
Replaced with !android git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313440 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-28Reland r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny
Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311924 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-27Revert r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny
The required change in clang is being reverted because of the Android build bot failure. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-27[cmake] Remove i686 target that is duplicate to i386Michal Gorny
Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-21[asan] Fix android compiler wrapper lost in r301617.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12Enable lsan test suite on Darwin x86_64 buildsFrancis Ricci
Reviewers: kubamracek, alekseyshl Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D32191 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28[asan] Add a compilation wrapper that codesigns shared libraries to support ↵Kuba Mracek
iOS simulator testing Tests that run on the iOS simulator require the dlopen'd dylibs are codesigned. This patch adds the "iossim_compile.py" wrapper that codesigns any produces dylib. Differential Revision: https://reviews.llvm.org/D32561 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301617 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21Revert "Enable lsan test suite on Darwin x86_64 builds"Ahmed Bougacha
This reverts commit r300897. Most LSan/ASan tests are failing on darwin bots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300929 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20Enable lsan test suite on Darwin x86_64 buildsFrancis Ricci
Reviewers: kubamracek, alekseyshl Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D32191 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300897 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13[lsan] Reenable lsan tests on ARM botsMaxim Ostapenko
This patch addresses pr32636. Enable lsan tests on ARM bots filtering out Thumb targets. Tested locally on ARM Arndale board in two configurations: 1) CFLAGS="-march=armv7-a" Testing Time: 37.57s Expected Passes : 69 Unsupported Tests : 7 2) CFLAGS="-march=armv7-a -mthumb" Testing Time: 0.16s Unsupported Tests : 76 Differential Revision: https://reviews.llvm.org/D32007 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300194 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11Reapply "Enable LSan for arm Linux"Maxim Ostapenko
This patch reapplies r299923 with typo fixed in BLX macros. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299948 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11Revert r299923, it doesn't build in bootstrap builds.Nico Weber
FAILED: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.arm.dir/sanitizer_linux.cc.o lib/sanitizer_common/sanitizer_linux.cc:1340:24: error: invalid instruction BLX(ip) ^ lib/sanitizer_common/sanitizer_linux.cc:1313:19: note: expanded from macro 'BLX' # define BLX(R) "mov lr, pc; bx" #R "\n" ^ <inline asm>:6:13: note: instantiated into assembly here mov lr, pc; bxip ^~~~ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299943 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11[lsan] Enable LSan for arm LinuxMaxim Ostapenko
This patch enables LSan for arm Linux. Differential Revision: https://reviews.llvm.org/D29586 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04Avoid calling basename to compute xdynamiclib_namespec.Rafael Espindola
This also exposes a xdynamiclib_filename that can be used to simplify a few tests. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299478 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21[compiler-rt][asan] Add support for desallocation of unhandled pointersEtienne Bergeron
Summary: On windows 10, the ucrt DLL is performing allocations before the function hooking and there are multiple allocations not handled by Asan. When a free occur at the end of the process, asan is reporting desallocations not malloc-ed. Reviewers: rnk, kcc Reviewed By: rnk, kcc Subscribers: kcc, llvm-commits, kubamracek, chrisha, dberris Differential Revision: https://reviews.llvm.org/D25946 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295730 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31[lsan] Renable LSan for x86 LinuxMaxim Ostapenko
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293610 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23Revert "[lsan] Enable LSan for x86 Linux."Evgeniy Stepanov
Breaks tests on i686/Linux due to missing clang driver support: error: unsupported option '-fsanitize=leak' for target 'i386-unknown-linux-gnu' git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23[lsan] Enable LSan for x86 Linux.Maxim Ostapenko
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292775 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20[lit] Limit parallelism of sanitizer tests on Darwin [compiler-rt part, take 2]Kuba Mracek
Running lit tests and unit tests of ASan and TSan on macOS has very bad performance when running with a high number of threads. This is caused by xnu (the macOS kernel), which currently doesn't handle mapping and unmapping of sanitizer shadow regions (reserved VM which are several terabytes large) very well. The situation is so bad that increasing the number of threads actually makes the total testing time larger. The macOS buildbots are affected by this. Note that we can't easily limit the number of sanitizer testing threads without affecting the rest of the tests. This patch adds a special "group" into lit, and limits the number of concurrently running tests in this group. This helps solve the contention problem, while still allowing other tests to run in full, that means running lit with -j8 will still with 8 threads, and parallelism is only limited in sanitizer tests. Differential Revision: https://reviews.llvm.org/D28420 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292549 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17Revert r292232.Kuba Mracek
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292236 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17[lit] Limit parallelism of sanitizer tests on Darwin [compiler-rt part]Kuba Mracek
Running lit tests and unit tests of ASan and TSan on macOS has very bad performance when running with a high number of threads. This is caused by xnu (the macOS kernel), which currently doesn't handle mapping and unmapping of sanitizer shadow regions (reserved VM which are several terabytes large) very well. The situation is so bad that increasing the number of threads actually makes the total testing time larger. The macOS buildbots are affected by this. Note that we can't easily limit the number of sanitizer testing threads without affecting the rest of the tests. This patch adds a special "group" into lit, and limits the number of concurrently running tests in this group. This helps solve the contention problem, while still allowing other tests to run in full, that means running lit with -j8 will still with 8 threads, and parallelism is only limited in sanitizer tests. Differential Revision: https://reviews.llvm.org/D28420 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292232 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10Make cmake link flag naming consistentFrancis Ricci
Summary: The build system was inconsistent in its naming conventions for link flags. This patch changes all uses of LINKFLAGS to LINK_FLAGS, for consistency with cmake's LINK_FLAGS property. This patch should make it easier to search the source code for uses of link flags, as well as providing the benefit of improved style and consistency. Reviewers: compnerd, beanz Subscribers: kubabrecka, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28506 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-27test: filter out -fPIE/-pie on WindowsSaleem Abdulrasool
Use some new substitutions to avoid duplicating the tests for just dropped flags. -fPIC/-fPIE/-fpic/-fpie do not make sense on Windows as they can cause ELF-style PIC. Substitute away the flag on Windows. This should repair the windows buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@290571 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02[asan] Add more dynamic CRT mode testsReid Kleckner
Only tests using %clang_cl_asan were using the dynamic CRT before this. The unit tests and lit tests using %clangxx_asan were using the static CRT. Many cross-platform tests fail with the dynamic CRT, so I had to add win32-(static|dynamic)-asan lit features. Also deletes some redundant tests in TestCases/Windows that started failing with this switch. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@285821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23[compiler-rt] Fix a broken asan 64-bit test using ld_preloadEtienne Bergeron
Summary: The 'asan_preload_test-1.cc' is not working with the i686 architecture. To repro the error, run on a linux 64-bit: ``` ninja check-asan-dynamic ``` The following error occurs: ``` -- Exit Code: 1 Command Output (stderr): -- /home/llvm/llvm/projects/compiler-rt/test/asan/TestCases/Linux/asan_preload_test-1.cc:18:12: error: expected string not found in input // CHECK: AddressSanitizer: heap-buffer-overflow ^ <stdin>:1:1: note: scanning from here ERROR: ld.so: object 'libclang_rt.asan-i686.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. ^ <stdin>:2:10: note: possible intended match here ==25982==AddressSanitizer CHECK failed: /home/llvm/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:736 "((__interception::real_memcpy)) != (0)" (0x0, 0x0) ``` The unittest is running (where %shared_libasan is replaced by libclang_rt.asan-i686.so): ``` // RUN: env LD_PRELOAD=%shared_libasan not %run %t 2>&1 | FileCheck %s ``` But the executable also has a dependancy on libclang_rt.asan-i386.so (added by the clang driver): ``` linux-gate.so.1 => (0xf77cc000) libclang_rt.asan-i386.so => not found libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf76ba000) libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7673000) libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7656000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf74a7000) ``` By looking to the clang driver (tools.cpp) we can see that every x86 architecture are mapped to 'i386'. ``` StringRef MyArch; switch (getToolChain().getArch()) { case llvm::Triple::arm: MyArch = "arm"; break; case llvm::Triple::x86: MyArch = "i386"; break; case llvm::Triple::x86_64: MyArch = "amd64"; break; default: llvm_unreachable("Unsupported architecture"); } ``` This patch is implementing the same mapping but in the compiler-rt unittest. Reviewers: rnk, vitalybuka Subscribers: aemerson, kubabrecka, dberris, llvm-commits, chrisha Differential Revision: https://reviews.llvm.org/D24838 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09[asan] Disable handle_abort in Android tests.Evgeniy Stepanov
The same thing is already done on Mac. handle_abort slows down tests significantly because it triggers tombstone collection on Android; also, it changes failed test outcome from "not-crash" to "crash" (as in "bin/not --crash"). This change adds handle_abort=0 to asan options on android (test only!), and also tweaks android_run.py to semi-correctly pass the crash/no-crash status to the caller. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281075 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22Try to fix more Windows portability issues in sanitizer testsReid Kleckner
Add a %stdcxx11 lit substitution for -std=c++11. Windows defaults to -std=c++14 when VS 2015 is used because the STL requires it. Harcoding -std=c++11 in the ASan tests actually downgrades the C++ standard level, leading to test failures. Relax a FileCheck pattern in use-after-scope-types.cc. Disable the sanitizer_common OOM tests. They fail on bots with low swap, and cause other concurrently running tests to OOM. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276454 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12[ASan] [SystemZ] Add -mbackchain to test cflags.Marcin Koscielnicki
This is needed for proper operation of the fast unwinder, see the discussion on D18895. Differential Revision: http://reviews.llvm.org/D19898 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269277 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22Move -fms-compatibility-version=19 into target cflagsReid Kleckner
This reduces cflags duplication and allows us to build sanitizer_common/tests with clang and the VS 2015 STL. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21[asan] Pass -fms-compatibility-version=19 with VS 2015Reid Kleckner
This resolves errors about char16_t and char32_t when compiling 2015 STL headers with clang. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27[sanitizers] generating html report on coverage dumpMike Aizatsky
Subscribers: tberghammer, danalbert, srhines Differential Revision: http://reviews.llvm.org/D16374 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258999 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20Reapply: [asan] On OS X, log reports to syslog and os_traceAnna Zaks
When ASan currently detects a bug, by default it will only print out the text of the report to stderr. This patch changes this behavior and writes the full text of the report to syslog before we terminate the process. It also calls os_trace (Activity Tracing available on OS X and iOS) with a message saying that the report is available in syslog. This is useful, because this message will be shown in the crash log. For this to work, the patch makes sure we store the full report into error_message_buffer unconditionally, and it also strips out ANSI escape sequences from the report (they are used when producing colored reports). I've initially tried to log to syslog during printing, which is done on Android right now. The advantage is that if we crash during error reporting or the produced error does not go through ScopedInErrorReport, we would still get a (partial) message in the syslog. However, that solution is very problematic on OS X. One issue is that the logging routine uses GCD, which may spawn a new thread on its behalf. In many cases, the reporting logic locks threadRegistry, which leads to deadlocks. Reviewed at http://reviews.llvm.org/D13452 (In addition, add sanitizer_common_libcdep.cc to buildgo.sh to avoid build failures on Linux.) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253688 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-04Revert "Reapply: [asan] On OS X, log reports to syslog and os_trace"Juergen Ributzka
Looks like this commit is deadlocking the ASAN tests on the green dragon bot (http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA/). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252076 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-28Reapply: [asan] On OS X, log reports to syslog and os_traceAnna Zaks
When ASan currently detects a bug, by default it will only print out the text of the report to stderr. This patch changes this behavior and writes the full text of the report to syslog before we terminate the process. It also calls os_trace (Activity Tracing available on OS X and iOS) with a message saying that the report is available in syslog. This is useful, because this message will be shown in the crash log. For this to work, the patch makes sure we store the full report into error_message_buffer unconditionally, and it also strips out ANSI escape sequences from the report (they are used when producing colored reports). I've initially tried to log to syslog during printing, which is done on Android right now. The advantage is that if we crash during error reporting or the produced error does not go through ScopedInErrorReport, we would still get a (partial) message in the syslog. However, that solution is very problematic on OS X. One issue is that the logging routine uses GCD, which may spawn a new thread on its behalf. In many cases, the reporting logic locks threadRegistry, which leads to deadlocks. Reviewed at http://reviews.llvm.org/D13452 (In addition, add sanitizer_common_libcdep.cc to buildgo.sh to avoid build failures on Linux.) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251577 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-27Revert "[asan] On OS X, log reports to syslog and os_trace"Anna Zaks
This reverts commit 251447. (Which caused failures on a Linux bot.) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251467 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-27[asan] On OS X, log reports to syslog and os_traceAnna Zaks
When ASan currently detects a bug, by default it will only print out the text of the report to stderr. This patch changes this behavior and writes the full text of the report to syslog before we terminate the process. It also calls os_trace (Activity Tracing available on OS X and iOS) with a message saying that the report is available in syslog. This is useful, because this message will be shown in the crash log. For this to work, the patch makes sure we store the full report into error_message_buffer unconditionally, and it also strips out ANSI escape sequences from the report (they are used when producing colored reports). I've initially tried to log to syslog during printing, which is done on Android right now. The advantage is that if we crash during error reporting or the produced error does not go through ScopedInErrorReport, we would still get a (partial) message in the syslog. However, that solution is very problematic on OS X. One issue is that the logging routine uses GCD, which may spawn a new thread on its behalf. In many cases, the reporting logic locks threadRegistry, which leads to deadlocks. Reviewed at http://reviews.llvm.org/D13452 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251447 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-26[asan] Switch back to BFD linker in asan/android tests.Evgeniy Stepanov
We've switched to Gold earlier because of a minor misconfiguration of the BFD linker in Android NDK. It turns out, Gold has much bigger problems: https://sourceware.org/bugzilla/show_bug.cgi?id=19163 (a bug is actually in the android runtime loader, but it means that gold does not work with android L and even M). Switching back to BFD and adding a workaround by explicitly linking libm to all tests. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251360 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-29Add armhf as unstable runtime temporarilyRenato Golin
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248819 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-18Revert "[sanitizer] Move definition of stable-runtime to common lit config."Renato Golin
This reverts commit r245263, and the change wasn't catched by UBsan. It also reverts: "[ARM] Also disable stable-runtime check on UBsan, to use generic one" (r245287), as it didn't fix the UBsan builds. We need to investigate what's going on before continuing, since this is breaking all ARM RT buildbots for a while. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245292 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-18[sanitizer] Move definition of stable-runtime to common lit config.Evgeniy Stepanov
There are tests in sanitizer_common that are unconditionally disabled because they REQUIRE: stable-runtime which is never defined. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245263 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14Fixup stale comment about supported OSsReid Kleckner
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245089 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14[windows] Fix or XFAIL remaining portable test failures and enable themReid Kleckner
Summary: This involved various fixes: - Move a test that uses ulimit to Posix. - Add a few "REQUIRES: shell" lines to tests using backtick subshell evaluation. - The MSVC CRT buffers stdio if the output is a pipe by default. Some tests need that disabled to avoid interleaving test stdio with asan output. - MSVC headers provide _alloca instead of alloca (go figure), so add a portability macro to the two alloca tests. - XFAIL tests that rely on accurate symbols, we need to pass more flags to make that work. - MSVC's printf implementation of %p uses upper case letters and doesn't add 0x, so do that manually. - Accept "SEGV" or "access-violation" reports in crash tests. Reviewers: samsonov Subscribers: tberghammer, danalbert, llvm-commits, srhines Differential Revision: http://reviews.llvm.org/D12019 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245073 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12Use %env_asan_opts= substitution instead of 'env ASAN_OPTIONS=$ASAN_OPTIONS'Reid Kleckner
Summary: The lit internal shell is used by default on Windows, and it does not support bash variable expansion. Because bash variable expansion interacts with tokenization, it is prohibitively difficult to make the existing lit shell do general shell variable expansion. The most common use of shell variables in the asan tests is to add options to the default set of options set by lit.cfg. We can avoid the need for variable expansion with a substitution that expands to 'env ASAN_OPTIONS=<defaults:>'. This has the side benefit of shortening the RUN lines, so it seemed better than implementing limited variable expansion in lit. Reviewers: samsonov, filcab Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11982 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@244839 91177308-0d34-0410-b5e6-96231b3b80d8