summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
* [asan] don't use bool in public interface, make sure the interface headers ↵Kostya Serebryany2014-04-144-7/+7
| | | | | | are usable in plain C llvm-svn: 206160
* [asan] provide better reports for cases where memcpy/etc get negative size ↵Kostya Serebryany2014-04-145-1/+21
| | | | | | parameter. Also fix a typo found by Tetsuo Kiso llvm-svn: 206158
* tsan: serialize report printing in standalone deadlock detectorDmitry Vyukov2014-04-112-1/+2
| | | | | | otherwise reports get intermixed llvm-svn: 206043
* tsan: fix vector clocksDmitry Vyukov2014-04-1113-107/+152
| | | | | | | the new optimizations break when thread ids gets reused (clocks go backwards) add the necessary tests as well llvm-svn: 206035
* tsan: ignore interceptors from symbolizerDmitry Vyukov2014-04-111-0/+2
| | | | | | | ocassionally we see races coming from symbolizer interceptors (e.g. memcmp) reproducible only only on large complex programs llvm-svn: 206034
* [tsan] Fix false positive on xdr*_create.Evgeniy Stepanov2014-04-111-2/+2
| | | | llvm-svn: 206030
* [msan] mprotect() more memory to detect user code outside of application range.Evgeniy Stepanov2014-04-112-5/+6
| | | | llvm-svn: 206028
* Enable building of sanitizers on FreeBSDViktor Kutuzov2014-04-091-4/+4
| | | | llvm-svn: 205919
* Declare _DYNAMIC and dl_phdr_info in asan_linux.cc on FreeBSDViktor Kutuzov2014-04-091-1/+5
| | | | llvm-svn: 205852
* [sanitizer] Intercept a subset of sunrpc interface (xdr_*).Evgeniy Stepanov2014-04-044-1/+170
| | | | llvm-svn: 205627
* [msan] Introduce MsanThread. Move thread-local allocator cache out of TLS.Evgeniy Stepanov2014-04-0410-91/+291
| | | | | | This reduces .tbss from 109K down to almost nothing. llvm-svn: 205618
* [asan] fix a leak in __tls_get_addr handler; introduce a run-time flag to ↵Kostya Serebryany2014-04-044-21/+32
| | | | | | disable this handler completely; remove a workaround for a bug fixed in glibc llvm-svn: 205617
* [TSan] Fix a rare deadlock on multithreaded fork.Alexey Samsonov2014-04-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | If a multi-threaded program calls fork(), TSan ignores all memory accesses in the child to prevent deadlocks in TSan runtime. This is OK, as child is probably going to call exec() as soon as possible. However, a rare deadlocks could be caused by ThreadIgnoreBegin() function itself. ThreadIgnoreBegin() remembers the current stack trace and puts it into the StackDepot to report a warning later if a thread exited with ignores enabled. Using StackDepotPut in a child process is dangerous: it locks a mutex on a slow path, which could be already locked in a parent process. The fix is simple: just don't put current stack traces to StackDepot in ThreadIgnoreBegin() and ThreadIgnoreSyncBegin() functions if we're running after a multithreaded fork. We will not report any "thread exited with ignores enabled" errors in this case anyway. Submitting this without a testcase, as I believe the standalone reproducer is pretty hard to construct. llvm-svn: 205534
* [TSan] Fix a typo ThreadIgnoreSyncEnd. Found by inspectionAlexey Samsonov2014-04-031-1/+1
| | | | llvm-svn: 205531
* [ASan] Fix incompatible runtimes check: don't iterate /proc/self/maps on ↵Alexey Samsonov2014-04-021-17/+22
| | | | | | every call to __asan_init llvm-svn: 205418
* [msan] Kill __msan_print_param_shadow.Evgeniy Stepanov2014-04-022-9/+0
| | | | | | | It does not do what it's name says, and what it actually does is hard to describe, and is not useful at all. llvm-svn: 205415
* [msan] Add __msan_check_mem_is_initialized.Evgeniy Stepanov2014-04-022-0/+19
| | | | | | An assert()-like function that checks that a memory range is fully initialized. llvm-svn: 205413
* [msan] Precise origin handling in __unaligned_(load|store)*.Evgeniy Stepanov2014-04-024-35/+160
| | | | llvm-svn: 205412
* [ASan] One more attempt to fix Android buildAlexey Samsonov2014-04-021-7/+6
| | | | llvm-svn: 205411
* [msan] clang-format several unit testsEvgeniy Stepanov2014-04-021-25/+25
| | | | llvm-svn: 205410
* Move __addsf3 and __adddf3 into the corresponding blocks that defineJoerg Sonnenberger2014-04-011-2/+3
| | | | | | fp_t. llvm-svn: 205344
* [tsan] Remove an accidentally committed debug print.Alexander Potapenko2014-04-011-1/+0
| | | | llvm-svn: 205316
* Add support for IEEE754 quad precision comparison functions.Joerg Sonnenberger2014-04-011-0/+133
| | | | | | | | From GuanHong Liu. Differential Revision: http://llvm-reviews.chandlerc.com/D2797 llvm-svn: 205312
* [ASan] Fix Android buildAlexey Samsonov2014-04-011-0/+2
| | | | llvm-svn: 205311
* [ASan] Optional support for dynamic ASan runtime on Linux.Alexey Samsonov2014-04-017-6/+171
| | | | | | Based on http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov! llvm-svn: 205308
* Add FreeBSD support to sanitizers' procmaps facilitiesViktor Kutuzov2014-04-011-14/+63
| | | | llvm-svn: 205291
* Fix definition of the __sanitizer_passwd structure on FreeBSDViktor Kutuzov2014-04-011-2/+5
| | | | llvm-svn: 205290
* InstrProf: Add simple compiler-rt testDuncan P. N. Exon Smith2014-03-311-2/+0
| | | | | | | | | | Add the test infrastructure for testing lib/profile and a single test. This initial commit only enables the tests on Darwin, but they'll be enabled on Linux soon after. <rdar://problem/16458307> llvm-svn: 205256
* [msan] Remove an extra top frame from track-origins=2 reports.Evgeniy Stepanov2014-03-312-8/+12
| | | | llvm-svn: 205192
* [CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.Alexey Samsonov2014-03-3110-17/+16
| | | | | | | | Soon there will be an option to build compiler-rt parts as shared libraries on Linux. Extracted from http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov. llvm-svn: 205183
* [TSan] Replace several Printf() calls with Report() to ease debugging.Alexander Potapenko2014-03-311-7/+8
| | | | llvm-svn: 205175
* [sanitizer] speed up the bitvector-based deadlock detector by ~15% (iterate ↵Kostya Serebryany2014-03-313-19/+20
| | | | | | over the currently held locks using the array, not the bitvector. Bitvector is not the best data structure to iterate over) llvm-svn: 205168
* [sanitizer] Fix Mac build.Evgeniy Stepanov2014-03-281-3/+3
| | | | llvm-svn: 205006
* [sanitizer] Intercept fgetpwent / fgetgrent.Evgeniy Stepanov2014-03-285-44/+209
| | | | | | | | These interceptors require deep unpoisoning of return values. While at it, we do the same for all other pw/gr interceptors to reduce dependency on libc implementation details. llvm-svn: 205004
* [sanitizer] Intercept setpwent/endpwent.Evgeniy Stepanov2014-03-282-0/+35
| | | | | | | | It's hard to write a reliable test for this code because they work with unpredictable memory locations. But this change should fix current failures in getpwent() tests on the sanitizer bots. llvm-svn: 205002
* [sanitizer] Intercept rand_r.Evgeniy Stepanov2014-03-282-0/+14
| | | | llvm-svn: 205001
* [sanitizer] Intercept getpwent/getgrent.Evgeniy Stepanov2014-03-283-0/+132
| | | | llvm-svn: 205000
* Add instrastructure for IEEE quad precision.Joerg Sonnenberger2014-03-281-6/+114
| | | | | | | | Based on patch from GuanHong Liu. Differential Revision: http://llvm-reviews.chandlerc.com/D2796 llvm-svn: 204999
* [sanitizer] Intercept mktime.Evgeniy Stepanov2014-03-281-1/+16
| | | | llvm-svn: 204994
* [sanitizer] Intercept ftime.Evgeniy Stepanov2014-03-284-1/+31
| | | | llvm-svn: 204991
* [sanitizer] Intercept __bzero on Mac.Evgeniy Stepanov2014-03-272-1/+14
| | | | | | This should make memset_test pass on Mac. llvm-svn: 204929
* [sanitizer] Fix Android build.Evgeniy Stepanov2014-03-271-1/+1
| | | | llvm-svn: 204927
* [msan] Implement __msan_set_death_callback.Evgeniy Stepanov2014-03-274-0/+14
| | | | llvm-svn: 204926
* Add support for _expand[_dbg] so we don't crash when _aligned_* allocation ↵Timur Iskhodzhanov2014-03-272-0/+20
| | | | | | functions are used llvm-svn: 204925
* [msan] Intercept several malloc-related functions.Evgeniy Stepanov2014-03-274-9/+61
| | | | llvm-svn: 204923
* [asan] Do not sanitize kernel area on 32-bit targets, patch by Yuri GribovKostya Serebryany2014-03-273-3/+34
| | | | llvm-svn: 204897
* Add function to get the number of DFSan labels allocated.Peter Collingbourne2014-03-262-0/+10
| | | | | | | | | | Expose the number of DFSan labels allocated by adding function dfsan_get_label_count(). Patch by Sam Kerner! Differential Revision: http://llvm-reviews.chandlerc.com/D3109 llvm-svn: 204854
* Avoid aliases to weak aliases in interceptors.Rafael Espindola2014-03-262-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The interceptors had code that after macro expansion ended up looking like extern "C" void memalign() __attribute__((weak, alias("__interceptor_memalign"))); extern "C" void __interceptor_memalign() {} extern "C" void __interceptor___libc_memalign() __attribute__((alias("memalign"))); That is, * __interceptor_memalign is a function * memalign is a weak alias to __interceptor_memalign * __interceptor___libc_memalign is an alias to memalign Both gcc and clang produce assembly that look like __interceptor_memalign: ... .weak memalign memalign = __interceptor_memalign .globl __interceptor___libc_memalign __interceptor___libc_memalign = memalign What it means in the end is that we have 3 symbols pointing to the same position in the file, one of which is weak: 8: 0000000000000000 1 FUNC GLOBAL DEFAULT 1 __interceptor_memalign 9: 0000000000000000 1 FUNC WEAK DEFAULT 1 memalign 10: 0000000000000000 1 FUNC GLOBAL DEFAULT 1 __interceptor___libc_memalign In particular, note that __interceptor___libc_memalign will always point to __interceptor_memalign, even if we do link in a strong symbol for memalign. In fact, the above code produces exactly the same binary as extern "C" void memalign() __attribute__((weak, alias("__interceptor_memalign"))); extern "C" void __interceptor_memalign() {} extern "C" void __interceptor___libc_memalign() __attribute__((alias("__interceptor_memalign"))); If nothing else, this patch makes it more obvious what is going on. llvm-svn: 204823
* tsan: fix deadlock during forkDmitry Vyukov2014-03-261-3/+3
| | | | | | ReportRace takes the two mutexes in the opposite order llvm-svn: 204809
* tsan: fix another compiler-injected memsetDmitry Vyukov2014-03-261-1/+2
| | | | | | newer gcc inserts memset here llvm-svn: 204808
OpenPOWER on IntegriCloud