summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-12-14[profile] Port the runtime to Solaris (retry)Vedant Kumar
This includes a few nice bits of refactoring (e.g splitting out the exclusive locking code into a common utility). Hopefully the Windows support is fixed now. Patch by Rainer Orth! Differential Revision: https://reviews.llvm.org/D40944 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320731 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14Revert "(HEAD -> master, origin/master, origin/HEAD) [profile] Port the ↵Vedant Kumar
runtime to Solaris" This reverts commit r320726. It looks like flock isn't available on Windows: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/21317/steps/build%20compiler-rt/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[profile] Port the runtime to SolarisVedant Kumar
This includes a few nice bits of refactoring (e.g splitting out the exclusive locking code into a common utility). Patch by Rainer Orth! Differential Revision: https://reviews.llvm.org/D40944 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320726 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[scudo] Disabling the interface test on armhfKostya Kortchinsky
Summary: I will investigate the breakage tomorrow, disable on armhf to turn the bots green over the night. http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15-full-sh/builds/2952/steps/ninja%20check%202/logs/FAIL%3A%20Scudo-armhf%3A%3A%20interface.cpp This is post https://reviews.llvm.org/D41128. Reviewers: alekseyshl Subscribers: aemerson, kristof.beyls, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D41218 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320665 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[XRay][compiler-rt] Coalesce calls to mprotect to reduce patching overheadDean Michael Berris
Summary: Before this change, XRay would conservatively patch sections of the code one sled at a time. Upon testing/profiling, this turns out to take an inordinate amount of time and cycles. For an instrumented clang binary, the cycles spent both in the patching/unpatching routine constituted 4% of the cycles -- this didn't count the time spent in the kernel while performing the mprotect calls in quick succession. With this change, we're coalescing the number of calls to mprotect from being linear to the number of instrumentation points, to now being a lower constant when patching all the sleds through `__xray_patch()` or `__xray_unpatch()`. In the case of calling `__xray_patch_function()` or `__xray_unpatch_function()` we're now doing an mprotect call once for all the sleds for that function (reduction of at least 2x calls to mprotect). Reviewers: kpw, eizan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41153 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320664 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14Set of corrections for MSan/NetBSDKamil Rytarowski
Summary: Changes: - Don't attempt to intercept GLIBC specific functions like __strtol_internal. This is required to stop intercepting it as we leak dlerror(3) for dlsym(3) that cannot manage to find a symbol. - Correct interception of fstatat(2). - Don't run a test for fgetgrent_r() that is missing on NetBSD. - Correct link_map location (offset) in Obj_Entry on x86_64 and i386. - Stop intercepting getpshared-like functions in pthread(3). This is feature is not enabled by default on NetBSD as it's unfinished. - Switch intercepting from UTMP to UTMPX functions. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis, kcc Reviewed By: vitalybuka Subscribers: llvm-commits, srhines, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41053 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320663 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[asan] Use linker initialization for the allocatorKuba Mracek
This saves ~2 MB of dirty memory footprint. Can be a big deal on mobile devices especially when running multiple processes with ASan. Differential Revision: https://reviews.llvm.org/D40627 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320660 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[sanitizer] Use MADV_FREE on Darwin/BSD to release pages to the OSKuba Mracek
MADV_DONTNEED on Linux actually mark the pages as free to be overwritten with zeroes, but on Darwin and BSD, it's just an advisory flag (the OS cannot discard the content). We should use MADV_FREE on Darwin and BSD. Differential Revision: https://reviews.llvm.org/D40666 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320659 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[libFuzzer] Add dummy call of LLVMFuzzerTestOneInput to afl_driver.Matt Morehouse
Summary: Add dummy call of LLVMFuzzerTestOneInput to afl_driver before it starts executing on actual inputs. Do this so that first time initialization performed by LLVMFuzzerTestOneInput is not considered code covered by a particular input. Patch By: metzman Reviewers: kcc, morehouse Reviewed By: kcc Subscribers: llvm-commits, Sanitizers Differential Revision: https://reviews.llvm.org/D41193 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320643 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[scudo] Adding a public Scudo interfaceKostya Kortchinsky
Summary: The first and only function to start with allows to set the soft or hard RSS limit at runtime. Add associated tests. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: mgorny, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D41128 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320611 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[sanitizer] Introduce a vDSO aware timing functionKostya Kortchinsky
Summary: See D40657 & D40679 for previous versions of this patch & description. A couple of things were fixed here to have it not break some bots. Weak symbols can't be used with `SANITIZER_GO` so the previous version was breakin TsanGo. I set up some additional local tests and those pass now. I changed the workaround for the glibc vDSO issue: `__progname` is initialized after the vDSO and is actually public and of known type, unlike `__vdso_clock_gettime`. This works better, and with all compilers. The rest is the same. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D41121 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320594 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[scudo] Inline getScudoChunk function.Kostya Kortchinsky
Summary: getScudoChunk function is implicitly inlined for optimized builds on clang, but not on gcc. It's a small enough function that it seems sensible enough to just inline it by default. Reviewers: cryptoad, alekseyshl Reviewed By: cryptoad Differential Revision: https://reviews.llvm.org/D41138 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320592 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[XRay][compiler-rt] Reduce XRay log spamDean Michael Berris
This change makes XRay print the log file output only when the verbosity level is higher than 0. It reduces the log spam in the default case when we want XRay running silently, except when there are actual fatal/serious errors. We also update the documentation to show how to get the information after the change to the default behaviour. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320550 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[hwasan] Inline instrumentation & fixed shadow.Evgeniy Stepanov
Summary: This brings CPU overhead on bzip2 down from 5.5x to 2x. Reviewers: kcc, alekseyshl Subscribers: kubamracek, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D41137 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320538 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12[libFuzzer] change the strategy for -experimental_len_control to grow ↵Kostya Serebryany
max_len slower git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320531 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12[msan] LIT: Add lld testing configRoman Lebedev
Summary: A follow-up for D39508, with memory sanitizer changes. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Subscribers: mgorny, mehdi_amini, kcc, #sanitizers, llvm-commits Tags: #sanitizers, #lld Differential Revision: https://reviews.llvm.org/D40768 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320514 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12[CMake] Support runtimes and monorepo layouts when looking for libcxxPetr Hosek
This also slightly refactors the code that's checking the directory presence which allows eliminating one unnecessary variable. Differential Revision: https://reviews.llvm.org/D40637 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320446 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11[sanitizer] Revert rL320409Kostya Kortchinsky
Summary: D40679 broke a couple of builds, reverting while investigating. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D41088 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11[sanitizer] Introduce a vDSO aware time function, and use it in the ↵Kostya Kortchinsky
allocator [redo] Summary: Redo of D40657, which had the initial discussion. The initial code had to move into a libcdep file, and things had to be shuffled accordingly. `NanoTime` is a time sink when checking whether or not to release memory to the OS. While reducing the amount of calls to said function is in the works, another solution that was found to be beneficial was to use a timing function that can leverage the vDSO. We hit a couple of snags along the way, like the fact that the glibc crashes when clock_gettime is called from a preinit_array, or the fact that `__vdso_clock_gettime` is mangled (for security purposes) and can't be used directly, and also that clock_gettime can be intercepted. The proposed solution takes care of all this as far as I can tell, and significantly improve performances and some Scudo load tests with memory reclaiming enabled. @mcgrathr: please feel free to follow up on https://reviews.llvm.org/D40657#940857 here. I posted a reply at https://reviews.llvm.org/D40657#940974. Reviewers: alekseyshl, krytarowski, flowerhack, mcgrathr, kubamracek Reviewed By: alekseyshl, krytarowski Subscribers: #sanitizers, mcgrathr, srhines, llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D40679 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320409 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10Update another sanitizer test for C++14.Ahmed Bougacha
Follow-up to r320251. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320284 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09[libFuzzer] even less aggressive step function for stack depth. Also don't ↵Kostya Serebryany
use asan in one test to speed it up git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320259 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Update sanitizer tests for C++14 default in ClangTim Northover
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320251 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09[libFuzzer] make the stack depth signal less agressive, otherwise we are ↵Kostya Serebryany
sometimes exploding the corpus size. This still needs more analysis and tuning git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320237 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Revert change in test/msan/textdomain.cc for NetBSDKamil Rytarowski
SVN r. 320226 This breaks Linux. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320236 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Correct handling of the TLS/NetBSD block of the main programKamil Rytarowski
Summary: Include <sys/tls.h> for: - struct tls_tcb - thread control block structure - __HAVE___LWP_GETTCB_FAST - __lwp_gettcb_fast() is available - __HAVE___LWP_GETPRIVATE_FAST - __lwp_getprivate_fast() is available - __HAVE_TLS_VARIANT_I - TLS Variant I for this architecture - __HAVE_TLS_VARIANT_II - TLS Variant II for this architecture Rename ThreadSelfSegbase() to ThreadSelfTlsTcb and switch it to retrieve in a portable way TCB. Switch ThreadSelf() to retrieve pthread from struct tcb_tls. Use dl_iterate_phdr() to find out the size of TLS block of the main program. Correct the index of the TLS block of the main program (dlpi_tls_modid); it's 1, not 2. New NetBSD code is now CPU (NetBSD port) agnostic. Stop sharing the same code with FreeBSD. Sponsored by <The NetBSD Foundation> Reviewers: dvyukov, joerg, vitalybuka Reviewed By: vitalybuka Subscribers: emaste, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40159 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Hardware-assisted AddressSanitizer (compiler-rt)Evgeniy Stepanov
Summary: Runtime library for HWASan, initial commit. Does not randomize tags yet, does not handle stack or globals. Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, kubamracek, dberris, mgorny, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D40935 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320231 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Fix test/msan/iconv.cc on NetBSDKamil Rytarowski
Summary: NetBSD still uses the old POSIX iconv(3) signature with the 2nd const argument. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41017 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320228 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Fix test/msan/textdomain.cc on NetBSDKamil Rytarowski
Summary: This tests must be linked with -lintl for the gettext(3) features. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41013 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320226 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Disable test/msan/tsearch.cc on NetBSDKamil Rytarowski
Summary: This test uses GNU-specific extension to libc: tdestroy() and as-is is not compatible with NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41011 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320225 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Disable test/msan/pvalloc.cc on NetBSDKamil Rytarowski
Summary: The pvalloc(3) function is a non-standard extension missing on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41014 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320224 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Fix test/msan/ifaddrs.cc for NetBSDKamil Rytarowski
Summary: NetBSD requires to include <sys/socket.h> for struct sockaddr. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41015 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Disable test/msan/ftime.cc on NetBSDKamil Rytarowski
Summary: ftime(3) has been removed from libc/NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41018 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09NetBSD ships with POSIX strerror_r(3)Kamil Rytarowski
Summary: Switch NetBSD from GNU to the POSIX strerror_r(3) interceptor. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41019 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320221 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09Add NetBSD/x86_64 mapping in MSanKamil Rytarowski
Summary: Reuse the Linux new mapping as it is. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41023 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320218 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08[libFuzzer] Add support for Fuchsia OS.Matt Morehouse
Summary: This patch adds the initial support for Fuchsia. - LIBFUZZER_FUCHSIA is added as an OS type in FuzzerDefs.h - Fuchsia is, by design, not POSIX compliant. However, it does use ELF and supports common POSIX I/O functions. Thus, FuzzerExtFunctions.h and FuzzerIO.h are implemented by extending the header guards in FuzzerExtFunctionsWeak.cpp and FuzzerIOPosix.cpp to include LIBFUZZER_FUCHSIA. - The platform-specific portions of FuzzerUtil.h are implemented by FuzzerUtilFuchsia.cpp, which makes use of exception ports, syscalls, and the launchpad library. - The experimental equivalence server is not currently supported, so FuzzerShmem.h is implemented by stub methods in FuzzerShmemFuchsia.cpp. Any future implementation will likely involve VMOs. Tested with ASAN/SanCov on Fuchsia/x86-64 with the canonical toy fuzzer. Patch By: aarongreen Reviewers: kcc, morehouse, flowerhack, phosek Reviewed By: kcc, phosek, Eugene.Zelenko Subscribers: srhines, mgorny, Eugene.Zelenko Differential Revision: https://reviews.llvm.org/D40974 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320210 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08[libFuzzer] honor -use_counters, sligntly change the meaning of ↵Kostya Serebryany
-experimental_len_control, call UpdateFeatureFrequency only if instructed by the flag git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320205 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08Update test case for r320180Xinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320181 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08[scudo] Minor code generation improvementKostya Kortchinsky
Summary: It looks like clang was generating somewhat weird assembly with the current code. `FromPrimary`, even though `const`, was replaced every time with the code generated for `size <= SizeClassMap::kMaxSize` instead of using a variable or register, and `FromPrimary` didn't induce `ClassId != 0` for the compiler, so a dead branch was generated for `getActuallyAllocatedSize(Ptr, ClassId)` since it's never called for `ClassId = 0` (Secondary backed allocations) [this one was more wishful thinking on my side than anything else]. I rearranged the code bit so that the generated assembly is less clunky. Also changed 2 whitespace inconsistencies that were bothering me. Reviewers: alekseyshl, flowerhack Reviewed By: flowerhack Subscribers: llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D40976 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320160 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08[ubsan] Test for pass_object_size bounds checksVedant Kumar
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320129 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07[PowerPC][asan] Update asan to handle changed memory layouts in newer kernelsBill Seurer
In more recent Linux kernels with 47 bit VMAs the layout of virtual memory for powerpc64 changed causing the address sanitizer to not work properly. This patch adds support for 47 bit VMA kernels for powerpc64 and fixes up test cases. https://reviews.llvm.org/D40908 There is an associated patch for trunk. Tested on several 4.x and 3.x kernel releases. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320110 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07Test case update for D40873Xinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320105 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07[sanitizer] Simplify android_run.py.Evgeniy Stepanov
A test-only change to pass all *SAN_OPTIONS to the device without listing them individually. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319998 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06[libFuzzer] Decrease stack usage in unit testsKostya Serebryany
Summary: With 3 Dictionary objects, each containing space of ~16k DictionaryEntry objects, the MutationDispatcher object is fairly memory heavy. On platforms with a lower default stack size, this can cause panics in FuzzerUnittest as those tests stack-allocate the MutationDispatcher. This may be especially problematic for platforms that do not (yet) have a way to programmatically change their stack size, aside from link-time flags. In general, it seems more prudent to use the heap for an object of this size. Reviewers: kcc, morehouse Reviewed By: kcc Differential Revision: https://reviews.llvm.org/D40926 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319988 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06Update other SizeEnums to be of type uptr as wellVlad Tsyrklevich
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319984 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06Revert SVN r, 319967Kamil Rytarowski
"Correct atexit(3) support in MSan/NetBSD" This causes failures on Linux. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319981 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06Fix broken windows sanitizer buildbotVlad Tsyrklevich
r319875 caused a sign comparison build failure. Explicitly set the enum's type to be unsigned. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319977 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06[libFuzzer] fix a minor regression in printingKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319975 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06Correct atexit(3) support in MSan/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. - Allow usage of global vars with ctors in interceptors. This allows to use Vector without automatic cleaning up the structures. This code has been modeled after TSan implementation for the same functions. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40714 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319967 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06Handle NetBSD symbol renaming in msan_interceptors.ccKamil Rytarowski
Summary: NetBSD renames symbols for historical and compat reasons. Add required symbol renames in sanitizer_common_interceptors.inc: - gettimeofday -> __gettimeofday50 - getrusage -> __getrusage50 - shmctl -> __shmctl50 Additionally handle sigaction symbol mangling. Rename the function symbol in the file to SIGACTION_SYMNAME and define it as __sigaction14 for NetBSD and sigaction for !NetBSD. We cannot use simple renaming with the proprocessor, as there are valid fields named sigaction and they must be left intact. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka, dvyukov Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40766 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319966 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06[compiler-rt] Set up .arcconfig to point to new Diffusion CRT repositoryBen Hamilton
Summary: We want to automatically copy the appropriate mailing list as well as #sanitizers for review requests to the compiler-rt repository. For context, see the proposal and discussion here: http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html Similar to D40179, I set up a new Diffusion repository with callsign "CRT" for compiler-rt: https://reviews.llvm.org/source/compiler-rt/ This explicitly updates compiler-rt's .arcconfig to point to the new CRT repository in Diffusion, which will let us use Herald rules H270 and H271. Reviewers: krytarowski, joerg, dvyukov, vitalybuka, sammccall Reviewed By: sammccall Subscribers: dlj, bkramer, dberris, llvm-commits, sammccall, klimek, #sanitizers Differential Revision: https://reviews.llvm.org/D40498 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319954 91177308-0d34-0410-b5e6-96231b3b80d8