summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Creating branches/google/testing and tags/google/testing/2017-11-14 from r317716google/testingDavid L. Jones2017-11-1531-95/+398
|\ | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/google/testing@318248 91177308-0d34-0410-b5e6-96231b3b80d8
| * [ThinLTO] Ensure sanitizer passes are runTeresa Johnson2017-11-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Implement flock for Windows in compiler-rtMarco Castelluccio2017-11-081-3/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * [sanitizer] Add Scudo to the sanitizer lint checks.Kostya Kortchinsky2017-11-084-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Always use prctl(PR_SET_PTRACER)Sylvestre Ledru2017-11-081-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Revert "[scudo] Make getNumberOfCPUs Fuchsia compliant"Reid Kleckner2017-11-086-40/+8
| | | | | | | | | | | | | | | | 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
| * [sanitizer] Asm implementation of syscall() for arm32.Evgeniy Stepanov2017-11-082-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * (NFC) Rename GetMax{,User}VirtualAddress.Evgeniy Stepanov2017-11-0711-11/+11
| | | | | | | | | | | | | | 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
| * [sanitizer] Fix sanitizer_common compile errors on gcc trunkVitaly Buka2017-11-072-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * [scudo] Make getNumberOfCPUs Fuchsia compliantKostya Kortchinsky2017-11-076-8/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * [WebAssembly] Include GENERIC_TF_SOURCES in wasm buildsSam Clegg2017-11-071-2/+6
| | | | | | | | | | | | Differential Revision: https://reviews.llvm.org/D39748 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317601 91177308-0d34-0410-b5e6-96231b3b80d8
| * tsan: allow usage of global vars with ctors in interceptorsDmitry Vyukov2017-11-071-13/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We allow usage of global/per-thread data with non-trivial ctors/dtors throughout tsan code base by placing all global/per-thread data into Context/ThreadState and then explicitly constructing them with placement new. This greatly simplifies code by restricting the "linker initialized plague" to only these 2 objects. Do the same for interceptors data. This allows to use Vector instead of bunch of hand-written code in: https://reviews.llvm.org/D39619 Reviewed in: https://reviews.llvm.org/D39721 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317587 91177308-0d34-0410-b5e6-96231b3b80d8
| * Update sanitizer_allocator to use new API.Kostya Kortchinsky2017-11-075-21/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * [LSan] Detect dynamic loader by its base address.Alex Shlyapnikov2017-11-064-22/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * [Sanitizers] Check pthread_setcancel{state|type} interceptor arguments for ↵Alex Shlyapnikov2017-11-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | != 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
| * Fix CMake definitions of tsan runtime to make it installed by ↵Mehdi Amini2017-11-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | "install-compiler-rt" Summary: The PARENT_TARGET was correctly set under APPLE but not under linux. Reviewers: kubamracek, samsonov Subscribers: dberris, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D39621 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317391 91177308-0d34-0410-b5e6-96231b3b80d8
| * [scudo] Rearrange #include orderKostya Kortchinsky2017-11-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To be compliant with https://llvm.org/docs/CodingStandards.html#include-style, system headers have to come after local headers. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39623 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317390 91177308-0d34-0410-b5e6-96231b3b80d8
| * [Sanitizers] Call NanoTime() conditionally.Alex Shlyapnikov2017-11-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Late fixup in _lwp_exit on TSan/NetBSDKamil Rytarowski2017-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Call DestroyThreadState() before REAL(_lwp_exit)(); This variation is less racy. Sponsored by <The NetBSD Foundation> git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317369 91177308-0d34-0410-b5e6-96231b3b80d8
| * Correct detection of a thread terminationKamil Rytarowski2017-11-031-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Stop using the Linux solution with pthread_key_create(3). This approach does not work on NetBSD, because calling the thread destructor is not the latest operation on a POSIX thread entity. NetBSD's libpthread still calls at least pthread_mutex_lock and pthread_mutex_unlock. Detect _lwp_exit(2) call as it is really the latest operation called from a detaching POSIX thread. This resolves one set of crashes observed in the Thread Sanitizer execution. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, vitalybuka, dvyukov, eugenis Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D39618 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317363 91177308-0d34-0410-b5e6-96231b3b80d8
| * Disable detection of on_exit()/TSan on NetBSDKamil Rytarowski2017-11-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD does not ship with on_exit() function. Introduce TSAN_MAYBE_INTERCEPT_ON_EXIT. It looks like this addition fixes build for Darwin. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg, eugenis, dvyukov, kcc Reviewed By: vitalybuka Subscribers: llvm-commits, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D39617 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317361 91177308-0d34-0410-b5e6-96231b3b80d8
* | Creating branches/google/testing and tags/google/testing/ from r317203David L. Jones2017-11-101289-10614/+37098
|\ \ | |/ | | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/google/testing@317856 91177308-0d34-0410-b5e6-96231b3b80d8
| * [fuzzer] Fix nested mallocsVitaly Buka2017-11-021-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Nested mallocs are possible with internal symbolizer. Reviewers: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39397 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317186 91177308-0d34-0410-b5e6-96231b3b80d8
| * [fuzzer] Script to detect unbalanced allocation in -trace_malloc outputVitaly Buka2017-11-012-0/+120
| | | | | | | | | | | | | | | | | | | | Reviewers: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39466 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317119 91177308-0d34-0410-b5e6-96231b3b80d8
| * [scudo] Fix standlone build -lrt requirementKostya Kortchinsky2017-11-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The split in D39461 introduced separate C++ flags, but `cxx_flags` needs `-lrt` as well for the standalone build. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39497 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317103 91177308-0d34-0410-b5e6-96231b3b80d8
| * [scudo] Implement stricter separation of C vs C++Kostya Kortchinsky2017-11-0121-49/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Initially, Scudo had a monolithic design where both C and C++ functions were living in the same library. This was not necessarily ideal, and with the work on -fsanitize=scudo, it became more apparent that this needed to change. We are splitting the new/delete interceptor in their own C++ library. This allows more flexibility, notably with regard to std::bad_alloc when the work is done. This also allows us to not link new & delete when using pure C. Additionally, we add the UBSan runtimes with Scudo, in order to be able to have a -fsanitize=scudo,undefined in Clang (see work in D39334). The changes in this patch: - split the cxx specific code in the scudo cmake file into a new library; (remove the spurious foreach loop, that was not necessary) - add the UBSan runtimes (both C and C++); - change the test cmake file to allow for specific C & C++ tests; - make C tests pure C, rename their extension accordingly. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: srhines, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D39461 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317097 91177308-0d34-0410-b5e6-96231b3b80d8
| * [fuzzer] Fix threaded stack printingVitaly Buka2017-11-013-0/+63
| | | | | | | | | | | | | | | | | | | | Reviewers: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39397 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317071 91177308-0d34-0410-b5e6-96231b3b80d8
| * Revert "[fuzzer] Fix threaded stack printing and nested mallocs"Vitaly Buka2017-11-015-197/+0
| | | | | | | | | | | | | | | | | | | | | | Fails on darwin Revert "[fuzzer] Script to detect unbalanced allocation in -trace_malloc output" Needs previous one. This reverts commit r317034, r317036. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317061 91177308-0d34-0410-b5e6-96231b3b80d8
| * [fuzzer] Script to detect unbalanced allocation in -trace_malloc outputVitaly Buka2017-10-312-0/+120
| | | | | | | | | | | | | | | | | | | | Reviewers: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39466 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317036 91177308-0d34-0410-b5e6-96231b3b80d8
| * [fuzzer] Fix threaded stack printing and nested mallocsVitaly Buka2017-10-313-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Nested mallocs are possible with internal symbolizer. Reviewers: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39397 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317034 91177308-0d34-0410-b5e6-96231b3b80d8
| * [sanitizer][Fuchsia] Add a missing semicolonPetr Hosek2017-10-301-1/+1
| | | | | | | | | | | | 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
| * Fix warning + death test + failing test on Windows (D39072).Kostya Kortchinsky2017-10-302-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * [sanitizer] Fixing an error introduced in D39072Kostya Kortchinsky2017-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Introduce ReservedAddressRange to sanitizer_common.Kostya Kortchinsky2017-10-305-0/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix clang warnings in winasan codeReid Kleckner2017-10-301-3/+3
| | | | | | | | | | | | 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
| * [asan] Intercept heap routines in VS2010 CRTReid Kleckner2017-10-301-0/+1
| | | | | | | | | | | | | | Users have requested that we add it to the list: https://github.com/google/sanitizers/issues/864 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316929 91177308-0d34-0410-b5e6-96231b3b80d8
| * [XRay] [compiler-rt] fix build by including errno.h into FDR modeMartin Pelikan2017-10-281-0/+1
| | | | | | | | | | | | The build got broken after D39277 (and rL316816) deleted <cerrno>. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316821 91177308-0d34-0410-b5e6-96231b3b80d8
| * [XRay][compiler-rt] Remove more STL dependenices from FDR modeDean Michael Berris2017-10-272-53/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change removes dependencies on STL types: - std::aligned_storage -- we're using manually-aligned character buffers instead for metadata and function records. - std::tuple -- use a plain old struct instead. This is an incremental step in removing all STL references from the compiler-rt implementation of XRay (llvm.org/PR32274). Reviewers: dblaikie, pelikan, kpw Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39277 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316816 91177308-0d34-0410-b5e6-96231b3b80d8
| * [scudo] Allow to specify the maximum number of TSDs at compile timeKostya Kortchinsky2017-10-272-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This introduces `SCUDO_MAX_CACHES` allowing to define an upper bound to the number of `ScudoTSD` created in the Shared TSD model (by default 32U). This name felt clearer than `SCUDO_MAX_TSDS` which is technically what it really is. I am opened to suggestions if that doesn't feel right. Additionally change `getNumberOfCPUs` to return a `u32` to be more consistent. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39338 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316788 91177308-0d34-0410-b5e6-96231b3b80d8
| * [LSan] Disable a couple of failing tests on PPC64 (pending investigation).Alex Shlyapnikov2017-10-272-2/+2
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316720 91177308-0d34-0410-b5e6-96231b3b80d8
| * [LSan] Enable LSan tests on PPC64 Linux.Alex Shlyapnikov2017-10-263-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: LSan is functional on PPC64 Linux now, let's enable all tests. One test required ppc specific changes: use_registers.cc. Reviewers: eugenis Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D39316 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316698 91177308-0d34-0410-b5e6-96231b3b80d8
| * [Sanitizers] Set default allocator_release_to_os_interval_ms to 5 secondsAlex Shlyapnikov2017-10-262-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * [sanitizer] Fix internal symbolized build on Debian 9Vitaly Buka2017-10-261-2/+2
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316637 91177308-0d34-0410-b5e6-96231b3b80d8
| * [LSan] Adjust LSan allocator limits for PPC64.Alex Shlyapnikov2017-10-261-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Now the limits are the same as for ASan allocator. Reviewers: cryptoad Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39309 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316633 91177308-0d34-0410-b5e6-96231b3b80d8
| * [libFuzzer] trying to make a test more stable on MacKostya Serebryany2017-10-251-1/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316627 91177308-0d34-0410-b5e6-96231b3b80d8
| * [scudo] Remove comment about security of the 32-bit allocatorKostya Kortchinsky2017-10-251-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The 32-bit allocator is now on par with the 64-bit in terms of security (chunks randomization is done, batches separation is done). Unless objection, the comment can go away. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39303 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316620 91177308-0d34-0410-b5e6-96231b3b80d8
| * [msan] Intercept __strxfrm_l.Evgeniy Stepanov2017-10-253-2/+43
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316613 91177308-0d34-0410-b5e6-96231b3b80d8
| * Try to unbreak Linux sanitizersKamil Rytarowski2017-10-252-0/+6
| | | | | | | | | | | | | | | | 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
| * [sanitizer] Random shuffling of chunks for the 32-bit Primary AllocatorKostya Kortchinsky2017-10-254-26/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * [Sanitizers] ASan: detect new/delete calls with mismatched alignment.Alex Shlyapnikov2017-10-2510-87/+298
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASan allocator stores the requested alignment for new and new[] calls and on delete and delete[] verifies that alignments do match. The representable alignments are: default alignment, 8, 16, 32, 64, 128, 256 and 512 bytes. Alignments > 512 are stored as 512, hence two different alignments > 512 will pass the check (possibly masking the bug), but limited memory requirements deemed to be a resonable tradeoff for relaxed conditions. The feature is controlled by new_delete_type_mismatch flag, the same one protecting new/delete matching size check. Differential revision: https://reviews.llvm.org/D38574 Issue: https://github.com/google/sanitizers/issues/799 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316595 91177308-0d34-0410-b5e6-96231b3b80d8