summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common
Commit message (Collapse)AuthorAgeFilesLines
...
* [asan] Disable 64-bit allocator on android/aarch64.Evgeniy Stepanov2016-09-141-3/+1
| | | | | | Makes the device strangely unstable, and fails one sanitizer_common test. llvm-svn: 281533
* Switch to 64-bit allocator on android/aarch64.Evgeniy Stepanov2016-09-131-1/+3
| | | | | | | This uses the "very compact" size class mapping that fits in the 39-bit address space. llvm-svn: 281371
* [sanitizer] replace CHECK with CHECK_XY in two places for better diagnosticsKostya Serebryany2016-09-121-2/+2
| | | | llvm-svn: 281255
* [asan] Cleanup: Move tid into ErrorBase, add const to BufferedStackTrace, be ↵Filipe Cabecinhas2016-09-122-2/+2
| | | | | | | | | | | | | | | | consistent in constructor arguments and member order. Summary: As mentioned in D24394, I'm moving tid to ErrorBase, since basically all errors need it. Also mentioned in the same review are other cleanups like adding const to BufferedStackTrace and make sure constructor orders are consistent. Reviewers: vitalybuka, kcc, eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24455 llvm-svn: 281236
* [sanitizer] Add interceptor for ttyname_rKeno Fischer2016-09-092-0/+16
| | | | | | | | | | Reviewers: eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24375 llvm-svn: 281116
* [sanitizer] fix an allocator bug where the allocated memory may overlap with ↵Kostya Serebryany2016-09-092-4/+22
| | | | | | the free array (kudos to Kostya Korcthinsky). Also make sure that the allocator does not mmap more than requested. Test both. llvm-svn: 281103
* [sanitizer] fix a potential buffer overflow due to __sanitizer_symbolize_pc ↵Kostya Serebryany2016-09-091-0/+3
| | | | | | (need to put a zero after strncmp). LOL llvm-svn: 281015
* Fix tsan-go build.Evgeniy Stepanov2016-09-081-0/+2
| | | | | | Disable the new abort-in-SIGABRT code under SANITIZER_GO. llvm-svn: 280980
* Revert "[XRay] ARM 32-bit no-Thumb support in compiler-rt"Renato Golin2016-09-081-2/+1
| | | | | | This reverts commit r280890, as the related LLVM commit broke the thumb bots. llvm-svn: 280969
* Fix linker warning about sanitizer_common_nolibc functions on WindowsReid Kleckner2016-09-081-0/+4
| | | | llvm-svn: 280962
* Revert "[ESan][MIPS] Adds support for MIPS64"Qin Zhao2016-09-085-38/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This reverts commit 62b3eecdbe72af0255f0639b0446087a47efbf48. (D23799) The CL cause 13 ESan test failure on x86_64: Failing Tests (13): EfficiencySanitizer-x86_64 :: TestCases/large-stack-linux.c EfficiencySanitizer-x86_64 :: TestCases/libc-intercept.c EfficiencySanitizer-x86_64 :: TestCases/mmap-shadow-conflict.c EfficiencySanitizer-x86_64 :: TestCases/struct-simple.cpp EfficiencySanitizer-x86_64 :: TestCases/verbose-simple.c EfficiencySanitizer-x86_64 :: TestCases/workingset-early-fault.c EfficiencySanitizer-x86_64 :: TestCases/workingset-memset.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-midreport.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-samples.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-signal-posix.cpp EfficiencySanitizer-x86_64 :: TestCases/workingset-simple.cpp EfficiencySanitizer-x86_64 :: Unit/circular_buffer.cpp EfficiencySanitizer-x86_64 :: Unit/hashtable.cpp Unexpected Failures: 13 Reviewers: bruening, slthakur Subscribers: sdardis, kubabrecka, beanz Differential Revision: https://reviews.llvm.org/D24350 llvm-svn: 280954
* [asan] Fix handle_abort_on_error.cc test on DarwinKuba Brecka2016-09-081-0/+2
| | | | | | | | r280885 added a testcase for handle_abort, which is broken on macOS, let’s add this support into sanitizer_mac.cc. Differential Revision: https://reviews.llvm.org/D24344 llvm-svn: 280945
* [XRay] ARM 32-bit no-Thumb support in compiler-rtDean Michael Berris2016-09-081-1/+2
| | | | | | | | | | | | | This is a port of XRay to ARM 32-bit, without Thumb support yet. This is one of 3 commits to different repositories of XRay ARM port. The other 2 are: 1. https://reviews.llvm.org/D23931 (LLVM) 2. https://reviews.llvm.org/D23932 (Clang test) Differential Revision: https://reviews.llvm.org/D23933 llvm-svn: 280890
* [sanitizer] Fix a conflict between abort_on_error and handle_abort.Evgeniy Stepanov2016-09-071-1/+10
| | | | | | | | | Reset the SIGABRT signal handler before calling abort(). Also, change the error message when catching SIGABRT to say "ABRT" instead of "SEGV". llvm-svn: 280885
* [asan] Fix build on Linux.Evgeniy Stepanov2016-09-071-1/+1
| | | | llvm-svn: 280881
* [asan] Add openlog() on Android.Evgeniy Stepanov2016-09-071-2/+2
| | | | | | | | Normally, syslog() uses argv[0] for the log tag; bionic, however, would crash in syslog() before libc constructor unless the log tag is explicitly set with openlog(). llvm-svn: 280875
* [ESan][MIPS] Adds support for MIPS64Sagar Thakur2016-09-075-3/+38
| | | | | | | | | | | | | | | With this patch 10 out of 13 tests are passing. Following is the list of failing tests: struct-simple.cpp workingset-signal-posix.cpp mmap-shadow-conflict.c Reviewed by bruening Differential: D23799 llvm-svn: 280795
* [sanitizer] extend SizeClassMap to take more template parameters, add ↵Kostya Serebryany2016-08-312-20/+92
| | | | | | VeryCompactSizeClassMap for testing purposes llvm-svn: 280266
* [sanitizer] remove kBatchClassID that is not used any more; NFCKostya Serebryany2016-08-313-33/+3
| | | | llvm-svn: 280185
* [sanitizer-coverage] add two more modes of instrumentation: trace-div and ↵Kostya Serebryany2016-08-301-0/+6
| | | | | | trace-gep, mostly usaful for value-profile-based fuzzing; run-time part llvm-svn: 280045
* [scudo] use 32 bits of ASLR entropy instead of just 24 when shuffling ↵Kostya Serebryany2016-08-291-1/+1
| | | | | | allocated chunks llvm-svn: 279983
* [asan] first attempt at releasing free-d memory back to the system using ↵Kostya Serebryany2016-08-269-22/+123
| | | | | | madvise. Requires quite some tuning. llvm-svn: 279887
* [sanitizer] enable random shuffling the memory chunks inside the allocator, ↵Kostya Serebryany2016-08-263-0/+34
| | | | | | under a flag. Set this flag for the scudo allocator, add a test. llvm-svn: 279793
* [sanitizer] add __sanitizer_symbolize_pc. ↵Kostya Serebryany2016-08-251-0/+19
| | | | | | https://github.com/google/sanitizers/issues/322 llvm-svn: 279780
* [sanitizer] change SizeClassAllocator64 to accept just one template ↵Kostya Serebryany2016-08-253-22/+67
| | | | | | parameter instead of 5. First, this will make the mangled names shorter. Second, this will make adding more parameters simpler. llvm-svn: 279771
* [sanitizer] re-apply r279572 and r279595 reverted in r279643: change the ↵Kostya Serebryany2016-08-243-182/+144
| | | | | | 64-bit allocator to use a single array for free-d chunks instead of a lock-free linked list of tranfer batches. This change simplifies the code, makes the allocator more 'hardened', and will allow simpler code to release RAM to OS. This may also slowdown malloc stress tests due to lock contension, but I did not observe noticeable slowdown on various real multi-threaded benchmarks. llvm-svn: 279664
* Revert r279572 "[sanitizer] change the 64-bit..." because of failures on ubsanVitaly Buka2016-08-243-144/+182
| | | | | | This reverts commit r279572 and r279595. llvm-svn: 279643
* [sanitizer] trying to fix the PPC botsKostya Serebryany2016-08-241-1/+1
| | | | llvm-svn: 279595
* [sanitizer] change the 64-bit allocator to use a single array for free-d ↵Kostya Serebryany2016-08-233-182/+144
| | | | | | chunks instead of a lock-free linked list of tranfer batches. This change simplifies the code, makes the allocator more 'hardened', and will allow simpler code to release RAM to OS. This may also slowdown malloc stress tests due to lock contension, but I did not observe noticeable slowdown on various real multi-threaded benchmarks. llvm-svn: 279572
* [sanitizer] adding a threaded performance stress test for malloc (useful for ↵Kostya Serebryany2016-08-231-0/+37
| | | | | | manual analysis of malloc performance) llvm-svn: 279570
* [sanitizer] allocator: split the local cache class into two, one for 32-bit ↵Kostya Serebryany2016-08-234-4/+156
| | | | | | allocator and one for 64-bit one. NFC. The two imlementations will diverge in the following changes. llvm-svn: 279495
* [sanitizer-coverage] add __sanitizer_cov_trace_cmp[1248] to the ↵Kostya Serebryany2016-08-181-0/+8
| | | | | | sanitizer-coverage interface llvm-svn: 279026
* sanitizer_common: Fix warningMatthias Braun2016-08-161-1/+2
| | | | | | | | | | Clang added warning that taking the address of a packed struct member possibly yields an unaligned pointer. This case is benign because the pointer gets casted to an uptr and not used for unaligned accesses. Add an intermediate cast to char* until this warning is improved (see also https://reviews.llvm.org/D20561) llvm-svn: 278835
* [asan] abort_on_error=1 by default on Android.Evgeniy Stepanov2016-08-111-1/+1
| | | | | | | | | | | | | With this change, the default behavior on error is to call abort() instead of _exit(). This should help the OS to capture a tombstone of the error. RAM usage of the lit test suite goes up because of all the tombstone gathering, so I'm limiting the parallelism of the test target. Previously it was based on the number of the CPUs on the host machine, which is definitely wrong. llvm-svn: 278308
* [compiler-rt] Allow nm program to be over-ridden for global symbol detectionFrancis Ricci2016-08-101-2/+3
| | | | | | | | | | | | | | Summary: While cross-compiling, a custom nm program may be required. This will also allow for the use of llvm-nm if desired. Reviewers: samsonov, beanz, compnerd, eugenis Subscribers: kubabrecka, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D23278 llvm-svn: 278187
* [sanitizer] use 32-bit offset instead of 64-bit pointers in the 64-bit ↵Kostya Serebryany2016-08-095-29/+74
| | | | | | allocator's transfer batches. This saves 2x memory for the transfer batches (up to ~1.5% overall in some cases) llvm-svn: 278179
* [sanitizer] minor refactoring in the allocator, NFCKostya Serebryany2016-08-093-9/+8
| | | | llvm-svn: 278163
* [sanitizer] allocator: move TransferBatch into ↵Kostya Serebryany2016-08-065-100/+154
| | | | | | SizeClassAllocator64/SizeClassAllocator32 because we actually need different iplementations for the 64- and 32-bit case. NFC; the following patches will make the TransferBatch implementations differ llvm-svn: 277899
* Disable a few more flaky asan64 tests.Nico Weber2016-08-051-0/+12
| | | | llvm-svn: 277886
* Disable a few win asan64 tests that don't reliably pass, ↵Nico Weber2016-08-051-0/+12
| | | | | | https://reviews.llvm.org/D23230 llvm-svn: 277882
* [sanitizers] trace buffer API to use user-allocated buffer.Mike Aizatsky2016-08-052-14/+16
| | | | | | | | Subscribers: kubabrecka Differential Revision: https://reviews.llvm.org/D23186 llvm-svn: 277858
* Fix dumping of process module list and test itReid Kleckner2016-08-051-2/+2
| | | | | | I probably broke this a year ago in r243895. llvm-svn: 277842
* Print a more useful BP value from MSVC-built ASan runtimesReid Kleckner2016-08-051-3/+3
| | | | | | | | MSVC doesn't have an exact equivalent for __builtin_frame_address, but _AddressOfReturnAddress() + sizeof(void*) should be equivalent for all frames build with -fno-omit-frame-pointer. llvm-svn: 277826
* fix whitespaces from https://reviews.llvm.org/D23170Etienne Bergeron2016-08-041-2/+3
| | | | llvm-svn: 277746
* [compiler-rt] Fix memory allocator for dynamic address spaceEtienne Bergeron2016-08-043-5/+49
| | | | | | | | | | | | | | | | | | | | | | | Summary: The sanitizer allocators can works with a dynamic address space (i.e. specified with ~0ULL). Unfortunately, the code was broken on GetMetadata and GetChunkIdx. The current patch is moving the Win64 memory test to a dynamic address space. There is a migration to move every concept to a dynamic address space on windows. To have a better coverage, the unittest are now testing dynamic address space on other platforms too. Reviewers: rnk, kcc Subscribers: kubabrecka, dberris, llvm-commits, chrisha Differential Revision: https://reviews.llvm.org/D23170 llvm-svn: 277745
* [ASan] Report illegal instruction exceptions in ASanReid Kleckner2016-08-033-14/+1
| | | | | | | | | | | | | | | | | | | Summary: Respect the handle_sigill common flag and handle_segv flags while we're at it. We still handle signals/exceptions differently on Unix and Windows. The installation process is tricky on Windows, and difficult to push down into sanitizer_common without concerning it with the different static/dynamic CRT models on Windows. Reviewers: kcc, etienneb Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23098 llvm-svn: 277621
* [sanitizer] remove one redundant loop from the allocatorKostya Serebryany2016-08-031-5/+4
| | | | llvm-svn: 277563
* Reduce coverage PC buffer size on 32-bit Windows to match 32-bit LinuxReid Kleckner2016-08-031-3/+2
| | | | | | | | | | | | | | | | | | | | | In r235779, Timur bumped the buffer size up to 1<<27, or about 134 million coverage points, presumably to handle Chrome. We allocate two arrays of uptrs with this size, and this reliably exhausts all available address space on 32-bit Windows (2 allocations of 512MB) when ASan is also enabled. Let's reduce the buffer size for now to stabilize the test suite. We can re-evaluate the approach later when we've brought the Chrome ASan builders back to life. Kostya said that Mike reduced the number of instrumented coverage points that LLVM emits by half since Timur made this change, so reducing this array size should also be safe. With this change, the 32-bit ASan tests reliably pass for me on Windows 10. llvm-svn: 277558
* [sanitizer] refactor TransferBatch to hide the implementation. NFC expected. ↵Kostya Serebryany2016-08-034-25/+44
| | | | | | Second attempt after failed r276383 which was reverted. llvm-svn: 277554
* XFAIL one sanitizer symbolizer test for FreeBSDDimitry Andric2016-07-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Due to a QoI issuse in FreeBSD's libcxxrt-based demangler, one sanitizer symbolizer test consistently appears to fail: Value of: DemangleSwiftAndCXX("foo") Actual: "float" Expected: "foo" This is because libcxxrt's __cxa_demangle() incorrectly demangles the "foo" identifier to "float". It should return an error instead. For now, XFAIL this particular test for FreeBSD, until we can fix libcxxrt properly (which might take some time to coordinate with upstream). Reviewers: rnk, zaks.anna, emaste Subscribers: emaste, llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23001 llvm-svn: 277297
OpenPOWER on IntegriCloud