summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-12-13Use the newer python syntax for exceptionsJustin Bogner
We've dropped support for python 2.5, so now we can use the forward compatible "except ... as" syntax. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224181 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12[Sanitizer] Introduce Allocator::may_return_null bool flag.Alexey Samsonov
Summary: Turn "allocator_may_return_null" common flag into an Allocator::may_return_null bool flag. We want to make sure that common flags are immutable after initialization. There are cases when we want to change this flag in the allocator at runtime: e.g. in unit tests and during ASan activation on Android. Test Plan: regression test suite, real-life applications Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6623 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224148 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12[Asan] XFAIL the interception_failure_test.cc test on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D6591 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224117 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12[Asan] Fix the tsd_dtor_leak.cc test to pass on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D6590 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224116 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12[mips] [test] Enable COMPILER_RT_INCLUDE_TESTS for MIPSKumar Sukhani
Enabling COMPILER_RT_INCLUDE_TESTS and updating tests/sanitizer_allocator_test.cc to remove Allocator64 related tests for MIPS. Reviewed By: samsonov git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224101 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-12[ASan] Group all flag parsing code together. NFC.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224087 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11[ASan] Change fake stack and local variables handling.Alexey Samsonov
This commit changes the way we get fake stack from ASan runtime (to find use-after-return errors) and the way we represent local variables: - __asan_stack_malloc function now returns pointer to newly allocated fake stack frame, or NULL if frame cannot be allocated. It doesn't take pointer to real stack as an input argument, it is calculated inside the runtime. - __asan_stack_free function doesn't take pointer to real stack as an input argument. Now this function is never called if fake stack frame wasn't allocated. - __asan_init version is bumped to reflect changes in the ABI. - new flag "-asan-stack-dynamic-alloca" allows to store all the function local variables in a dynamic alloca, instead of the static one. It reduces the stack space usage in use-after-return mode (dynamic alloca will not be called if the local variables are stored in a fake stack), and improves the debug info quality for local variables (they will not be described relatively to %rbp/%rsp, which are assumed to be clobbered by function calls). This flag is turned off by default for now, but I plan to turn it on after more testing. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224063 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11[Sanitizer] Don't modify mmap_limit_mb flag in runtime.Alexey Samsonov
Instead, rely on the fact that RAW_CHECK doesn't call mmap(), and we'll be able to print an error message and kill a program. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224034 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11[Sanitizer] Fix report_path functionality:Alexey Samsonov
Summary: - Make sure mmap() is never called inside RawWrite function. - Wrap a bunch of standalone globals in a ReportFile object. - Make sure accesses to these globals are thread-safe. - Fix report_path functionality on Windows, where __sanitizer_set_report_path() would break program. I've started this yak shaving in order to make "CommonFlags::mmap_limit_mb" immutable. Currently we drop this flag to zero before printing an error message. Test Plan: regression test suite Reviewers: kcc, glider Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6595 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224031 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11[Tsan] Fix the signal_recursive.cc test to pass on systems with high loadsViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D6504 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224030 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11tsan: fix Go buildDmitry Vyukov
GetRSS is used in Go build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224023 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11tsan: don't subtract one from fake PCsDmitry Vyukov
These are fake and not actual PCs, more like function IDs. Pass them to external symbolizer untouched. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224022 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-11Fix check-asan on Windows by putting lib/clang/... onto PATH (PR21880)Timur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224018 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-10Update ASan/Win test expectations broken by r223508Timur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223932 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-10[sanitizer] Disable compile-time checks for __kernel_old_uid_t size on aarch64.Evgeniy Stepanov
Should fix PR21476. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223925 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-10builtins: cleanup constant data section selectionSaleem Abdulrasool
Each of the object formats use a different directive for selecting the constant section. Use a macro to avoid the duplication across a number of files. Also correct a small macro mismatch on the Windows case (HIDDEN_DIRECTIVE -> HIDDEN). Patch by Vadim Chugunov! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223910 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-10[DD] Don't store the second copy of CommonFlags inside DDFlags.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223909 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-10[CMake] Make sure dd is built as a part of compiler-rt.Alexey Samsonov
Remove unused variables and definitions in CMake files for TSan and DD (deadlock detector). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223908 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09profile: Add low level versions of profile buffer functionsJustin Bogner
On Darwin, compiler_rt uses magic linker symbols to find the profile counters in the __DATA segment. This is a reasonable method for normal, hosted, userspace programs. However programs with custom memory layouts, such as the kernel, will need to tell compiler_rt explicitly where to find these sections. Patch by Lawrence D'Anna. Thanks! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223840 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09[tsan] remove TSAN_GO in favor of SANITIZER_GOKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223732 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09[asan] move GetRSS from tsan to sanitizer_commonKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223730 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08Update bogus file permissions.Alexey Samsonov
Suggested in http://reviews.llvm.org/D6547. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223715 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08[msan] Intercept wcsto*.Evgeniy Stepanov
Intercept wcstod, wcstof, wcstold, wcstol, wcstoul, wcstoll, wcstoull. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223650 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05XFAILing suppression tests on Android. The suppression files are not being ↵Kuba Brecka
transfered to the device. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223540 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05Recommit of r223513 and r223514.Kuba Brecka
Reviewed at http://reviews.llvm.org/D6488 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223533 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05Reverting r223513 and r223514.Kuba Brecka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223519 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05[DFSAN][MIPS] adding support of DFSAN for MIPS64Peter Collingbourne
Minor changes to enable DFSAN on MIPS64 Patch by Kumar Sukhani! Differential Revision: http://reviews.llvm.org/D6437 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223517 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05AddressSanitizer - Don't instrument globals from cstring_literals sections. ↵Kuba Brecka
(compiler-rt part) Reviewed at http://reviews.llvm.org/D6488 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223514 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05Implement AddressSanitizer suppressions.Kuba Brecka
Adds 3 new suppression types, "interceptor_name", "interceptor_via_fun", "interceptor_via_lib". Reviewed at http://reviews.llvm.org/D6280. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223508 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05[ASan] Refactor thread starting code.Sergey Matveev
Move thread context creation into AsanThread::Create(). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223483 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05[LSan] Rewrite the test from r223419 to not use C++11.Sergey Matveev
This was causing build failures on llvm-clang-lld-x86_64-centos-6.5 for some reason. Anyway, the new way is better because we no longer rely on std::thread implementation details. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223480 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05[ASan] Fix Win build following r223419.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223477 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05tsan: fix testDmitry Vyukov
this test is flaky because of ASLR app memory is 7e8000000000-800000000000, there may or may not be a 1TB hole depending on where ASLR will choose to map libraries git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223469 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05tsan: protect trace memory range on startupDmitry Vyukov
so that user does not map something there ahead of us git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223456 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05[ASan, LSan] Improve tracking of thread creation.Sergey Matveev
In the current scheme of things, the call to ThreadStart() in the child thread is not synchronized with the parent thread. So, if a pointer is passed to pthread_create, there may be a window of time during which this pointer will not be discoverable by LSan. I.e. the pthread_create interceptor has already returneed and thus the pointer is no longer on the parent stack, but we don't yet know the location of the child stack. This has caused bogus leak reports (see http://llvm.org/bugs/show_bug.cgi?id=21621/). This patch makes the pthread_create interceptor wait until the child thread is properly registered before returning. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223419 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-04CMake: build DLLs in the right directory and include them in the 'install' ↵Hans Wennborg
target (PR21719) When CMake builds a dynamic library on Windows, the .dll file's location is determined by the RUNTIME_OUTPUT_DIRECTORY, which we were previously not setting. This means for example that clang_rt.asan_dynamic-i386.dll will get built and installed in the same directory as the corresponding .lib file, instead of being built in the bin/ directory and not installed at all. Differential Revision: http://reviews.llvm.org/D6508 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223387 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-04[msan] Put the coverage files for coverage-levels.cc into a temporary dir.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223355 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03[msan] allow -fsanitize-coverage=N together with -fsanitize=memory, ↵Kostya Serebryany
compiler-rt part git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223314 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03ASan CMakeLists.txt: fix bad indent; NFCHans Wennborg
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223258 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03[msan] Change the way origin ids are built.Evgeniy Stepanov
Previously, all origin ids were "chained" origins, i.e values of ChainedOriginDepot. This added a level of indirection for simple stack and heap allocation, which were represented as chains of length 1. This costs both RAM and CPU, but provides a joined 2**29 origin id space. It also made function (any instrumented function) entry non-async-signal-safe, but that does not really matter because memory stores in track-origins=2 mode are not async-signal-safe anyway. With this change, the type of the origin is encoded in origin id. See comment in msan_origin.h for more details. This reduces chained and stack origin id range to 2**28 each, but leaves extra 2**31 for heap origins. This change should not have any user-visible effects. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223233 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03[asan] Fix stale_stack_leak.cc test in ASan-UAR mode.Evgeniy Stepanov
This test does an intentional use-after-return, but this is not the focus of the test, so ignore it. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223230 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03[msan] Add one more test for the handling of stack origins.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223229 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03[msan] Re-enable one test.Evgeniy Stepanov
It has been fixed a long time ago. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223226 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03[asan] fix four asan tests to run in use-after-return mode Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223181 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02Replace InternalScopedBuffer<char> with InternalScopedString where applicable.Alexey Samsonov
Summary: No functionality change. Test Plan: make check-all Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6472 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223164 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02Add missing #include to fix Android build.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223157 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02Simplify Symbolizer::SymbolizePC() interface.Alexey Samsonov
Return a linked list of AddressInfo objects, instead of using an array of these objects as an output parameter. This simplifies the code in callers of this function (especially TSan). Fix a few memory leaks from internal allocator, when the returned AddressInfo objects were not properly cleared. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223145 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02[Tsan] Fix the atomic_race.cc test to pass on systems with high loadsViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D6478 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223122 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-02[Tsan] Do not flush all streams on exitViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D6462 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223121 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-01Add override specifiers to Symbolizer methods. NFC.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223094 91177308-0d34-0410-b5e6-96231b3b80d8