summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-11-10[XRay][darwin] Initial XRay in Darwin SupportDean Michael Berris
Summary: This change implements the changes required in both clang and compiler-rt to allow building XRay-instrumented binaries in Darwin. For now we limit this to x86_64. We also start building the XRay runtime library in compiler-rt for osx. A caveat to this is that we don't have the tests set up and running yet, which we'll do in a set of follow-on changes. This patch uses the monorepo layout for the coordinated change across multiple projects. Reviewers: kubamracek Subscribers: mgorny, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D39114 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[esan] Fix compilation of signal handlersVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317874 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[tsan] Use __sanitizer_siginfo from sanitizer_commonVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317872 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[sanitizer] Remove unused <signal.h> which conflicts with asan declarationsVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[sanitizer] Forward declaration of __sanitizer_sigaction without signal ↵Vitaly Buka
interceptors git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[sanitizer] Remove unneeded forward declaration of real_sigactionVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[sanitizer] Remove unneeded forward declarationsVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[sanitizer] Remove unused <signal.h> which conflicts with asan declarationsVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[sanitizer] Fix "cast from 'const void *' to 'sigaction *'" on DarwinVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317866 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[sanitizer] Remove references and hide CommonSanitizerReportMutexVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[msan] Deadly signal handler for msanVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D39826 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[msan] Move sigaction_impl and signal_implVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[libFuzzer] trying to make sigusr tests more reliableKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10[libFuzzer] split a test into two Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[sanitizer] Remove unneeded "struct"Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317847 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[sanitizer] Fix signal interceptors build on WindowsVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317846 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[msan] Extract signal_impl and sigaction_implVitaly Buka
Summary: Preparation for using interceptor from sanitizer_common. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39824 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[sanitizer] Allow sanitizers to redefine implementation of signal interceptorsVitaly Buka
Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D39870 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[msan] Replace CommonSanitizerReportMutex with ScopedErrorReportLockVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[libFuzzer] use pkill instead of killall in a test since the bots don't have ↵Kostya Serebryany
killall git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[libFuzzer] make sure to flush IO when done merging one fileKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317835 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[sanitizer] Revert rL317822Kostya Kortchinsky
Summary: This reverts D39490. For toolchains generated with older NDKs (<=r13b as far as we tested), `cpu_set_t` doesn't exist in `sched.h`. We have to figure out another way to get the number of CPUs without this. Reviewers: rnk Reviewed By: rnk Subscribers: kubamracek, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D39867 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317834 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[libFuzzer] Don't add leaking inputs to corpus.Matt Morehouse
Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39850 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317831 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[libFuzzer] handle SIGUSR1/SIGUSR2 and try to exit grafully on these signalsKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317829 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09Revert new ThinLTO ASAN test until lit support addedTeresa Johnson
This reverts commit r317723 and r317728. Will be re-added when support for LTO/ThinLTO added to test/asan/lit.cfg. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317823 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[scudo] Make getNumberOfCPUs Fuchsia compliantKostya Kortchinsky
Summary: This change allows Fuchsia to boot properly using the Scudo allocator. Reviewers: cryptoad, alekseyshl, krytarowski Reviewed By: cryptoad, krytarowski Subscribers: rnk, krytarowski, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D39490 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317822 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[Builtins] Do not use tailcall for Thumb1Weiming Zhao
Summary: The `b` instruction in Thumb1 has limited range, which may cause link-time errors if the jump target is far away. This patch guards the tailcalls for non-Thumb1 Reviewers: peter.smith, compnerd, rengolin, eli.friedman Reviewed By: rengolin Subscribers: joerg, dalias, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D39700 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317814 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[PowerPC][msan] Update msan to handle changed memory layouts in newer kernelsBill Seurer
In more recent Linux kernels (including those with 47 bit VMAs) the layout of virtual memory for powerpc64 changed causing the memory sanitizer to not work properly. This patch adjusts the memory ranges in the tables for the memory sanitizer to work on the newer kernels while continuing to work on the older ones as well. Tested on several 4.x and 3.x kernel releases. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317802 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[sanitizers] Rename GetStackTraceWithPcBpAndContextVitaly Buka
Name does not need to enumerate arguments. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317774 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[msan] Add context argument into GetStackTraceVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317773 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[lsan] Add "static" to internal functionVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317772 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[libFuzzer] allow merge to resume after being preempted Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317767 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09ubsan: Allow programs to use setenv to configure ubsan_standalone.Peter Collingbourne
Previously ubsan_standalone used the GetEnv function to read the environment variables UBSAN_OPTIONS and UBSAN_SYMBOLIZER_PATH. The problem with GetEnv is that it does not respect changes to the environment variables made using the libc setenv function, which prevents clients from setting environment variables to configure ubsan before loading ubsan-instrumented libraries. The reason why we have GetEnv is that some runtimes need to read environment variables while they initialize using .preinit_array, and getenv does not work while .preinit_array functions are being called. However, it is unnecessary for ubsan_standalone to initialize that early. So this change switches ubsan_standalone to using getenv and removes the .preinit_array entry. The static version of the runtime still ends up being initialized using a C++ constructor that exists to support the shared runtime. Differential Revision: https://reviews.llvm.org/D39827 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317757 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[libFuzzer] mechanically simplify a test, NFCKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317756 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[libFuzzer] fix a test (and hopefully, the bot)Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317749 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[libFuzzer] allow user to specify the merge control fileKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317747 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08[Sanitizers, CMake] Also use version script for libclang_rt.asan-i386.soEvgeniy Stepanov
When building LLVM on x86_64-pc-linux-gnu (Fedora 25) with the bundled gcc 6.4.1 which uses gld 2.26.1-1.fc25, the dynamic/Asan-i386-calls-Dynamic-Test and dynamic/Asan-i386-inline-Dynamic-Test tests failed to link with /usr/bin/ld: /var/scratch/gcc/llvm/dist/lib/clang/6.0.0/lib/linux/libclang_rt.asan-i386.so: fork: invalid version 21 (max 0) /var/scratch/gcc/llvm/dist/lib/clang/6.0.0/lib/linux/libclang_rt.asan-i386.so: error adding symbols: Bad value I tried building with a self-compiled gcc 7.1.0 using gld 2.28, but the error remained. It seems the error has been hit before (cf. https://reviews.llvm.org/rL314085), but no real explanation has been found. However, the problem goes away when linking the i386 libclang_rt.asan with a version script just like every other variant is. Not using the version script in this single case dates back to the initial introduction of the version script in r236551, but this change was just checked in without any explanation AFAICT. Since I've not found any other workaround and no reason for not always using the version script, I propose to do so. Tested on x86_64-pc-linux-gnu. Patch by Rainer Orth. Differential Revision: https://reviews.llvm.org/D39795 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317738 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08Correct atexit(3) support in TSan/NetBSDKamil Rytarowski
Summary: The NetBSD specific implementation of cxa_atexit() does not preserve the 2nd argument if dso is equal to NULL. Changes: - Split paths of handling intercepted __cxa_atexit() and atexit(3). This affects all supported Operating Systems. - Add a local stack-like structure to hold the __cxa_atexit() context. atexit(3) is documented in the C standard as calling callback from the earliest to the oldest entry. This path also fixes potential ABI problem of passing an argument to a function from the atexit(3) callback mechanism. - Add new test to ensure LIFO style of atexit(3) callbacks: atexit3.cc Proposal to change the behavior of __cxa_atexit() in NetBSD has been rejected. With the above changes TSan/NetBSD with the current tsan_interceptors.cc can bootstrap into operation. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, dvyukov, joerg, kcc, eugenis Reviewed By: dvyukov Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D39619 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317735 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08[ThinLTO] New test needs to require LTOTeresa Johnson
Fix buildbot failures: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/5262/steps/annotate/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08[ThinLTO] Ensure sanitizer passes are runTeresa Johnson
Recommit new test as linux-only. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317723 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08Revert "[ThinLTO] Ensure sanitizer passes are run"Teresa Johnson
This reverts commit r317715. It failed a Windows buildbot since ThinLTO is presumably not supported, leading to a corrupt file error on the object file: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/19395/steps/run%20check-asan/logs/stdio Will re-commit the new ThinLTO part of the test to a linux only test file. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317717 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08[ThinLTO] Ensure sanitizer passes are runTeresa Johnson
Summary: Test fix to pass manager for ThinLTO. Depends on D39565. Reviewers: pcc Subscribers: kubamracek, mehdi_amini, llvm-commits, inglorion Differential Revision: https://reviews.llvm.org/D39566 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317715 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08Implement flock for Windows in compiler-rtMarco Castelluccio
Summary: This patch implements flock for Windows, needed to make gcda writing work in a multiprocessing scenario. Fixes https://bugs.llvm.org/show_bug.cgi?id=34923. Reviewers: zturner Reviewed By: zturner Subscribers: rnk, zturner, llvm-commits Differential Revision: https://reviews.llvm.org/D38891 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317705 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08[sanitizer] Add Scudo to the sanitizer lint checks.Kostya Kortchinsky
Summary: Scudo abides by the coding style enforced by the sanitizer_common linter, but as of right now, it's not linter-enforced. Add Scudo to the list of directories checked by check_lint.sh. Also: fixes some linter errors found after getting this running. Reviewers: cryptoad Reviewed By: cryptoad Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D39757 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317699 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08Always use prctl(PR_SET_PTRACER)Sylvestre Ledru
Summary: Sufficiently old Linux kernel headers don't provide the PR_SET_PTRACER, but we can still call prctl with it if the runtime kernel is newer. Even if it's not, prctl will only return EINVAL. Patch by Mike Hommey <mh-llvm@glandium.org> Reviewers: eugenis Reviewed By: eugenis Subscribers: sylvestre.ledru, cfe-commits, kubamracek Differential Revision: https://reviews.llvm.org/D39717 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317668 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08Revert "[scudo] Make getNumberOfCPUs Fuchsia compliant"Reid Kleckner
This reverts commit r317604. Android doesn't have cpu_set_t. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317655 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08[sanitizer] Asm implementation of syscall() for arm32.Evgeniy Stepanov
Summary: These will be used in an ifunc resolver, when the binary may not be completely relocated, and syscall() function from libc could not be used. Reviewers: dvyukov, vitalybuka Subscribers: aemerson, kubamracek, javed.absar, llvm-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D39701 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317640 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07(NFC) Rename GetMax{,User}VirtualAddress.Evgeniy Stepanov
Future change will introduce GetMaxVirtualAddress that will not take the kernel area into account. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317638 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07[sanitizer] Fix sanitizer_common compile errors on gcc trunkVitaly Buka
Summary: When testing a merge of compiler-rt r304709 into gcc trunk on x86-64-pc-linux-gnu, I ran into two compile errors: sanitizer_common/sanitizer_symbolizer_libbacktrace.cc:96:73: error: no matching function for call to '__sanitizer::AddressInfo::FillModuleInfo(char*&, __sanitizer::uptr&)' All other files in sanitizer_common (with the exception of sanitizer_malloc_mac.inc which is special) include sanitizer_platform.h without directory name. Patch by Mike Jongen Reviewers: kcc, vitalybuka Reviewed By: kcc Subscribers: kubamracek, fedor.sergeev, llvm-commits Differential Revision: https://reviews.llvm.org/D33933 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317608 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07[scudo] Make getNumberOfCPUs Fuchsia compliantKostya Kortchinsky
Summary: This change allows Fuchsia to boot properly using the Scudo allocator. Reviewers: cryptoad, alekseyshl, krytarowski Reviewed By: cryptoad, krytarowski Subscribers: krytarowski, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D39490 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317604 91177308-0d34-0410-b5e6-96231b3b80d8