summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common
Commit message (Collapse)AuthorAgeFilesLines
...
* [asan, myriad] Simplify main thread handlingWalter Lee2018-05-302-17/+0
| | | | | | | | | | On Myriad RTEMS, we don't need to treat the main thread differently. The existing thread hooks will do the right thing, so get rid of all the unneeded special logic. Differential Revision: https://reviews.llvm.org/D47502 llvm-svn: 333504
* Revert the last test commitH.J. Lu2018-05-251-1/+0
| | | | llvm-svn: 333310
* This is a test commit to verify repository accessH.J. Lu2018-05-251-0/+1
| | | | llvm-svn: 333309
* sanitizer: Use pre-computed size of struct ustat for LinuxCraig Topper2018-05-241-2/+13
| | | | | | | | | | | | | | | | | | | <sys/ustat.h> has been removed from glibc 2.28 by: commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Sun Mar 18 11:28:59 2018 +0800 Deprecate ustat syscall interface This patch uses pre-computed size of struct ustat for Linux to fix https://bugs.llvm.org/show_bug.cgi?id=37418 Patch by H.J. Lu. Differential Revision: https://reviews.llvm.org/D47281 llvm-svn: 333213
* [fuchsia] Add line buffering in RawWriteJake Ehrlich2018-05-231-1/+25
| | | | | | | | This change causes RawWrite to buffer upto 128 bytes or until a line is reached. This helps group calls into more readable lines. llvm-svn: 333136
* [sanitizer] Define UINTPTR_MAXKostya Kortchinsky2018-05-231-0/+6
| | | | | | | | | | | | | | | | Summary: `sanitizer_internal_defs.h` didn't have this define, which will be useful in an upcoming CL. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D47270 llvm-svn: 333109
* Fix internal_mmap() on 32-bit NetBSD platformsKamil Rytarowski2018-05-231-1/+1
| | | | | | | There is need to use internal_syscall64() instead of internal_syscall_ptr(). The offset argument of type off_t is always 64-bit. llvm-svn: 333075
* [sanitizer] Reland "Be more accurate when calculating the previous ↵Igor Kudrin2018-05-232-5/+7
| | | | | | | | instruction address on ARM." Differential Revision: https://reviews.llvm.org/D46004 llvm-svn: 333071
* [asan] Add target-specific files for Myriad RTEMS portWalter Lee2018-05-183-0/+318
| | | | | | Differential Revision: https://reviews.llvm.org/D46468 llvm-svn: 332691
* [sanitizer] Trivial portion of the port to Myriad RTEMSWalter Lee2018-05-187-11/+13
| | | | | | | | | | | | | | | | | | | | | This commit contains the trivial portion of the port of ASan to Myriad RTEMS. - Whitelist platform in sanitizer_platform.h, ubsan_platform.h - Turn off general interception - Use memset for FastPoisonShadow - Define interception wrappers - Set errno symbol correctly - Enable ASAN_LOW_MEMORY - Enable preinit array - Disable slow unwinding - Use fuchsia offline symbolizer - Disable common code for: InitializeShadowMemory, CreateMainThread, AsanThread::ThreadStart, StartReportDeadlySignal, MaybeReportNonExecRegion. Differential Revision: https://reviews.llvm.org/D46454 llvm-svn: 332681
* [sanitizer] Minor 32-bit primary improvementsKostya Kortchinsky2018-05-162-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For the 32-bit TransferBatch: - `SetFromArray` callers have bounds `count`, so relax the `CHECK` to `DCHECK`; - same for `Add`; - mark `CopyToArray` as `const`; For the 32-bit Primary: - `{Dea,A}llocateBatch` are only called from places that check `class_id`, relax the `CHECK` to `DCHECK`; - same for `AllocateRegion`; - remove `GetRegionBeginBySizeClass` that is not used; - use a local variable for the random shuffle state, so that the compiler can use a register instead of reading and writing to the `SizeClassInfo` at every iteration; For the 32-bit local cache: - pass the count to drain instead of doing a `Min` everytime which is at times superfluous. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D46657 llvm-svn: 332478
* [sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlockVitaly Buka2018-05-152-0/+21
| | | | | | | | | | Reviewers: eugenis, dvyukov Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D46793 llvm-svn: 332320
* [asan] Workaround to avoid hangs in Chromium testsVitaly Buka2018-05-151-3/+3
| | | | | | | | | | | | | | | | | | Summary: For some reasons on Chromium when we start leak checking we get own pid as 1. After that we see threads with PPID:0 assuming that thread is dead in infinite loop. To resolve particularly this case and possible issues like this, when IsAlive check failed to detect thread status, we need to limit the number of SuspendAllThreads iterations. Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D46852 llvm-svn: 332319
* Revert "[sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock"Vitaly Buka2018-05-142-19/+0
| | | | | | | | Tsan tests fail. This reverts commit r332268 llvm-svn: 332276
* [sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlockVitaly Buka2018-05-142-0/+19
| | | | | | | | | | Reviewers: eugenis, dvyukov Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D46793 llvm-svn: 332268
* [sanitizer] Replace #if SANITIZER_NETBSD with #if ↵Vitaly Buka2018-05-132-13/+22
| | | | | | SANITIZER_INTERCEPT___LIBC_MUTEX llvm-svn: 332190
* [sanitizer] Fix typo in macro nameVitaly Buka2018-05-122-2/+2
| | | | llvm-svn: 332171
* [sanitizer] Allow Fuchsia symbolizer to be reused by Myriad RTEMSWalter Lee2018-05-115-21/+104
| | | | | | | | | | | Like Fuchsia, Myriad RTEMS uses an off-line symbolizer -- we just need a custom backtrace frame string. Move this definition to sanitizer_fuchsia.h; the corresponding RTEMS one will be added when we add sanitizer_rtems.h. Differential Revision: https://reviews.llvm.org/D46462 llvm-svn: 332157
* Enable SANITIZER_INTERCEPTOR_HOOKS for NetBSDKamil Rytarowski2018-05-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: This feature is required for proper libFuzzer support. Adding SI_NETBSD to the list of OSes, fixes breakage in several libFuzzer tests. It has been debugged with aid from kcc@. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D46729 llvm-svn: 332051
* [sanitizer] Port fast stack unwinder to sparcv8Walter Lee2018-05-103-1/+65
| | | | | | Differential Revision: https://reviews.llvm.org/D46469 llvm-svn: 332046
* [sanitizer] Attempt to fix strace_test.cc on ppc64leVitaly Buka2018-05-101-1/+1
| | | | llvm-svn: 331964
* [sanitizer] Fix typo in commentVitaly Buka2018-05-101-1/+1
| | | | llvm-svn: 331956
* [sanitizer] Renamed local variableVitaly Buka2018-05-101-5/+5
| | | | llvm-svn: 331955
* [sanitizer] Fix compilation after invalid rebaseVitaly Buka2018-05-101-1/+1
| | | | llvm-svn: 331954
* [sanitizer] Don't miss threads by ThreadSuspenderVitaly Buka2018-05-103-22/+72
| | | | | | | | | | | | | | | | | | | | | | | Summary: Enumerating /proc/<pid>/task/ dir Linux may stop if thread is dead. In this case we miss some alive threads and can report false memory leaks. To solve this issue we repeat enumeration if the last thread is dead. Do detect dead threads same way as proc_task_readdir we use /proc/<pid>/task/<tid>/status. Similarly it also ends enumeration of if proc_fill_cache fails, but in this case Linux sets inode to 1 (Bad block). And just in case re-list threads if we had to call internal_getdents more than twice or result takes more than half of the buffer. Reviewers: eugenis, dvyukov, glider Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D46517 llvm-svn: 331953
* [sanitizer] Use all available rounded up capacityVitaly Buka2018-05-092-17/+20
| | | | | | | | | | Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D46617 llvm-svn: 331940
* [sanitizer] Fix argument type and remove unneeded vector resizeVitaly Buka2018-05-091-2/+1
| | | | llvm-svn: 331927
* [sanitizer] Use tid_t in ThreadListerVitaly Buka2018-05-094-25/+24
| | | | llvm-svn: 331921
* [sanitizer] Cleanup sorting functionsVitaly Buka2018-05-099-35/+25
| | | | llvm-svn: 331915
* [sanitizer] Correct 64-bit atomic_store on 32-bit "other" platformsKostya Kortchinsky2018-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I think there might be something to optimize in `atomic_store`. Currently, if everything goes well (and we have a different new value), we always iterate 3 times. For example, `with a = 0`, `oldval = a`, `newval = 42`, we get: ``` oldval = 0, newval = 42, curval = 0 oldval = 0, newval = 42, curval = 42 oldval = 42, newval = 42, curval = 42 ``` and then it breaks. Unless I am not seeing something, I don't see a point to the third iteration. If the current value is the one we want, we should just break. This means that 2 iterations (with a different newval) should be sufficient to achieve what we want. Reviewers: dvyukov, alekseyshl Reviewed By: dvyukov Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D46597 llvm-svn: 331890
* [sanitizer] Remove unneeded blank linesVitaly Buka2018-05-091-1/+0
| | | | llvm-svn: 331831
* [sanitizer] Update .clang-format in compiler-rtVitaly Buka2018-05-091-0/+2
| | | | | | Historically style is Google, but we never used AllowShortIfStatementsOnASingleLine. llvm-svn: 331829
* [sanitizer] Read file to InternalMmapVectorNoCtorVitaly Buka2018-05-082-9/+52
| | | | llvm-svn: 331791
* [sanitizer] Close fd on ReadFromFile errorVitaly Buka2018-05-081-2/+4
| | | | llvm-svn: 331789
* [sanitizer] Fix InternalMmapVectorNoCtor reserve and resizeVitaly Buka2018-05-082-5/+29
| | | | | | | Remap on reserve of more than the current size. Don't remap on downsize. llvm-svn: 331784
* [sanitizer] Add InternalMmapVector::swapVitaly Buka2018-05-082-0/+24
| | | | llvm-svn: 331736
* [sanitizer] Fix error checking in ThreadListerVitaly Buka2018-05-081-2/+3
| | | | llvm-svn: 331735
* Revert "[sanitizer] Be more accurate when calculating the previous ↵Igor Kudrin2018-05-081-5/+4
| | | | | | | | | | | instruction address on ARM." This reverts commit r331626 because it causes build bot failures: http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/5069 Differential Revision: https://reviews.llvm.org/D46004 llvm-svn: 331734
* [sanitizer] Simplify ThreadLister interfaceVitaly Buka2018-05-074-82/+43
| | | | | | | | | | Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D46516 llvm-svn: 331701
* [sanitizer] s/TestOnlyInit/Init for the allocator ByteMap (NFC)Kostya Kortchinsky2018-05-073-5/+5
| | | | | | | | | | | | | | | | | Summary: The `TestOnlyInit` function of `{Flat,TwoLevel}ByteMap` seems to be a misnomer since the function is used outside of tests as well, namely in `SizeClassAllocator32::Init`. Rename it to `Init` and update the callers. Reviewers: alekseyshl, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D46408 llvm-svn: 331662
* [sanitizer] On RTEMS, avoid recursion when reporting Mmap failureWalter Lee2018-05-071-3/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D46463 llvm-svn: 331648
* [sanitizer] Add definitions for Myriad RTEMS platformWalter Lee2018-05-071-0/+12
| | | | | | | | | | | | Introduce two definitions to be used by the Myriad RTEMS port of the ASan run-time: SANITIZER_MYRIAD2 for the platform and SANITIZER_RTEMS for the OS. We expect to use SANITIZER_MYRIAD2 to guard the portion of the port corresponding to Myriad's unique memory map, and SANITIZER_RTEMS for most of the rest. Differential Revision: https://reviews.llvm.org/D46453 llvm-svn: 331646
* [sanitizer] Be more accurate when calculating the previous instruction ↵Igor Kudrin2018-05-071-4/+5
| | | | | | | | address on ARM. Differential Revision: https://reviews.llvm.org/D46004 llvm-svn: 331626
* [sanitizer] Add operator== and operator!= for InternalMmapVectorNoCtorVitaly Buka2018-05-072-0/+36
| | | | llvm-svn: 331619
* [sanitizer] Replace InternalScopedBuffer with InternalMmapVectorVitaly Buka2018-05-079-25/+17
| | | | llvm-svn: 331618
* [sanitizer] Remove reserving constructor from InternalMmapVectorVitaly Buka2018-05-0710-23/+26
| | | | llvm-svn: 331617
* [sanitizer] Implement InternalScopedBuffer with InternalMmapVectorVitaly Buka2018-05-071-46/+34
| | | | llvm-svn: 331616
* [sanitizer] Make InternalScopedBuffer::size() behavior similar to vector.Vitaly Buka2018-05-073-6/+5
| | | | llvm-svn: 331612
* Remove dead sanitizer_procmaps_freebsd.ccKamil Rytarowski2018-05-051-103/+0
| | | | | | This file has been obsoleted by sanitizer_procmaps_bsd.cc. llvm-svn: 331581
* [sanitizer] Remove unused 32-bit allocator TransferBatch parameterKostya Kortchinsky2018-05-032-3/+2
| | | | | | | | | | | | | | | | | Summary: NFC. Remove an unused parameter in `SizeClassAllocator32::TransferBatch::SetFromArray`, and thus get rid of the compilation warning. Reviewers: alekseyshl, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D46397 llvm-svn: 331477
OpenPOWER on IntegriCloud