summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan
Commit message (Collapse)AuthorAgeFilesLines
...
* Delete unused <dbghelp.h> includeReid Kleckner2015-07-291-1/+0
| | | | llvm-svn: 243529
* [asan] Support per-application flags in the Android setup script.Evgeniy Stepanov2015-07-281-0/+1
| | | | llvm-svn: 243494
* [asan] Read process name from /proc/self/cmdline on Linux.Evgeniy Stepanov2015-07-281-0/+2
| | | | | | | | | | Rename getBinaryBasename() to getProcessName() and, on Linux, read it from /proc/self/cmdline instead of /proc/self/exe. The former can be modified by the process. The main motivation is Android, where application processes re-write cmdline to a package name. This lets us setup per-application ASAN_OPTIONS through include=/some/path/%b. llvm-svn: 243473
* [asan] Set abort_on_error=1 by default on OS XKuba Brecka2015-07-282-1/+8
| | | | | | | | This sets the default ASan flags to abort_on_error=1 on OS X. For unit tests and lit tests we set ASAN_OPTIONS back to abort_on_error=0 before running the tests (to avoid crashing). I added two tests that intentionally don't respect the default ASAN_OPTIONS to test the behavior of an empty ASAN_OPTIONS (on OS X we should crash, on Linux we should exit()). Differential Revision: http://reviews.llvm.org/D7203 llvm-svn: 243418
* [asan] Only link liblog on Android when it exists.Evgeniy Stepanov2015-07-242-3/+2
| | | | | | With r242975, liblog is only used on certain older platforms. llvm-svn: 243139
* [asan] Trying to make peace with the Windows bots, take 2Kuba Brecka2015-07-231-1/+3
| | | | | | | | There are some test failures after r243003 and r243004 ("Rename the ABI versioning symbol to '__asan_version_mismatch_check' instead abusing '__asan_init'"). See http://reviews.llvm.org/D11004 llvm-svn: 243007
* [asan] Trying to make peace with the Windows botsKuba Brecka2015-07-231-0/+2
| | | | | | | | There are some test failures after r243003 and r243004 ("Rename the ABI versioning symbol to '__asan_version_mismatch_check' instead abusing '__asan_init'"). See http://reviews.llvm.org/D11004 llvm-svn: 243005
* [asan] Rename the ABI versioning symbol to '__asan_version_mismatch_check' ↵Kuba Brecka2015-07-234-5/+13
| | | | | | | | | | instead of abusing '__asan_init' We currently version `__asan_init` and when the ABI version doesn't match, the linker gives a `undefined reference to '__asan_init_v5'` message. From this, it might not be obvious that it's actually a version mismatch error. This patch makes the error message much clearer by changing the name of the undefined symbol to be `__asan_version_mismatch_check_xxx` (followed by the version string). We obviously don't want the initializer to be named like that, so it's a separate symbol that is used only for the purpose of version checking. Reviewed at http://reviews.llvm.org/D11004 llvm-svn: 243004
* [asan] Make __asan_handle_no_return tolerate unregistered threadsReid Kleckner2015-07-221-4/+12
| | | | | | | | | | | | | | | | | | | Summary: On Windows, thread injection by the kernel or other running processes is a fairly common occurrence, so ASan should be resilient to it. The comments on GetCurrentThread() say that it can return null, so we shouldn't be CHECK failing if it does. Sending control-C is one way to get the kernel to inject a thread into your process, so I wrote a test around it. Reviewers: llvm-commits Subscribers: samsonov Differential Revision: http://reviews.llvm.org/D11426 llvm-svn: 242948
* [sanitizer] Implement include_if_exists with process name substitution.Evgeniy Stepanov2015-07-212-3/+3
| | | | | | | | | 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] Remove AsanPlatformThreadInitReid Kleckner2015-07-215-13/+0
| | | | | | | | | | | Since the CoreFoundation allocator replacement was moved in r173134, all implementations of this function have been empty. Reviewers: samsonov Differential Revision: http://reviews.llvm.org/D11375 llvm-svn: 242811
* [asan] Speed up ASan unit tests by turning off symbolicationKuba Brecka2015-07-201-0/+6
| | | | | | | | ASan unit tests don't depend on the symbolizer and they never test its output, but currently they still run it for every crash. This patch simply disables the symbolizer for unit tests, which provides some speed up. On my system (OS X) that's about 1.4x faster, but this could be potentially much more e.g. when using atos on OS X. Differential Revision: http://reviews.llvm.org/D11353 llvm-svn: 242677
* [asan] Add OS X 10.11's new dyld interposition supportKuba Brecka2015-07-061-2/+24
| | | | | | | | On OS X 10.11 (which is currently a public beta), the dynamic linker has been improved so that it doesn't require the use of DYLD_INSERT_LIBRARIES in order for interposition/wrappers to work. This patch adds support of this behavior into ASan – we no longer need to re-exec in case the env. variable is not set. Reviewed at http://reviews.llvm.org/D10924 llvm-svn: 241487
* [asan] Fix SanitizerCommon.PthreadDestructorIterations test on Android L.Evgeniy Stepanov2015-06-291-6/+3
| | | | | | | On Android L, TSD destructors run 8 times instead of 4. Back to 4 times on the current master branch (as well as on K). llvm-svn: 240992
* [ASan] Clean up obsolete stats.Alexey Samsonov2015-06-264-18/+6
| | | | | | | | Remove stats that we no longer collect after the allocator change. Use proper constant SizeClassMap::kNumClasses to fix potential buffer overflow (https://code.google.com/p/address-sanitizer/issues/detail?id=397). llvm-svn: 240816
* Working on reconciling out-of-tree patches to compiler-rt for building for iOS.Chris Bieneman2015-06-232-4/+20
| | | | | | | | | | | | | | | | | | | Summary: This is one of many changes needed for compiler-rt to get it building on iOS. This change ifdefs out headers and functionality that aren't available on iOS, and adds support for iOS and the iOS simulator to as an. Note: this change does not enable building for iOS, as there are more changes to come. Reviewers: glider, kubabrecka, bogner, samsonov Reviewed By: samsonov Subscribers: samsonov, zaks.anna, llvm-commits Differential Revision: http://reviews.llvm.org/D10515 llvm-svn: 240469
* Working on reconciling out-of-tree patches to compiler-rt for building for iOS.Chris Bieneman2015-06-231-10/+7
| | | | | | | | | | | | | | | | | | | | | Summary: This is one of many changes needed for compiler-rt to get it building on iOS. This change does the following: - Don't include crt_externs on iOS (it isn't available) - Support ARM thread state objects Note: this change does not enable building for iOS, as there are more changes to come. Reviewers: glider, kubabrecka, bogner, samsonov Reviewed By: samsonov Subscribers: samsonov, aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D10510 llvm-svn: 240467
* CMake: Stop using LLVM's custom parse_arguments. NFCFilipe Cabecinhas2015-06-192-9/+9
| | | | | | | | | | | | | | | | | | | | | Summary: Use CMake's cmake_parse_arguments() instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc): http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments Since I was already changing these calls, I changed ARCH and LIB into ARCHS and LIBS to make it more clear that they're lists of arguments. Reviewers: eugenis, samsonov, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10529 llvm-svn: 240120
* [CMake] Cleanup add_compiler_rt_object_library to be platform-agnosticChris Bieneman2015-06-101-29/+31
| | | | | | | | | | | | | | | | | Summary: This change takes darwin-specific goop that was scattered around CMakeLists files and spread between add_compiler_rt_object_library and add_compiler_rt_darwin_object_library and moves it all under add_compiler_rt_object_library. The goal of this is to try to push platform handling as low in the utility functions as possible. Reviewers: rnk, samsonov Reviewed By: rnk, samsonov Subscribers: rnk, rsmith, llvm-commits Differential Revision: http://reviews.llvm.org/D10250 llvm-svn: 239498
* [asan] Fix build of AsanNoinstTest on Android.Evgeniy Stepanov2015-06-081-0/+2
| | | | | | Some of the asan-ubsan build changes were not replicated in the android branch in CMakeLists. llvm-svn: 239320
* [ASan] Bump maximum allowed malloc() size in ASan allocator to 1Tb.Alexey Samsonov2015-06-051-2/+2
| | | | | | 1Tb of RAM ought to be enough for anybody. llvm-svn: 239187
* [ASan] Make binary name reader cross-platform.Yury Gribov2015-06-041-0/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D10213 llvm-svn: 239020
* [ASan] Move ASan runtime library self-checks to a more appropriate place.Yury Gribov2015-06-042-4/+7
| | | | llvm-svn: 239018
* Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.Evgeniy Stepanov2015-05-295-10/+12
| | | | | | | | | | | | | | | | | | 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
* [ASan] Add new interceptors to asan_win_dll_thunk.cc to fix build errors on ↵Yury Gribov2015-05-281-0/+4
| | | | | | | | Windows. Patch by Maria Guseva! llvm-svn: 238407
* [ASan] New approach to dynamic allocas unpoisoning. Patch by Max Ostapenko!Yury Gribov2015-05-282-0/+27
| | | | | | Differential Revision: http://reviews.llvm.org/D7098 llvm-svn: 238401
* [asan] Fix build dependency issues with ASan version list file.Evgeniy Stepanov2015-05-271-2/+15
| | | | | | | | | | CMake pre-3.1 has a bug where a shared library depending on a custom_target does not really depend on it. This commit implements a hilariously ugly workaround for this problem, see code comments for more details. llvm-svn: 238367
* [ASan/Win] Add DLL thunk for new coverage hookReid Kleckner2015-05-191-0/+1
| | | | | | Should fix dll_host.cc test failing on bots. llvm-svn: 237725
* [sanitizer] Recognize static TLS in __tls_get_addr interceptor.Evgeniy Stepanov2015-05-161-0/+7
| | | | | | | Current code tries to find the dynamic TLS header to the left of the TLS block without checking that it's not a static TLS allocation. llvm-svn: 237495
* [asan] Fix compiler-rt build.Evgeniy Stepanov2015-05-051-1/+4
| | | | | | i386 runtime library was accidentally using the x86_64 version script without a dependency. llvm-svn: 236556
* [asan] Use a version script to limit the symbols exported by the ASan shared ↵Evgeniy Stepanov2015-05-051-0/+10
| | | | | | runtime library. llvm-svn: 236551
* Build ASan runtime library with -z global on Android.Evgeniy Stepanov2015-05-051-0/+14
| | | | llvm-svn: 236537
* Disable exceptions for clang-compiled unittest code on WindowsReid Kleckner2015-05-011-0/+5
| | | | llvm-svn: 236357
* [asan] Print SHADOW_SCALE and SHADOW_GRANULARITY as decimal values.Daniel Sanders2015-04-251-3/+3
| | | | | | | | | | | | | | | | | | | | | Summary: During the review of http://reviews.llvm.org/D9199 where I had originally changed the debug_mapping.cc test to accept hexadecimal values, we realized that SHADOW_SCALE and SHADOW_GRANULARITY ought to be printed as decimal values. This patch makes that change. This patch also adds a '0x' prefix to the SHADOW_OFFSET to make it clear that it is hexadecimal while the other two are decimal. Reviewers: kcc, timurrrr, samsonov Reviewed By: timurrrr, samsonov Subscribers: samsonov, llvm-commits, sagar Differential Revision: http://reviews.llvm.org/D9224 llvm-svn: 235798
* [ASan] Print global registration site in init-order-checker reports.Alexey Samsonov2015-04-223-32/+43
| | | | llvm-svn: 235540
* [ASan] Refactor functions searching/describing globals. NFC.Alexey Samsonov2015-04-223-29/+29
| | | | llvm-svn: 235539
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-2/+2
| | | | | | | | | | | | The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix \ -format llvm-svn: 234680
* [ASan] Use a better name for a function parameterTimur Iskhodzhanov2015-04-101-3/+3
| | | | llvm-svn: 234604
* Split Mprotect into MmapNoAccess and MprotectNoAccess to be more portableTimur Iskhodzhanov2015-04-101-1/+1
| | | | | | | On Windows, we have to know if a memory to be protected is mapped or not. On POSIX, Mprotect was semantically different from mprotect most people know. llvm-svn: 234602
* Use WriteToFile instead of internal_write in non-POSIX codeTimur Iskhodzhanov2015-04-091-0/+1
| | | | llvm-svn: 234487
* [Compiler-rt][MIPS] Fix for asan test suite build on mips64/mips64elMohit K. Bhakkad2015-04-091-2/+4
| | | | | | | Patch by Sagar Thakur Reviewers: dsanders llvm-svn: 234468
* Move some POSIX-specific functions from sanitizer_libc.h to a new ↵Timur Iskhodzhanov2015-04-081-0/+4
| | | | | | sanitizer_posix.h llvm-svn: 234418
* sanitizer: new "strict_string_checks" run-time flagDmitry Vyukov2015-04-062-72/+19
| | | | | | | | | | This patch is related to Issue 346: moar string interceptors: strstr, strcasestr, strcspn, strpbrk As was suggested in original review http://reviews.llvm.org/D6056 a new "strict_string_checks" run-time flag introduced. The flag support applied for existing common, asan, msan and tsan interceptors. New asan tests added. Change by Maria Guseva reviewed in http://reviews.llvm.org/D7123 llvm-svn: 234187
* [ASan] Do not print thread IDs and stacks for unknown threads.Alexander Potapenko2015-04-061-0/+5
| | | | llvm-svn: 234147
* [UBSan] Embed UBSan into ASan runtime (compiler-rt part).Alexey Samsonov2015-04-014-9/+37
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Change the way we use ASan and UBSan together. Instead of keeping two separate runtimes (libclang_rt.asan and libclang_rt.ubsan), embed UBSan into ASan and get rid of libclang_rt.ubsan. If UBSan is not supported on a platform, all UBSan sources are just compiled into dummy empty object files. UBSan initialization code (e.g. flag parsing) is directly called from ASan initialization, so we are able to enforce correct initialization order. This mirrors the approach we already use for ASan+LSan. This change doesn't modify the way we use standalone UBSan. Test Plan: regression test suite Reviewers: kubabrecka, zaks.anna, rsmith, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8646 llvm-svn: 233861
* Add another sanity check for swapcontext, which is currently unsupported. ↵Nick Lewycky2015-03-271-1/+1
| | | | | | Patch by Alexey Samsonov! llvm-svn: 233413
* [LSan] Don't explicitly exclude LSan from Windows build - it should just ↵Alexey Samsonov2015-03-251-6/+2
| | | | | | produce dummy object files. NFC. llvm-svn: 233231
* asan: optimization experimentsDmitry Vyukov2015-03-175-39/+112
| | | | | | | | | | | | | | | | | | | | The experiments can be used to evaluate potential optimizations that remove instrumentation (assess false negatives). Instead of completely removing some instrumentation, you set Exp to a non-zero value (mask of optimization experiments that want to remove instrumentation of this instruction). If Exp is non-zero, this pass will emit special calls into runtime (e.g. __asan_report_exp_load1 instead of __asan_report_load1). These calls make runtime terminate the program in a special way (with a different exit status). Then you run the new compiler on a buggy corpus, collect the special terminations (ideally, you don't see them at all -- no false negatives) and make the decision on the optimization. The exact reaction to experiments in runtime is not implemented in this patch. It will be defined and implemented in a subsequent patch. http://reviews.llvm.org/D8198 llvm-svn: 232501
* [ASan/Win] Fix a CHECK failure when an exception is thrown from a callback ↵Timur Iskhodzhanov2015-03-171-40/+30
| | | | | | | | passed to BindIoCompletionCallback This also simplifies how we handle QueueUserWorkItem llvm-svn: 232499
* [ASan] NFC: Factor out platform-specific interceptorsTimur Iskhodzhanov2015-03-165-125/+130
| | | | | | Reviewed at http://reviews.llvm.org/D8321 llvm-svn: 232377
OpenPOWER on IntegriCloud