summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl
Commit message (Collapse)AuthorAgeFilesLines
...
* [TSan] Remove ignore_interceptors_accesses flagJulian Lettner2019-01-102-4/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: It has been superseded by the `ignore_noninstrumented_modules` flag and is no longer needed. Also simplify a test that checks that `mmap_interceptor` respects ignore annotations (`thr->ignore_reads_and_writes `). Relevant: https://reviews.llvm.org/rL269855 <rdar://problem/46263073> Remove obsolete Apple-specific suppression option Reviewers: dcoughlin, kubamracek, dvyukov, delcypher Reviewed By: dvyukov Subscribers: jfb, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55075 llvm-svn: 350883
* [sanitizer_common] Define __sanitizer_FILE on NetBSDMichal Gorny2019-01-101-10/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D56109 llvm-svn: 350882
* [TSan] Support Objective-C @synchronized with tagged pointersJulian Lettner2019-01-071-17/+31
| | | | | | | | | | | | | | | | | | | Summary: Objective-C employs tagged pointers, that is, small objects/values may be encoded directly in the pointer bits. The resulting pointer is not backed by an allocation/does not point to a valid memory. TSan infrastructure requires a valid address for `Acquire/Release` and `Mutex{Lock/Unlock}`. This patch establishes such a mapping via a "dummy allocation" for each encountered tagged pointer value. Reviewers: dcoughlin, kubamracek, dvyukov, delcypher Reviewed By: dvyukov Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D56238 llvm-svn: 350556
* [TSan] Enable detection of lock-order-inversions for Objective-C @synchronizedJulian Lettner2019-01-021-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: @synchronized semantics can be synthesized by using existing mutex_[un]lock operations. ``` @synchronized(obj) { // ... } => { mutex_lock(obj); // ... mutex_unlock(obj); } ``` Let me know whether you think this a good idea. Reviewers: dcoughlin, dvyukov, kubamracek, delcypher Reviewed By: dvyukov Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55959 llvm-svn: 350258
* [sanitizer_common] Implement popen, popenve, pclose interceptorsMichal Gorny2019-01-021-1/+2
| | | | | | | | | | | | | | | Implement the interceptors for popen(), pclose() and popenve() functions. The first two are POSIX, the third one is specific to NetBSD. popen() spawns a process and creates a FILE object piping data from/to that process. pclose() closes the pipe and waits for the process to terminate appropriately. For the purpose of popen(), the COMMON_INTERCEPTOR_FILE_OPEN macro is modified to allow null path parameter. Differential Revision: https://reviews.llvm.org/D56157 llvm-svn: 350232
* Introduce `AddressSpaceView` template parameter to `SizeClassAllocator64`.Dan Liew2018-12-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: This is a follow up patch to r349138. This patch makes a `AddressSpaceView` a type declaration in the allocator parameters used by `SizeClassAllocator64`. For ASan, LSan, and the unit tests the AP64 declarations have been made templated so that `AddressSpaceView` can be changed at compile time. For the other sanitizers we just hard-code `LocalAddressSpaceView` because we have no plans to use these allocators in an out-of-process manner. rdar://problem/45284065 Reviewers: kcc, dvyukov, vitalybuka, cryptoad, eugenis, kubamracek, george.karpenkov Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D55764 llvm-svn: 349954
* tsan: align default value of detect_deadlocks flag with actual behaviorDmitry Vyukov2018-12-191-2/+1
| | | | | | | | | | | | | | I tricked myself into thinking that deadlock detection is off by default in TSan by looking at the default value of the detect_deadlocks flag and outdated docs. (Created a pull request to update docs.) I even managed to confuse others: https://groups.google.com/forum/#!topic/thread-sanitizer/xYvnAYwtoDk However, the default value is overwritten in code (TSan_flags.cc:InitializeFlags). The TSan/deadlock tests also rely on this This changes aligns the default value of the flag with the actual default behavior. Author: yln (Julian Lettner) Reviewed in: https://reviews.llvm.org/D55846 llvm-svn: 349609
* Introduce `AddressSpaceView` template parameter to `SizeClassAllocator32`, ↵Dan Liew2018-12-141-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `FlatByteMap`, and `TwoLevelByteMap`. Summary: This is a follow up patch to r346956 for the `SizeClassAllocator32` allocator. This patch makes `AddressSpaceView` a template parameter both to the `ByteMap` implementations (but makes `LocalAddressSpaceView` the default), some `AP32` implementations and is used in `SizeClassAllocator32`. The actual changes to `ByteMap` implementations and `SizeClassAllocator32` are very simple. However the patch is large because it requires changing all the `AP32` definitions, and users of those definitions. For ASan and LSan we make `AP32` and `ByteMap` templateds type that take a single `AddressSpaceView` argument. This has been done because we will instantiate the allocator with a type that isn't `LocalAddressSpaceView` in the future patches. For the allocators used in the other sanitizers (i.e. HWAsan, MSan, Scudo, and TSan) use of `LocalAddressSpaceView` is hard coded because we do not intend to instantiate the allocators with any other type. In the cases where untemplated types have become templated on a single `AddressSpaceView` parameter (e.g. `PrimaryAllocator`) their name has been changed to have a `ASVT` suffix (Address Space View Type) to indicate they are templated. The only exception to this are the `AP32` types due to the desire to keep the type name as short as possible. In order to check that template is instantiated in the correct a way a `static_assert(...)` has been added that checks that the `AddressSpaceView` type used by `Params::ByteMap::AddressSpaceView` matches the `Params::AddressSpaceView`. This uses the new `sanitizer_type_traits.h` header. rdar://problem/45284065 Reviewers: kcc, dvyukov, vitalybuka, cryptoad, eugenis, kubamracek, george.karpenkov Subscribers: mgorny, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D54904 llvm-svn: 349138
* (no commit message)Julian Lettner2018-11-281-1/+1
| | | | llvm-svn: 347788
* tsan: add pthread_tryjoin_np and pthread_timedjoin_np interceptorsDmitry Vyukov2018-11-213-0/+40
| | | | | | | | | | Add pthread_tryjoin_np() and pthread_timedjoin_np() interceptors on Linux, so that ThreadSanitizer can handle programs using these functions. Author: Yuri Per (yuri) Reviewed in: https://reviews.llvm.org/D54521 llvm-svn: 347383
* [tsan] Add __cxa_guard_acquire hooks to support cooperative schedulingVitaly Buka2018-11-201-0/+12
| | | | | | | | | | Reviewers: dvyukov Subscribers: krytarowski, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D54664 llvm-svn: 347336
* [sanitizer] Use "fast mmap" kernel flag for shadow memory on macOS 10.13.4+Kuba Mracek2018-11-061-1/+3
| | | | | | | | This speeds up process startup and teardown and also reduces lock contention when running multiple ASanified/TSanified processes simultaneously. Should greatly improve lit testing time. Differential Revision: https://reviews.llvm.org/D48445 llvm-svn: 346262
* Handle NetBSD alias for pthread_sigmaskKamil Rytarowski2018-10-302-0/+7
| | | | | | | | | | | | | | | | | | | | | Summary: Add a new helper macro TSAN_INTERCEPTOR_NETBSD_ALIAS_THR2 that handles pthread(3)/libc aliases in scenarios when a name in both libraries differs not just in prefix namespace. Handle TSan pthread_sigmask mangling accordingly into __libc_thr_sigsetmask. Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: kubamracek, jfb, llvm-commits, #sanitizers, mgorny Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D53863 llvm-svn: 345627
* Handle NetBSD symbol mangling for nanosleep and vforkKamil Rytarowski2018-10-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Native code generated on NetBSD mangles: - vfork into __vfork14 - nanosleep into __nanosleep50 Handle this accordingly in TSan. Reviewers: vitalybuka, dvyukov, joerg Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers, mgorny Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D53806 llvm-svn: 345570
* [TSan] Cleanup TSan runtime support for Go on linux-aarch64. NFC.Arnaud A. de Grandmaison2018-10-121-28/+10
| | | | | | | | | | | | | | | This is a follow-up patch to r342541. After further investigations, only 48bits VMA size can be supported. As this is enforced in function InitializePlatformEarly from lib/rt1/tsan_platform_linux.cc, the access to the global variable vmaSize variable + switch can be removed. This also addresses a comment from https://reviews.llvm.org/D52167. vmaSize of 39 or 42bits are not compatible with a Go program memory layout as the Go heap will not fit in the shadow memory area. Patch by: Fangming Fang <Fangming.Fang@arm.com> llvm-svn: 344329
* [compiler-rt][TSan] Add TSan runtime support for Go on linux-aarch64.Arnaud A. de Grandmaison2018-09-192-0/+52
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds TSan runtime support for Go on linux-aarch64 platforms. This enables people working on golang to implement their platform/language part of the TSan support. Basic testing is done with lib/tsan/go/buildgo.sh. Additional testing will be done as part of the work done in the Go project. It is intended to support other VMA sizes, except 39 which does not have enough bits to support the Go heap requirements. Patch by Fangming Fang <Fangming.Fang@arm.com>. Reviewers: kubamracek, dvyukov, javed.absar Subscribers: mcrosier, dberris, mgorny, kristof.beyls, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D52167 llvm-svn: 342541
* [tsan] Adjust setjmp/longjmp handling on Darwin for macOS MojaveKuba Mracek2018-08-214-4/+22
| | | | | | | | | | On macOS Mojave, the OS started using the XOR-by-a-secret-key scheme (same as glibc is alread doing) for storing the SP value in setjmp environment. We need to adjust for that to keep supporting setjmp/longjmp on latest Darwin. The patch is basically doing the same what we're already doing for glibc. rdar://problem/43542596 Differential Revision: https://reviews.llvm.org/D51064 llvm-svn: 340350
* Fixup for r340342: Avoid Block_release'ing the block since we're no longer ↵Kuba Mracek2018-08-211-1/+1
| | | | | | | | making a copy. rdar://problem/42242579 llvm-svn: 340347
* [tsan] Avoid calling Block_copy in the "sync" GCD interceptorsKuba Mracek2018-08-211-4/+1
| | | | | | | | | | The synchronous dispatch functions in GCD (dispatch_sync, dispatch_barrier_sync), don't make a copy of the passed block. To maintain binary compatibility, we should avoid doing that as well in TSan, as there's no reason to do that. The synchronous dispatch functions will not return before the block is actually executed. rdar://problem/42242579 Differential Revision: https://reviews.llvm.org/D50920 llvm-svn: 340342
* [tsan] Fix gcc pedantic warningDmitry Vyukov2018-07-261-16/+16
| | | | | | | | | Fix gcc (7.2.0) pedantic warning warning: extra ‘;’ [-Wpedantic] Author: jasonl220 (Jason Lovett) Review: https://reviews.llvm.org/D49817 llvm-svn: 338023
* [tsan] Fix crash in objc_sync_enter/objc_sync_exit when using an Obj-C ↵Kuba Mracek2018-07-241-2/+26
| | | | | | | | | | tagged pointer Objective-C tagged pointers (either bottom-most or top-most bit is 1) are valid Obj-C objects but are not valid pointers. Make sure we don't crash on them when used in objc_sync_enter/objc_sync_exit. Instead, let's synchronize on a global object. Differential Revision: https://reviews.llvm.org/D49707 llvm-svn: 337837
* sanitizers: consistently check result of MmapFixedNoReserveDmitry Vyukov2018-07-203-21/+19
| | | | | | | | | | | | | | | | MmapFixedNoReserve does not terminate process on failure. Failure to check its result and die will always lead to harder to debug crashes later in execution. This was observed in Go processes due to some address space conflicts. Consistently check result of MmapFixedNoReserve. While we are here also add warn_unused_result attribute to prevent such bugs in future and change return type to bool as that's what all callers want. Reviewed in https://reviews.llvm.org/D49367 llvm-svn: 337531
* [TSan] More detailed error message on failed sahdow memory madviseAlex Shlyapnikov2018-06-281-3/+10
| | | | | | | | | | | | | | Summary: Report errno value on failed shadow memory madvise attempt and add a hint message with the possible workaround. Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48668 llvm-svn: 335928
* tsan: fix deficiency in MutexReadOrWriteUnlockDmitry Vyukov2018-06-221-1/+1
| | | | | | | | | | MutexUnlock uses ReleaseStore on s->clock, which is the right thing to do. However MutexReadOrWriteUnlock for writers uses Release on s->clock. Make MutexReadOrWriteUnlock also use ReleaseStore for consistency and performance. Unfortunately, I don't think any test can detect this as this only potentially affects performance. llvm-svn: 335322
* [TSan] Report proper error on allocator failures instead of CHECK(0)-ingAlex Shlyapnikov2018-06-185-13/+62
| | | | | | | | | | | | | | | | | | | | | | Summary: Following up on and complementing D44404 and other sanitizer allocators. Currently many allocator specific errors (OOM, for example) are reported as a text message and CHECK(0) termination, no stack, no details, not too helpful nor informative. To improve the situation, detailed and structured common errors were defined and reported under the appropriate conditions. Common tests were generalized a bit to cover a slightly different TSan stack reporting format, extended to verify errno value and returned pointer value check is now explicit to facilitate debugging. Reviewers: dvyukov Subscribers: srhines, kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48087 llvm-svn: 334975
* [TSan] Fix madvise(MADV_NOHUGEPAGE) for meta shadow memoryAlex Shlyapnikov2018-06-131-9/+25
| | | | | | | | | | | | | | | | Summary: Move madvise(MADV_NOHUGEPAGE) for the meta shadow memory after the meta shadow memory is mapped (currently it silently fails with ENOMEM). Add a diagnostic message to detect similar problems in the future. Reviewers: dvyukov Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48097 llvm-svn: 334624
* [sanitizer] Add fgets, fputs and puts into sanitizer_commonPeter Wu2018-06-111-9/+0
| | | | | | | | | | | | | | | Summary: Add fgets, fputs and puts to sanitizer_common. This adds ASAN coverage for these functions, extends MSAN support from fgets to fputs/puts and extends TSAN support from puts to fputs. Fixes: https://github.com/google/sanitizers/issues/952 Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D46545 llvm-svn: 334450
* Introduce CheckASLR() in sanitizersKamil Rytarowski2018-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: At least the ASan, MSan, TSan sanitizers require disabled ASLR on a NetBSD. Introduce a generic CheckASLR() routine, that implements a check for the current process. This flag depends on the global or per-process settings. There is no simple way to disable ASLR in the build process from the level of a sanitizer or during the runtime execution. With ASLR enabled sanitizers that operate over the process virtual address space can misbehave usually breaking with cryptic messages. This check is dummy for !NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: cryptoad, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D47442 llvm-svn: 333985
* [TSan] FreeBSD / intercept thr_exitDavid Carlier2018-06-041-0/+12
| | | | | | | | | | | | | | | intercepting thr_exit to terminate threads under FreeBSD. Unblock few unit tests hanging. Reviewers: krytarowski, vitalybuka, emaste Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D47677 M lib/tsan/rtl/tsan_interceptors.cc llvm-svn: 333870
* [tsan] Add debugging API to retrieve the "external tag" from reportsKuba Mracek2018-05-102-0/+20
| | | | | | Differential Revision: https://reviews.llvm.org/D46661 llvm-svn: 332048
* [sanitizer] Replace InternalScopedBuffer with InternalMmapVectorVitaly Buka2018-05-072-2/+2
| | | | llvm-svn: 331618
* [sanitizer] Remove reserving constructor from InternalMmapVectorVitaly Buka2018-05-072-2/+2
| | | | llvm-svn: 331617
* [sanitizer] Make InternalScopedBuffer::size() behavior similar to vector.Vitaly Buka2018-05-071-3/+4
| | | | llvm-svn: 331612
* tsan: disable trace switching after multithreaded forkDmitry Vyukov2018-04-302-0/+6
| | | | | | | | | | | | The problem is reported in: https://github.com/google/sanitizers/issues/945 We already disable as much as possible after multithreaded fork, trace switching is last place that can hang due to basic operations (memory accesses, function calls). Disable it too. llvm-svn: 331163
* tsan: improve "destroy of a locked mutex" reportsDmitry Vyukov2018-04-271-2/+2
| | | | | | | | | | | | | | | 1. Allow to suppress by current stack. We generally allow to suppress by all main stacks. Current is probably the stack one wants to use to suppress such reports. 2. Fix last lock stack restoration. We trimmed shadow value by storing it in u32. This magically worked for the test that provoked the report on the main thread. But this breaks for locks in any other threads. llvm-svn: 331023
* tsan: fix compiler warningsDmitry Vyukov2018-04-191-3/+3
| | | | | | vmaSize is uptr, so we need to print it with %zd. llvm-svn: 330312
* tsan: add support for linux/powerpc64 in buildgo.shDmitry Vyukov2018-04-162-2/+83
| | | | | | | | | | | The current implementation of the Go sanitizer only works on x86_64. Added some modifications to the buildgo.sh script and the Tsan code to make it work on powerpc64/linux. Author: cseo (Carlos Eduardo Seo) Reviewed in: https://reviews.llvm.org/D43025 llvm-svn: 330122
* [tsan] Add interceptors for objc_sync_enter and objc_sync_exitKuba Mracek2018-04-131-0/+13
| | | | | | | | Objective-C's @synchronize synchronization primitive uses calls to objc_sync_enter and objc_sync_exit runtime functions. In most cases, they end up just calling pthread_mutex_lock/pthread_mutex_unlock, but there are some cases where the synchronization from pthread_mutex_lock/pthread_mutex_unlock interceptors isn't enough. Let's add explicit interceptors for objc_sync_enter and objc_sync_exit to handle all cases. Differential Revision: https://reviews.llvm.org/D45487 llvm-svn: 329982
* tsan: fix darwin build after 328079Dmitry Vyukov2018-03-211-7/+6
| | | | | | | | | | 328079 introduced a weak hook without default implementation. This broke darwin build: http://green.lab.llvm.org/green//job/clang-stage1-configure-RA/43731/consoleFull#-119213188149ba4694-19c4-4d7e-bec5-911270d8a58c Provide default impl for the hook. llvm-svn: 328082
* tsan: support inlined frames in external symbolizationDmitry Vyukov2018-03-212-2/+44
| | | | | | | | | | | | New API passes a callback function to the external symbolizer, allowing it to add multiple frames to the traceback. Note that the old interface API will be still supported until the clients migrate to the new one. Author: asmundak (Alexander Smundak) Reviewed in: https://reviews.llvm.org/D44714 llvm-svn: 328079
* FreeBSD TSan support updateVitaly Buka2018-03-161-3/+3
| | | | | | | | | | | | | | | | | Summary: - Disable thread_finalize callback on FreeBSD, fixing couple of unit tests. Patch by David CARLIER Reviewers: vitalybuka Reviewed By: vitalybuka Subscribers: emaste, kubamracek, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44156 llvm-svn: 327697
* [Sanitizers] Add more standard compliant posix_memalign implementation for LSan.Alex Shlyapnikov2018-03-121-0/+10
| | | | | | | | | | | | | | | Summary: Add more standard compliant posix_memalign implementation for LSan and use corresponding sanitizer's posix_memalign implenetations in allocation wrappers on Mac. Reviewers: eugenis, fjricci Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D44335 llvm-svn: 327338
* [sanitizer] Move mmap interceptors into sanitizer_commonVitaly Buka2018-03-071-34/+14
| | | | | | | | | | Reviewers: devnexen, krytarowski, eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D44125 llvm-svn: 326851
* [TSan] Fix static TLS boundaries calculations in __tls_get_addr interceptor.Alex Shlyapnikov2018-02-151-1/+2
| | | | | | | | | | | | | | Summary: DTLS_on_tls_get_addr expects (tls_addr + tls_size) as the last parameter, static_tls_end. Reviewers: dvyukov Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D43325 llvm-svn: 325276
* Enable syscall-specific functions in TSan/NetBSDKamil Rytarowski2018-02-151-1/+1
| | | | | | | | | | | | | NetBSD ships now with netbsd_syscall_hooks.h and requires support for TSan specific features to be enabled. This is follow up of: D42048: Add NetBSD syscall hooks skeleton in sanitizers Sponsored by <The NetBSD Foundation> llvm-svn: 325245
* Add NetBSD syscall hooks skeleton in sanitizersKamil Rytarowski2018-02-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Implement the skeleton of NetBSD syscall hooks for use with sanitizers. Add a script that generates the rules to handle syscalls on NetBSD: generate_netbsd_syscalls.awk. It has been written in NetBSD awk(1) (patched nawk) and is compatible with gawk. Generate lib/sanitizer_common/sanitizer_platform_limits_netbsd.h that is a public header for applications, and included as: <sanitizer_common/sanitizer_platform_limits_netbsd.h>. Generate sanitizer_syscalls_netbsd.inc that defines all the syscall rules for NetBSD. This file is modeled after the Linux specific file: sanitizer_common_syscalls.inc. Start recognizing NetBSD syscalls with existing sanitizers: ASan, ESan, HWASan, TSan, MSan. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, dvyukov, eugenis Reviewed By: vitalybuka Subscribers: hintonda, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42048 llvm-svn: 325206
* [scudo] Allow options to be defined at compile timeKostya Kortchinsky2018-02-081-4/+2
| | | | | | | | | | | | | | | | Summary: Allow for options to be defined at compile time, like is already the case for other sanitizers, via `SCUDO_DEFAULT_OPTIONS`. Reviewers: alekseyshl, dberris Reviewed By: alekseyshl, dberris Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D42980 llvm-svn: 324620
* Correct typo in TSan codeKamil Rytarowski2018-01-251-3/+3
| | | | | | | | We wrongly enabled additional (unwanted) branch for NetBSD. Noted by Vlad Tsyrklevich llvm-svn: 323413
* [TSan][MIPS] Expand sanitizer memory space to lower addressesPetar Jovanovic2018-01-201-13/+15
| | | | | | | | | | | | | | | | | | | | MemToShadowImpl() maps lower addresses to a memory space out of sanitizers range. The simplest example is address 0 which is mapped to 0x2000000000 static const uptr kShadowBeg = 0x2400000000ull; but accessing the address during tsan execution will lead to a segmentation fault. This patch expands the range used by the sanitizer and ensures that 1/8 of the maximum valid address in the virtual address spaces is used for shadow memory. Patch by Milos Stojanovic. Differential Revision: https://reviews.llvm.org/D41777 llvm-svn: 323013
* [Sanitizers] Make common allocator agnostic to failure handling modes.Alex Shlyapnikov2018-01-171-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Make common allocator agnostic to failure handling modes and move the decision up to the particular sanitizer's allocator, where the context is available (call stack, parameters, return nullptr/crash mode etc.) It simplifies the common allocator and allows the particular sanitizer's allocator to generate more specific and detailed error reports (which will be implemented later). The behavior is largely the same, except one case, the violation of the common allocator's check for "size + alignment" overflow is now reportied as OOM instead of "bad request". It feels like a worthy tradeoff and "size + alignment" is huge in this case anyway (thus, can be interpreted as not enough memory to satisfy the request). There's also a Report() statement added there. Reviewers: eugenis Subscribers: kubamracek, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D42198 llvm-svn: 322784
OpenPOWER on IntegriCloud