summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common
Commit message (Collapse)AuthorAgeFilesLines
* Symbolizer refactoring: Unify access to symbolizer tools from POSIXSymbolizerKuba Brecka2015-03-032-80/+50
| | | | | | Reviewed at http://reviews.llvm.org/D8029 llvm-svn: 231162
* Symbolizer refactoring: Turn FillAddressAndModuleInfo into FillModuleInfoKuba Brecka2015-03-035-12/+7
| | | | | | Reviewed at http://reviews.llvm.org/D8020 llvm-svn: 231061
* Symbolizer refactoring: Make LibbacktraceSymbolizer adopt the SymbolizerTool ↵Kuba Brecka2015-03-023-49/+46
| | | | | | | | interface Reviewed at http://reviews.llvm.org/D7971 llvm-svn: 231032
* Symbolizer refactoring: ExtractToken and friendsKuba Brecka2015-03-025-39/+89
| | | | | | Reviewed at http://reviews.llvm.org/D7867 llvm-svn: 231027
* Symbolizer refactoring: Move internals to separate filesKuba Brecka2015-03-027-234/+282
| | | | | | Reviewed at http://reviews.llvm.org/D7972 llvm-svn: 231014
* [Sanitizer] Fix StripPathPrefix function and improve test case.Alexey Samsonov2015-03-021-6/+6
| | | | llvm-svn: 230986
* asan: fix windows build after commit 230978Dmitry Vyukov2015-03-021-0/+17
| | | | llvm-svn: 230980
* asan: fix signal handling during stoptheworldDmitry Vyukov2015-03-026-4/+129
| | | | | | | | | | | The problem is that without SA_RESTORER flag, kernel ignores the handler. So tracer actually did not setup any handler. Add SA_RESTORER flag when setting up handlers. Add a test that causes SIGSEGV in stoptheworld callback. Move SignalContext from asan to sanitizer_common to print better diagnostics about signal in the tracer thread. http://reviews.llvm.org/D8005 llvm-svn: 230978
* Revert r229678 "tsan: fix signal handling during stop-the-world"Hans Wennborg2015-02-281-42/+50
| | | | | | | This was causing Chromium's browser_tests to flakily segfault during leak check. llvm-svn: 230874
* Symbolizer refactoring: SymbolizerTool and better interfaceKuba Brecka2015-02-282-60/+87
| | | | | | Reviewed at: http://reviews.llvm.org/D7936 llvm-svn: 230842
* [compiler-rt] Symbolizer refactoring: Abstract SymbolizerProcess betterKuba Brecka2015-02-272-43/+38
| | | | | | Reviewed at http://reviews.llvm.org/D7889 llvm-svn: 230749
* [compiler-rt] Allow suppression file to be relative to the location of the ↵Anna Zaks2015-02-276-4/+77
| | | | | | | | | | executable The ASanified executable could be launched from different locations. When we cannot find the suppression file relative to the current directory, try to see if the specified path is relative to the location of the executable. llvm-svn: 230723
* [Sanitizer] Print column number in SUMMARY line if it's available.Alexey Samsonov2015-02-273-23/+22
| | | | llvm-svn: 230721
* Fix >80 line after r230530.Kuba Brecka2015-02-251-1/+2
| | | | llvm-svn: 230541
* [compiler-rt] Symbolizer refactoring: Move SymbolizerProcess interface to headerKuba Brecka2015-02-252-183/+194
| | | | | | Reviewed at http://reviews.llvm.org/D7868 llvm-svn: 230530
* [compiler-rt] Symbolizer refactoring: Move string parsing into separate ↵Kuba Brecka2015-02-251-46/+65
| | | | | | | | functions Reviewed at http://reviews.llvm.org/D7869 llvm-svn: 230529
* Address post-commit feedback on r230344: Don't use weak hooks on Sanitizer ↵Timur Iskhodzhanov2015-02-251-1/+1
| | | | | | Go build for Windows llvm-svn: 230507
* [ASan/Win] Add support for sanitizer allocator hooks, __asan_default_options ↵Timur Iskhodzhanov2015-02-241-1/+1
| | | | | | and __asan_on_error llvm-svn: 230344
* Allow sanitizer to work with "old" kernel headersRenato Golin2015-02-243-1/+16
| | | | | | | | | | | | | | Sanitizers work on ancient kernels and were depending on types existing. When those types were removed, the sanitizer build broke. See bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59009 for more information. This patch fixes it by isolating the need for those types only when the feature is actually needed, thus allowing one to compile the kernel with or without that change, irrespective of its version. Patch by Christophe Lyon. llvm-svn: 230324
* Try to unbreak sanitizer-x86_64-linux-autoconf after r230318Kuba Brecka2015-02-241-0/+1
| | | | | | | | | | The buildbot failed to build with error: variable ‘enable_fp’ set but not used [-Werror=unused-but-set-variable] let's add a `(void)enable_fp;`. llvm-svn: 230323
* Fix the ASan ioctl.cc test when using COMPILER_RT_DEBUG=OnKuba Brecka2015-02-241-0/+6
| | | | | | | | | | In debug mode (COMPILER_RT_DEBUG=On), we still build with -fomit-frame-pointer and wrap_ioctl doesn't set up a proper stack frame. In release mode it does, because ioctl_common_pre gets inlined into wrap_ioctl and it uses the COMMON_INTERCEPTOR_READ_RANGE macro which in the end calls GET_CURRENT_FRAME and that forces the compiler to generate a stack frame for the function. Not having a proper stack frame breaks the unwinder. This patch forces to generate a frame pointer (via ENABLE_FRAME_POINTER macro). Reviewed at http://reviews.llvm.org/D7815 llvm-svn: 230318
* [ASan] Disable strict init-order checking if dlopen() is called.Alexey Samsonov2015-02-241-0/+6
| | | | | | | | | | | | | | | | Revise the fix to https://code.google.com/p/address-sanitizer/issues/detail?id=178: always disable strict init-order checking the first time dlopen() is called: at this point shared library is allowed to access globals defined in the main executable, as they are guaranteed to be initialized. Revise the test cases: * simplify init-order-dlopen.cc test case: make it Linux-specific (there's no strict init-order checking on other platforms anyway), and single-threaded. * reinforce init-order-pthread-create.cc test case: make sure that init-order checker would produce a false positive unless we turn it off at the moment we call pthread_create(). llvm-svn: 230288
* Unix/BSD system calls are prefixed with SYS_ on FreeBSD and MacIsmail Pazarbasi2015-02-221-2/+2
| | | | | | | | Also, __syscall form should be used when one or more of the parameters is a 64-bit argument to ensure that argument alignment is correct. llvm-svn: 230183
* [Sanitizer] Refactor SuppressionContext class.Alexey Samsonov2015-02-204-157/+85
| | | | | | | | | | | | | | SuppressionContext is no longer a singleton, shared by all sanitizers, but a regular class. Each of ASan, LSan, UBSan and TSan now have their own SuppressionContext, which only parses suppressions specific to that sanitizer. "suppressions" flag is moved away from common flags into tool-specific flags, so the user now may pass ASAN_OPTIONS=suppressions=asan_supp.txt LSAN_OPIONS=suppressions=lsan_supp.txt in a single invocation. llvm-svn: 230026
* [Sanitizer] Remove multiline comment to silence GCC warning. NFC.Alexey Samsonov2015-02-201-2/+1
| | | | llvm-svn: 229948
* [sanitizer] when dumping the basic block trace, also dump the module names. ↵Kostya Serebryany2015-02-201-5/+18
| | | | | | Patch by Laszlo Szekeres llvm-svn: 229940
* [Sanitizer] Drop LibIgnore dependency on SuppressionContext. NFC.Alexey Samsonov2015-02-192-21/+14
| | | | | | | | Let each LibIgnore user (for now it's only TSan) manually go through SuppressionContext and pass ignored library templates to LibIgnore. llvm-svn: 229924
* [Sanitizer] Move TemplateMatch() to sanitizer_common.cc. NFC.Alexey Samsonov2015-02-194-44/+43
| | | | llvm-svn: 229923
* [Sanitizers] Move the common sanitizer interface from ↵Timur Iskhodzhanov2015-02-194-37/+62
| | | | | | | | sanitizer_internal_defs.h to a new sanitizer_interface_internal.h file Reviewed at http://reviews.llvm.org/D7758 llvm-svn: 229858
* tsan: fix PTRACE_ATTACH handling during stop-the-worldDmitry Vyukov2015-02-191-18/+32
| | | | | | | | | | | | | | | | | | | If the thread receives a signal concurrently with PTRACE_ATTACH, we can get notification about the signal before notification about stop. In such case we need to forward the signal to the thread, otherwise the signal will be missed (as we do PTRACE_DETACH with arg=0) and any logic relying on signals will break. After forwarding we need to continue to wait for stopping, because the thread is not stopped yet. We do ignore delivery of SIGSTOP, because we want to make stop-the-world as invisible as possible. http://reviews.llvm.org/D7723 --This line, and those below, will be ignored-- M lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc M test/tsan/signal_segv_handler.cc llvm-svn: 229832
* [LSan] [MIPS] adding support of LSan for mips64/mips64el archMohit K. Bhakkad2015-02-196-5/+63
| | | | | | | | | | | | Patch by Sagar Thakur Reviewers: petarj, earthdok, kcc. Subscribers: samsonov, dsanders, mohit.bhakkad, Anand.Takale, llvm-commits. Differential Revision: http://reviews.llvm.org/D7013 llvm-svn: 229830
* tsan: fix signal handling during stop-the-worldDmitry Vyukov2015-02-181-50/+42
| | | | | | | | | | 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. http://reviews.llvm.org/D7722 llvm-svn: 229678
* tsan: add -Wno-maybe-uninitialized to mingw gcc build flagsDmitry Vyukov2015-02-181-1/+1
| | | | | | | As per discussion with David Blaikie here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150216/260289.html llvm-svn: 229657
* [MSan][MIPS] Fix for some failing tests on MIPS64Mohit K. Bhakkad2015-02-184-7/+20
| | | | | | | | | | | | | | 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
* Revert "Remove support for building sanitizers from Makefile/autoconf build."Matthias Braun2015-02-171-0/+22
| | | | | | | | | This reverts commit r229556. Reverting this for now as internal apple builds rely on this functionality. llvm-svn: 229585
* Silence an MSVC warning about testing a function for truth without calling itReid Kleckner2015-02-171-1/+1
| | | | | | | | | In general, this is a reasonable warning, except real_pthread_create is weak and can be null. The existing usage is correct as it the function is declared with SANITIZER_WEAK, but MSVC can't know that because it is defined to nothing on Windows. llvm-svn: 229562
* Remove support for building sanitizers from Makefile/autoconf build.Alexey Samsonov2015-02-171-22/+0
| | | | | | | | They autotools build has a number of missing features, supports less OS, architectures, build configurations, doesn't have any tests and is hard to support in sync with CMake build. llvm-svn: 229556
* Remove inclusion of netinet/ip_compat.h for FreeBSD. This header is notDimitry Andric2015-02-171-1/+0
| | | | | | | | | | | | | always available, and nothing in sanitizer_platform_limits_posix.cc uses any of its definitions. See also: https://svnweb.freebsd.org/changeset/base/277201 Reviewers: kcc, kutuzov.viktor.84, samsonov Reviewed By: samsonov Differential Revision: http://reviews.llvm.org/D7486 llvm-svn: 229518
* tsan: fix freebsd buildDmitry Vyukov2015-02-161-0/+2
| | | | | | GetTls is not defined in Go mode. llvm-svn: 229395
* tsan: fix compiler warningDmitry Vyukov2015-02-161-1/+1
| | | | | | | | mingw gcc complains: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized] Printf("Failed to read options from '%s': error %d\n", value, err); llvm-svn: 229392
* tsan: exclude DumpProcessMap on windowsDmitry Vyukov2015-02-161-0/+2
| | | | | | | The function uses EnumProcessModules, which requires psapi.lib, which is not linked with tsan on windows. llvm-svn: 229390
* [Sanitizer] Add "final" specifier to FlagHandlerBase::Parse overrides. NFC.Alexey Samsonov2015-02-122-2/+2
| | | | llvm-svn: 228893
* [Sanitizers] The MAP_NORESERVE define has been removed in FreeBSD 11.x,Dimitry Andric2015-02-111-0/+7
| | | | | | | | | and even before that, it was never implemented. Just define it to zero instead, so compiler-rt can compile on FreeBSD 11 and later. Differential Revision: http://reviews.llvm.org/D7485 llvm-svn: 228871
* [ASan/Win] NFC, just minor simplification of the codeTimur Iskhodzhanov2015-02-101-2/+2
| | | | llvm-svn: 228702
* [ASan/Win] Add the executable's directory to the symbol search pathTimur Iskhodzhanov2015-02-101-19/+53
| | | | | | This should fix symbolization in those cases when the .exe file is moved together with the .pdb llvm-svn: 228701
* [compiler-rt] Make MaybeReexec properly process DYLD_INSERT_LIBRARIES when ↵Kuba Brecka2015-02-062-0/+10
| | | | | | | | | | | | using non-absolute paths MaybeReexec() in asan_mac.cc checks for presence of the ASan dylib in DYLD_INSERT_LIBRARIES, and if it is there, it will process this env. var. and remove the dylib from its value, so that spawned children don't have this variable set. However, the current implementation only works when using a canonical absolute path to the dylib, it fails to remove the dylib for example when using @executable_path. This patch changes the processing of DYLD_INSERT_LIBRARIES to comparing values only based on filenames (ignoring directories). Reviewed at http://reviews.llvm.org/D7160 llvm-svn: 228392
* [Msan] Fix the pthread_attr_get unit test to build on FreeBSDViktor Kutuzov2015-02-041-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D7342 llvm-svn: 228125
* [sanitizer] add another workaround for PR 17409: when over a threshold emit ↵Kostya Serebryany2015-02-041-0/+5
| | | | | | coverage instrumentation as calls. llvm-svn: 228102
* [ASan] Add use_madv_dontdump flag.Yury Gribov2015-02-034-1/+16
| | | | | | Differential Revision: http://reviews.llvm.org/D7294 llvm-svn: 227959
* [Sanitizer] Fix checking for weak function presence.Alexey Samsonov2015-02-021-2/+2
| | | | llvm-svn: 227851
OpenPOWER on IntegriCloud