summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2016-01-30Fix build with VS2015Ismail Donmez
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259301 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29[profile] Support hostname expansion in LLVM_PROFILE_FILEVedant Kumar
This patch adds support for expanding "%h" out to the machine hostname in the LLVM_PROFILE_FILE environment variable. Patch by Daniel Waters! Differential Revision: http://reviews.llvm.org/D16371 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259272 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28[cfi] Simplify the code in CfiSlowPathCommon.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259085 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28Minor cleanup /NFCXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28[cfi] Fix recovery from out-of-bounds vtable error.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28GetArgv returns null on widnows, do not crashMike Aizatsky
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259005 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27using /system/bin/sh on android in tests.Mike Aizatsky
Subscribers: tberghammer, danalbert, srhines Differential Revision: http://reviews.llvm.org/D16654 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259001 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
2016-01-27[cfi] Disable vtable diagnostics when no cxxabi.Evgeniy Stepanov
This should fix the build on Mac 10.8 and earlier. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27[sanitizers] using execv instead of execve with null env.Mike Aizatsky
Differential Revision: http://reviews.llvm.org/D16646 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258983 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27[cfi] Fix gcc build.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27Sync up with master fileXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258890 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26[cfi] Exclude __cfi_slowpath_diag from the non-diag rtl.Evgeniy Stepanov
Calls to __cfi_slowpath_diag are only emitted when building with diagnostics, and linking the diag rtl. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258881 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26[cfi] Better handling of wild target address.Evgeniy Stepanov
This change enables diagnostics when the target address for a CFI check is out of bounds of any known library, or even not in the limits of the address space. This happens when casting pointers to uninitialized memory. Ubsan code does not yet handle some of these situations correctly, so it is still possible to see a segmentation fault instead of a proper diagnostic message once in a while. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258879 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26[sanitizers] execve & waitpid on mac.Mike Aizatsky
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26Remove autoconf support for building runtime libraries.Chris Bieneman
Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I am the punishment of God... If [autoconf] had not committed great sins, God would not have sent a punishment like me upon [it]." -Genghis Khan Reviewers: chandlerc, grosbach, bob.wilson, zaks.anna, kubabrecka, samsonov, echristo Subscribers: iains, llvm-commits Differential Revision: http://reviews.llvm.org/D16473 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258863 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26[cfi] Hide runtime implementation in a namespace.Evgeniy Stepanov
Move all internal stuff into namespace __cfi. Remove the double underscore prefix from anything that's now inside the namespace. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258859 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26[cfi] Support for dlopen and dlclose.Evgeniy Stepanov
Add dlopen/dlclose interceptors to update CFI shadow for loaded/unloaded libraries. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26[sanitizers] extracted process management functionsMike Aizatsky
Differential Revision: http://reviews.llvm.org/D16546 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25[cfi] Cross-DSO CFI diagnostic mode (compiler-rt part)Evgeniy Stepanov
* add __cfi_slowpath_diag with a 3rd parameter which is a pointer to the diagnostic info for the ubsan handlers. *__cfi_check gets a 3rd parameter as well. * unify vcall/cast/etc and icall diagnostic info format, and merge the handlers to have a single entry point (actually two points due to abort/noabort variants). * tests Note that this comes with a tiny overhead in the non-diag mode: cfi_slowpath must pass 0 as the 3rd argument to cfi_check. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258744 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25sync up InstrProfData.h -- typo fixXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25Revert "[sanitizers] extracted process management functions"Mike Aizatsky
This reverts commit e5b34d5a2bf4c882bc647dd26a8cea2adc76f63c. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258713 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25fixed clang-tidy configMike Aizatsky
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258711 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25[sanitizers] extracted process management functionsMike Aizatsky
Differential Revision: http://reviews.llvm.org/D16542 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258710 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25[asan] Don't use sysconf(_SC_PAGESIZE) on Android.Evgeniy Stepanov
This is broken in the current (post-MNC) master branch. Use EXEC_PAGESIZE instead, the same as on x86 Linux. This change fixes startup crashes in the existing tests on AOSP master. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-21.clang-tidy for sanitizer package to override root llvm styleMike Aizatsky
Summary: sanitizer-common follows Google code style, override clang-tidy config. Differential Revision: http://reviews.llvm.org/D16373 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20[MSan] Clear parameters shadow before invoking malloc/free hooks.Alexey Samsonov
MSan runtime is not itself instrumented, so we need to explicitly clear shadow for function arguments before calling user-provided functions from runtime (e.g. we already do this for several interceptors). I'm still crafting a test case that would demonstrate this issue reliably, and will commit it later today. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20[asan] print an additional hint when reporting a container overflowKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258337 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19using const instead of constexpr: MSVC troublesMike Aizatsky
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258253 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19[sancov] NFC: simplifying DumpOffsets.Mike Aizatsky
Summary: Extracting GetRangeOffset function before report-on-dump functionality. Differential Revision: http://reviews.llvm.org/D16332 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19Fix another -Wexpansion-to-defined warning in compiler-rt.Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19Fix -Wexpansion-to-defined warnings in compiler-rt.Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19tsan: add back __tls_get_addr interceptorDmitry Vyukov
Removal of the interceptor broke libtsan interface in gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68824 Add back a simple interceptor. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258119 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-18[asan] Optionally print reproducer cmdline in ASan reports.Maxim Ostapenko
Differential Revision: http://reviews.llvm.org/D16070 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258037 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17[tsan] Do nothing in ScopedInterceptor's destructor if thr is not inited.Yabin Cui
Summary: It is part of http://reviews.llvm.org/D15301, but missed when I committed that patch. Reviewers: kubabrecka, kcc, eugenis, llvm-commits, dvyukov Differential Revision: http://reviews.llvm.org/D16235 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258021 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-16Attempt to fix sanitizer-windows bot.Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257978 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-16[LSan] Ignore all allocations made inside pthread_create.Alexey Samsonov
Thread stack/TLS may be stored by libpthread for future reuse after thread destruction, and the linked list it's stored in doesn't even hold valid pointers to the objects, the latter are calculated by obscure pointer arithmetic. With this change applied, LSan test suite passes with "use_ld_allocations" flag defaulted to "false". It still requires more testing to check if the default can be switched. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-16Introduce stats and stats_client libraries.Peter Collingbourne
This is part of a new statistics gathering feature for the sanitizers. See clang/docs/SanitizerStats.rst for further info and docs. Differential Revision: http://reviews.llvm.org/D16176 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15[tsan] Fix some tiny errors.Yabin Cui
Summary: 1. Fix spell error for sigaction. 2. Make line_length <= 80. Reviewers: llvm-commits, eugenis, kcc, dvyukov Subscribers: tberghammer, danalbert, srhines Differential Revision: http://reviews.llvm.org/D16210 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15[tsan] Store the pointer to ThreadState in TLS slot on Android.Yabin Cui
Summary: 1. Android doesn't support __thread keyword. So allocate ThreadState dynamically and store its pointer in one TLS slot provided by Android. 2. On Android, intercepted functions can be called before ThreadState is initialized. So add test of thr_->is_inited in some places. 3. On Android, intercepted functions can be called after ThreadState is destroyed. So add a fake dead_thread_state to represent all destroyed ThreadStates. And that is also why we don't store the pointer to ThreadState in shadow memory of pthread_self(). Reviewers: kcc, eugenis, dvyukov Subscribers: kubabrecka, llvm-commits, tberghammer, danalbert, srhines Differential Revision: http://reviews.llvm.org/D15301 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15[tsan] Use internal_sigfillset to replace REAL(sigfillset).Yabin Cui
Summary: Android doesn't intercept sigfillset, so REAL(sigfillset) is null. And we can use internal_sigfillset() for all cases. Reviewers: kcc, eugenis, kubabrecka, dvyukov Subscribers: llvm-commits, tberghammer, danalbert Differential Revision: http://reviews.llvm.org/D15296 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257862 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15Unbreak Windows build.Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257860 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15sanitizer_common: C++ify the IntrusiveList iterator interface.Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14[LSan] Add "use_ld_allocations" flag to disable old way of DTLS handling.Alexey Samsonov
This flag allows to disable old way of determining dynamic TLS by filtering out allocations from dynamic linker. This will be eventually superseded by __tls_get_addr interceptor (see r257785), after we: 1) Test it in several supported environments 2) Deal with existing problems (currently we can't find a pointer to DTV which is calloc()-ed in pthread_create). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14[LSan] Use __tls_get_addr interceptor to keep track of dynamic TLS.Alexey Samsonov
Summary: We have a way to keep track of allocated DTLS segments: let's use it in LSan. Although this code is fragile and relies on glibc implementation details, in some cases it proves to be better than existing way of tracking DTLS in LSan: marking as "reachable" all memory chunks allocated directly by "ld". The plan is to eventually get rid of the latter, once we are sure it's safe to remove. Reviewers: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16164 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257785 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14Fix the cross compilation of unit tests. NFC (second attempt)Sumanth Gundapaneni
With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compiling environment, the unit tests fail to link. This patch does the following changes >Rename COMPILER_RT_TEST_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS to reflect the way it's used. >Add COMPILER_RT_TEST_COMPILER_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to build/compile the unit tests >Add COMPILER_RT_UNITTEST_LINKFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to link the unit tests (if needed) Differential Revision: http://reviews.llvm.org/D16165 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14[tsan] Introduce a "ignore_interceptors_accesses" optionKuba Brecka
On OS X, TSan already passes all unit and lit tests, but for real-world applications (even very simple ones), we currently produce a lot of false positive reports about data races. This makes TSan useless at this point, because the noise dominates real bugs. This introduces a runtime flag, "ignore_interceptors_accesses", off by default, which makes TSan ignore all memory accesses that happen from interceptors. This will significantly lower the coverage and miss a lot of bugs, but it eliminates most of the current false positives on OS X. Differential Revision: http://reviews.llvm.org/D15189 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257760 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14[tsan] Fix the value of PTHREAD_MUTEX_RECURSIVE for OS X and FreeBSDKuba Brecka
The value of the constant PTHREAD_MUTEX_RECURSIVE is not "1" on FreeBSD and OS X. Differential Revision: http://reviews.llvm.org/D16075 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14sync up with master fileXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257746 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14[Sanitizer] Pass proper values to DTLS_on_libc_memalign.Alexey Samsonov
Fix a surprising typo: the old code used to think that dynamic TLS segments were several times larger than they actually are. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257722 91177308-0d34-0410-b5e6-96231b3b80d8