summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common
AgeCommit message (Collapse)Author
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[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[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[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-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
2017-11-07Update sanitizer_allocator to use new API.Kostya Kortchinsky
Summary: Update sanitizer_allocator to use new API. Second patch in a series. First patch https://reviews.llvm.org/D39072 Updates MmapNoAccess / MmapFixed call sites in the saniziter_allocator to use the new Init/Map APIs instead. Reviewers: alekseyshl, cryptoad, phosek, mcgrathr, dvyukov Reviewed By: alekseyshl, cryptoad Subscribers: dvyukov, mcgrathr, kubamracek Differential Revision: https://reviews.llvm.org/D38592 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317586 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-06[LSan] Detect dynamic loader by its base address.Alex Shlyapnikov
Summary: Relanding D38600, which was reverted due to various PPC bot failures. If it breaks something again, please provide some pointers to broken bots, not just revert it, otherwise it's very hard to reason what's wrong with this commit. Whenever possible (Linux + glibc 2.16+), detect dynamic loader module by its base address, not by the module name matching. The current name matching approach fails on some configurations. Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D39275 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317512 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-06[Sanitizers] Check pthread_setcancel{state|type} interceptor arguments for ↵Alex Shlyapnikov
!= nullptr. Summary: According to man, pthread_setcancelstate's oldstate and pthread_setcanceltype's oldtype parameters can be nullptr. Check these parameters for != nullptr before attempting to access their shadow memory. Reviewers: dvyukov Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D39626 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317494 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-03[Sanitizers] Call NanoTime() conditionally.Alex Shlyapnikov
Summary: Call NanoTime() in primary 64 bit allocator only when necessary, otherwise the unwarranted syscall causes problems in sandbox environments. ReleaseToOSIntervalMs() conditional allows them to turn the feature off with allocator_release_to_os_interval_ms=-1 flag. Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D39624 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317386 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-30[sanitizer][Fuchsia] Add a missing semicolonPetr Hosek
Differential Revision: https://reviews.llvm.org/D39433 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316959 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-30Fix warning + death test + failing test on Windows (D39072).Kostya Kortchinsky
Summary: Fixes https://reviews.llvm.org/D39072 Reviewers: cryptoad Reviewed By: cryptoad Subscribers: kubamracek Differential Revision: https://reviews.llvm.org/D39427 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316943 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-30[sanitizer] Fixing an error introduced in D39072Kostya Kortchinsky
Summary: This should fix the Windows bots after D39072. Reviewers: alekseyshl, flowerhack Reviewed By: flowerhack Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D39426 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316937 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-30Introduce ReservedAddressRange to sanitizer_common.Kostya Kortchinsky
Summary: Fixed version of https://reviews.llvm.org/D38437 (fixes Win/Fuchsia failures). Creating a new revision, since the old one was getting a bit old/crowded. In Fuchsia, MmapNoAccess/MmapFixedOrDie are implemented using a global VMAR, which means that MmapNoAccess can only be called once. This works for the sanitizer allocator but *not* for the Scudo allocator. Hence, this changeset introduces a new ReservedAddressRange object to serve as the new API for these calls. In this changeset, the object still calls into the old Mmap implementations. The next changeset two changesets will convert the sanitizer and scudo allocators to use the new APIs, respectively. (ReservedAddressRange will replace the SecondaryHeader in Scudo.) Finally, a last changeset will update the Fuchsia implementation. Reviewers: alekseyshl, cryptoad, phosek Reviewed By: alekseyshl, cryptoad Subscribers: kubamracek Differential Revision: https://reviews.llvm.org/D39072 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316934 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-30Fix clang warnings in winasan codeReid Kleckner
There are two instances of -Wcast-qual and one of -Wsign-compare. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316930 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-26[Sanitizers] Set default allocator_release_to_os_interval_ms to 5 secondsAlex Shlyapnikov
Summary: With new release to OS approach (see D38245) it's reasonable to enable it by default. Setting allocator_release_to_os_interval_ms to 5000 seems to be a reasonable default (might be tuned later, based on the feedback). Also delaying the first release to OS in each bucket for at least allocator_release_to_os_interval_ms after the first allocation to prevent just allocated memory to be madvised back to OS and let short lived processes to avoid release to OS overhead altogether. Reviewers: cryptoad Subscribers: kubamracek, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D39318 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316683 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-26[sanitizer] Fix internal symbolized build on Debian 9Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316637 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-25Try to unbreak Linux sanitizersKamil Rytarowski
Add fallback definition of internal_syscall_ptr and internal_syscall64 for Linux/x86_64 and Linux/aarch64. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316598 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-25[sanitizer] Random shuffling of chunks for the 32-bit Primary AllocatorKostya Kortchinsky
Summary: The 64-bit primary has had random shuffling of chunks for a while, this implements it for the 32-bit primary. Scudo is currently the only user of `kRandomShuffleChunks`. This change consists of a few modifications: - move the random shuffling functions out of the 64-bit primary to `sanitizer_common.h`. Alternatively I could move them to `sanitizer_allocator.h` as they are only used in the allocator, I don't feel strongly either way; - small change in the 64-bit primary to make the `rand_state` initialization `UNLIKELY`; - addition of a `rand_state` in the 32-bit primary's `SizeClassInfo` and shuffling of chunks when populating the free list. - enabling the `random_shuffle.cpp` test on platforms using the 32-bit primary for Scudo. Some comments on why the shuffling is done that way. Initially I just implemented a `Shuffle` function in the `TransferBatch` which was simpler but I came to realize this wasn't good enough: for chunks of 10000 bytes for example, with a `CompactSizeClassMap`, a batch holds only 1 chunk, meaning shuffling the batch has no effect, while a region is usually 1MB, eg: 104 chunks of that size. So I decided to "stage" the newly gathered chunks in a temporary array that would be shuffled prior to placing the chunks in batches. The result is looping twice through n_chunks even if shuffling is not enabled, but I didn't notice any significant significant performance impact. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: srhines, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D39244 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316596 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-25Add NetBSD improvements in sanitizersKamil Rytarowski
Summary: Changes: * Add initial msan stub support. * Handle NetBSD specific pthread_setname_np(3). * NetBSD supports __attribute__((tls_model("initial-exec"))), define it in SANITIZER_TLS_INITIAL_EXEC_ATTRIBUTE. * Add ReExec() specific bits for NetBSD. * Simplify code and add syscall64 and syscall_ptr for !NetBSD. * Correct bunch of syscall wrappers for NetBSD. * Disable test/tsan/map32bit on NetBSD as not applicable. * Port test/tsan/strerror_r to a POSIX-compliant OSes. * Disable __libc_stack_end on NetBSD. * Disable ReadNullSepFileToArray() on NetBSD. * Define struct_ElfW_Phdr_sz, detected missing symbol by msan. * Change type of __sanitizer_FILE from void to char. This helps to reuse this type as an array. Long term it will be properly implemented along with SANITIZER_HAS_STRUCT_FILE setting to 1. * Add initial NetBSD support in lib/tsan/go/buildgo.sh. * Correct referencing stdout and stderr in tsan_interceptors.cc on NetBSD. * Document NetBSD x86_64 specific virtual memory layout in tsan_platform.h. * Port tests/rtl/tsan_test_util_posix.cc to NetBSD. * Enable NetBSD tests in test/msan/lit.cfg. * Enable NetBSD tests in test/tsan/lit.cfg. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis, kcc, dvyukov Reviewed By: dvyukov Subscribers: #sanitizers, llvm-commits, kubamracek Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D39124 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316591 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-23[Sanitizers] Add total primary allocator RSS to allocator report.Alex Shlyapnikov
Summary: . Reviewers: cryptoad Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D39131 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316356 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-23[Sanitizers] New sanitizer API to purge allocator quarantine.Alex Shlyapnikov
Summary: Purging allocator quarantine and returning memory to OS might be desired between fuzzer iterations since, most likely, the quarantine is not going to catch bugs in the code under fuzz, but reducing RSS might significantly prolong the fuzzing session. Reviewers: cryptoad Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D39153 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316347 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-15[asan] Increase kHandlerStackSize for TracerThreadSignalHandlerVitaly Buka
4096 is not enough on some platform, e.g. Debian 4.9.0-3-amd64 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315844 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-13[Sanitizers] Add more details to ASan allocator stats report.Alex Shlyapnikov
Summary: . Reviewers: cryptoad Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D38834 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315730 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-12Revert r315533 "Reland "[sanitizer] Introduce ReservedAddressRange to ↵Hans Wennborg
sanitizer_common"" The SanitizerCommon.ReservedAddressRangeUnmap test fails on Windows: FAIL: SanitizerCommon-Unit :: ./Sanitizer-x86_64-Test.exe/SanitizerCommon.ReservedAddressRangeUnmap (34003 of 35554) ******************** TEST 'SanitizerCommon-Unit :: ./Sanitizer-x86_64-Test.exe/SanitizerCommon.ReservedAddressRangeUnmap' FAILED ******************** Note: Google Test filter = SanitizerCommon.ReservedAddressRangeUnmap [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from SanitizerCommon [ RUN ] SanitizerCommon.ReservedAddressRangeUnmap ==3780==ERROR: SanitizerTool failed to deallocate 0x1000 (4096) bytes at address 0x0000000c3000 (error code: 487) ==3780==Sanitizer CHECK failed: E:\b\build\slave\win_upload_clang\build\src\third_party\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc:129 (("unable to unmap" && 0)) != (0) (0, 0) ******************** Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. Testing Time: 299.76s ******************** Failing Tests (1): SanitizerCommon-Unit :: ./Sanitizer-x86_64-Test.exe/SanitizerCommon.ReservedAddressRangeUnmap > In Fuchsia, MmapNoAccess/MmapFixedOrDie are implemented using a global > VMAR, which means that MmapNoAccess can only be called once. This works > for the sanitizer allocator but *not* for the Scudo allocator. > > Hence, this changeset introduces a new ReservedAddressRange object to > serve as the new API for these calls. In this changeset, the object > still calls into the old Mmap implementations. > > The next changeset two changesets will convert the sanitizer and scudo > allocators to use the new APIs, respectively. (ReservedAddressRange will > replace the SecondaryHeader in Scudo.) > > Finally, a last changeset will update the Fuchsia implementation. > > Patch by Julia Hansbrough > > Differential Revision: https://reviews.llvm.org/D38437 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315553 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-11Reland "[sanitizer] Introduce ReservedAddressRange to sanitizer_common"Petr Hosek
In Fuchsia, MmapNoAccess/MmapFixedOrDie are implemented using a global VMAR, which means that MmapNoAccess can only be called once. This works for the sanitizer allocator but *not* for the Scudo allocator. Hence, this changeset introduces a new ReservedAddressRange object to serve as the new API for these calls. In this changeset, the object still calls into the old Mmap implementations. The next changeset two changesets will convert the sanitizer and scudo allocators to use the new APIs, respectively. (ReservedAddressRange will replace the SecondaryHeader in Scudo.) Finally, a last changeset will update the Fuchsia implementation. Patch by Julia Hansbrough Differential Revision: https://reviews.llvm.org/D38437 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315533 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-11[sanitizer] Move the errno/ENOMEM allocator checks logic to separate .ccKostya Kortchinsky
Summary: This is a new attempt at D38706, which had 2 issues. The first one was that it broke TSan, because `sanitizer_errno.h` was not directly included in `tsan_mman.cc`. This fixes the include. The second one was that it broke the nolibc build, because `__errno_location` couldn't be found. This adds the new .cc to the libcdep list instead of the base one. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: kubamracek, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D38743 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315509 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-11Revert "[sanitizer] Introduce ReservedAddressRange to sanitizer_common"Petr Hosek
This reverts commit r315493 which is failing to build on sanitizer-windows. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315494 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-11[sanitizer] Introduce ReservedAddressRange to sanitizer_commonPetr Hosek
In Fuchsia, MmapNoAccess/MmapFixedOrDie are implemented using a global VMAR, which means that MmapNoAccess can only be called once. This works for the sanitizer allocator but *not* for the Scudo allocator. Hence, this changeset introduces a new ReservedAddressRange object to serve as the new API for these calls. In this changeset, the object still calls into the old Mmap implementations. The next changeset two changesets will convert the sanitizer and scudo allocators to use the new APIs, respectively. (ReservedAddressRange will replace the SecondaryHeader in Scudo.) Finally, a last changeset will update the Fuchsia implementation. Patch by Julia Hansbrough Differential Revision: https://reviews.llvm.org/D38759 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315493 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10[sanitizer] Revert D38706Kostya Kortchinsky
Summary: D38706 breaks tsan and the nolibc build. Reverting while working on a fix. Reviewers: alekseyshl Subscribers: kubamracek, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D38739 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315320 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10[sanitizer] Move the errno/ENOMEM allocator checks logic to separate .ccKostya Kortchinsky
Summary: The fact that `sanitizer_allocator_checks.h` is including `sanitizer_errno.h` creates complications for future changes, where it would conflict with `errno.h` definitions on Android and Fuchsia (macro redefinition). By moving the portion that sets errno in the checks to a separate compilation unit, we avoid the inclusion of the header there, which solves the issue. Not that it is not vital to have that function in a header as it is called as a result of an unlikely event, and doesn't need to be inlined. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D38706 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315319 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-09[sanitizer] Don't intercept signal and sigaction on FuchsiaPetr Hosek
Fuchsia doesn't support signals, so don't use interceptors for signal or sigaction. Differential Revision: https://reviews.llvm.org/D38669 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315227 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-07Use list(APPEND) instead of append()Vedant Kumar
append() seems to be available with the version of cmake I'm using, but not on the bots: http://green.lab.llvm.org/green//job/clang-stage1-configure-RA/39354 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-07[ubsan] Add a static runtime on DarwinVedant Kumar
As a follow-up to r315142, this makes it possible to use ubsan with a static runtime on Darwin. I've also added a new StandaloneStatic testing configuration so the new setup can be tested. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315143 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05Revert "[LSan] Detect dynamic loader by its base address."Alex Shlyapnikov
This reverts commit r315024. Breaks sysconf_interceptor_bypass_test.cc git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315031 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05[LSan] Detect dynamic loader by its base address.Alex Shlyapnikov
Summary: Relanding D33859, which was reverted because it has "broken LOTS of ARM/AArch64 bots for two days". If it breaks something again, please provide some pointers to broken bots, not just revert it, otherwise it's very hard to reason what's wrong with this commit. Whenever possible (Linux + glibc 2.16+), detect dynamic loader module by its base address, not by the module name matching. The current name matching approach fails on some configurations. Reviewers: eugenis Subscribers: aemerson, kubamracek, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D38600 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315024 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-02Add support for custom loaders to the sanitizer symbolizerFrancis Ricci
Summary: Adds a fallback mode to procmaps when the symbolizer fails to locate a module for a given address by using dl_iterate_phdr. Reviewers: kubamracek, rnk, vitalybuka, eugenis Reviewed By: eugenis Subscribers: srhines, llvm-commits Differential Revision: https://reviews.llvm.org/D37269 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314713 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-02Revert "Add support for custom loaders to the sanitizer symbolizer"Francis Ricci
This reverts commit r314671, which hangs on the gcc sanitizer buildbot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314684 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-02Add support for custom loaders to the sanitizer symbolizerFrancis Ricci
Summary: Adds a fallback mode to procmaps when the symbolizer fails to locate a module for a given address by using dl_iterate_phdr. Reviewers: kubamracek, rnk, vitalybuka, eugenis Reviewed By: eugenis Subscribers: srhines, llvm-commits Differential Revision: https://reviews.llvm.org/D37269 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314671 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-29Move LoadedModule list to a NoCtor vector and initialize on demand.Francis Ricci
Unreverting this patch because llvm-clang-lld-x86_64-debian-fast started passing again before the revert hit. Must've been just a flake. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314556 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-29Revert "Move LoadedModule list to a NoCtor vector and initialize on demand."Francis Ricci
I think this may have introduced a failure on llvm-clang-lld-x86_64-debian-fast This reverts commit r314533 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314552 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-29Move LoadedModule list to a NoCtor vector and initialize on demand.Francis Ricci
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314533 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-29Add missing header definitionFrancis Ricci
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314521 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-29Remove recursion from FindModuleForAddress. NFC.Francis Ricci
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314520 91177308-0d34-0410-b5e6-96231b3b80d8