summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [NFC] Return on SANITIZER_MIPS && !IsValidFrameVitaly Buka2019-03-051-6/+6
| | | | llvm-svn: 355372
* [NFC] Put bp into Unwind(.. false) for consistencyVitaly Buka2019-03-051-2/+2
| | | | | | It's not used there anyway llvm-svn: 355371
* [NFC] Move asan_inited and size reset on top of ::UnwindImplVitaly Buka2019-03-051-16/+16
| | | | llvm-svn: 355370
* Revert "[NFC][Sanitizer] Cleanup ASan's GetStackTrace implementation"Vitaly Buka2019-03-052-19/+19
| | | | | | | | I've missed that UnwindSlow was removed from ScopedUnwinding. This reverts commit 4ce918e3942f0333ccb7d65d6265f4fc5f5324be. llvm-svn: 355369
* Revert compiler-rt diffs for order file instrumentation to get bot green!Manman Ren2019-03-057-129/+0
| | | | | | | | This caused issues on Linux/Windows and other platforms. r355343 355350 355350 llvm-svn: 355363
* Attemp to fix windows profile-rt build breakage.Manman Ren2019-03-051-0/+1
| | | | | | Followup to D57530. llvm-svn: 355357
* [NFC][Sanitizer] Cleanup ASan's GetStackTrace implementationJulian Lettner2019-03-052-19/+19
| | | | | | | | | | | | | | | | | | | | | Cleanup ASan's __sanitizer::BufferedStackTrace::UnwindImpl (formerly GetStackTrace) implementation. Start with ASan because it is the most complex implementation. GetStackTrace implementations seem to have started out as exact copies of the original implementation in ASan, but have diverged in subtle ways. My goal is to parameterize this algorithm (via templating or callbacks) so we can share the implementation and get rid of the inversed dependency (sanitizer_common depends on concrete implementations in asan, ubsan, etc.). This should also help us to avoid those pesky linker errors caused by undefined, duplicate, and weak symbols on Windows. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D58861 llvm-svn: 355355
* Attemp to fix build brokage due to D57530.Manman Ren2019-03-043-0/+11
| | | | | | By adding implementations for __llvm_profile_begin_orderfile for non-Darwin platforms. llvm-svn: 355350
* [msan] Instrument x86 BMI intrinsics.Evgeniy Stepanov2019-03-041-1/+147
| | | | | | | | | | | | | | | | Summary: They simply shuffle bits. MSan needs to do the same with shadow bits, after making sure that the shuffle mask is fully initialized. Reviewers: pcc, vitalybuka Subscribers: hiraditya, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58858 llvm-svn: 355348
* [sanitizer] Intercept bzero.Evgeniy Stepanov2019-03-042-2/+13
| | | | | | | | | | | | | | | | Summary: Intercept bzero and enable existing __bzero interceptor in Linux. bzero is deprecated but still used occasionally. Reviewers: vitalybuka Subscribers: srhines, kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58850 llvm-svn: 355347
* Order File Instrumentation: dump the data in compiler-rtManman Ren2019-03-044-0/+117
| | | | | | | | The profile data will be dumped in a file default_xxx.profraw.order. Differential Revision: https://reviews.llvm.org/D57530 llvm-svn: 355343
* Revert "[sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors."Evgeniy Stepanov2019-03-024-87/+65
| | | | | | | | | Breaks TSan on Mac, which does return REAL(func)(... in COMMON_INTERCEPTOR_ENTER, which is not OK when REAL(func) has return type of void. llvm-svn: 355256
* Revert "Revert "[sanitizers] Don't use Windows Trace Logging on MinGW""Vlad Tsyrklevich2019-03-022-3/+15
| | | | | | | This reverts my orignal revert in r355250, I misread the buildbot logs. Volodymyr's commit in r355244 fixed the build. llvm-svn: 355251
* Revert "[sanitizers] Don't use Windows Trace Logging on MinGW"Vlad Tsyrklevich2019-03-022-15/+3
| | | | | | | This reverts commits r355236 and r355244, they broke the Linux sanitizer build. llvm-svn: 355250
* [sanitizers] Fix build on macOS with LogFullErrorReport redefinition error.Volodymyr Sapsai2019-03-021-1/+1
| | | | | | | | | | | | | | | | macOS has implementation of LogFullErrorReport and INLINE void LogFullErrorReport(const char *buffer) {} was causing > compiler-rt/lib/sanitizer_common/sanitizer_mac.cc:658:6: error: redefinition of 'LogFullErrorReport' Fixup for r355236. rdar://problem/48526020 llvm-svn: 355244
* [NFC][Sanitizer] Replace last uses of old Unwind APIJulian Lettner2019-03-012-25/+24
| | | | | | | | | | | | | Replace remaining uses of old Unwind API in unit tests. Allows us to remove the old API and WillUseFastUnwind can be made private. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D58754 llvm-svn: 355242
* [sanitizers] Don't use Windows Trace Logging on MinGWMartin Storsjo2019-03-012-3/+15
| | | | | | | | | | | | | | | | | | | mingw-w64 currently is lacking the headers for this feature. Make the include lowercase at the same time. We consistently use lowercase for windows header includes, as windows itself is case insensitive, the SDK headers (in general, not necessarily considering this particular header) aren't consistent among themselves about what the proper canonical capitalization for headers are, and MinGW uses all lowercase names for the headers (as it is often used on case sensitive filesystems). In case mingw-w64 later gets this header, we can revert this (but keep the include lowercased). Differential Revision: https://reviews.llvm.org/D58765 llvm-svn: 355236
* [NFC][Sanitizer][Windows] Fix refactoring oversightJulian Lettner2019-03-011-1/+1
| | | | | | Fix mistake in previous commit: 9fe3b4906f351292691cd594b30fe6cf7230b94d llvm-svn: 355234
* [NFC][Sanitizer] Make GetStackTrace a private method of BufferedStackTraceJulian Lettner2019-03-017-52/+50
| | | | | | | | | | GetStackTrace is a implementation detail of BufferedStackTrace. Make it a private method. Reviewed By: vitalybuka Differential-Revision: https://reviews.llvm.org/D58753 llvm-svn: 355232
* [sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors.Evgeniy Stepanov2019-03-014-65/+87
| | | | llvm-svn: 355231
* Revert "[sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors."Evgeniy Stepanov2019-03-014-29/+21
| | | | | | This change is incomplete. llvm-svn: 355230
* [sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors.Evgeniy Stepanov2019-03-014-21/+29
| | | | | | They return void, unlike memset/memcpy/memmove. llvm-svn: 355225
* [msan] Add an interceptor for ttyname().Evgeniy Stepanov2019-03-012-0/+16
| | | | llvm-svn: 355214
* Reland "[compiler-rt] Intercept the bcmp() function."Clement Courbet2019-03-013-23/+57
| | | | | | | Fix test issues on darwin: The REQUIRES for the test should be the same as the guard for whether we intercept bcmp. llvm-svn: 355204
* [scudo][standalone] Fix tests makefileKostya Kortchinsky2019-03-011-2/+2
| | | | | | | | | | | | | | | | | | | | | Summary: A missing `STATIC` entailed some annoying to debug failures wrt 32 vs 64 binaries. Additionally I noticed I was using the wrong variable (the Scudo one as opposed to the Scudo Standalone one). See https://reviews.llvm.org/D58184#1412417 and below for discussion. Reviewers: vitalybuka, eugenis, brzycki Reviewed By: vitalybuka, brzycki Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58794 llvm-svn: 355203
* [sanitizers] Explicitly use GetModuleFileNameW with wchar_tMartin Storsjo2019-03-011-1/+1
| | | | | | | | Alternatively we could define the string as TCHAR. Differential Revision: https://reviews.llvm.org/D58766 llvm-svn: 355180
* [NFC][Sanitizer] Add new BufferedStackTrace::Unwind APIJulian Lettner2019-03-0112-78/+80
| | | | | | | | | | | | | | | | | | | | | Retrying without replacing call sites in sanitizer_common (which might not have a symbol definition). Add new Unwind API. This is the final envisioned API with the correct abstraction level. It hides/slow fast unwinder selection from the caller and doesn't take any arguments that would leak that abstraction (i.e., arguments like stack_top/stack_bottom). GetStackTrace will become an implementation detail (private method) of the BufferedStackTrace class. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58741 > llvm-svn: 355168 llvm-svn: 355172
* Revert "[NFC][Sanitizer] Add new BufferedStackTrace::Unwind API"Julian Lettner2019-03-0113-83/+88
| | | | | | This reverts commit 6112f37e758ebf2405955e091a745f5003c1f562. llvm-svn: 355171
* [NFC][Sanitizer] Add new BufferedStackTrace::Unwind APIJulian Lettner2019-03-0113-88/+83
| | | | | | | | | | | | | | | | Add new Unwind API. This is the final envisioned API with the correct abstraction level. It hides/slow fast unwinder selection from the caller and doesn't take any arguments that would leak that abstraction (i.e., arguments like stack_top/stack_bottom). GetStackTrace will become an implementation detail (private method) of the BufferedStackTrace class. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58741 llvm-svn: 355168
* [hwasan] Disable vfork code when building w/o interceptors.Evgeniy Stepanov2019-03-011-1/+1
| | | | | | Don't define vfork when OMPILER_RT_HWASAN_WITH_INTERCEPTORS=OFF. llvm-svn: 355165
* cfi: Rename source file from cc to cppNico Weber2019-02-282-2/+4
| | | | | | See discussion on https://reviews.llvm.org/D58620 for the review. llvm-svn: 355144
* [CMake][LibFuzzer] Match symbol visibility setting between LibFuzzer object ↵Dan Liew2019-02-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | files and unit tests. Summary: This fixes inconsistent symbol visibility. This shows up as a linker warning if r336238 (43f633564e338a6dde83d49a48e5bfcbfdce292c) is reverted. ``` ld: warning: direct access in function 'fuzzer::CleanseCrashInput(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, fuzzer::FuzzingOptions const&)' from file '/Volumes/data/dev/llvm/upstream/master/builds/projects/compiler-rt/lib/fuzzer/tests/libRTFuzzerTest.x86_64.a(FuzzerDriver.cpp.o)' to global weak symbol 'fuzzer::Command::ignoreRemainingArgs()::kIgnoreRemaining' from file 'FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings. ``` r336238 just hid the issue rather than fixing the real issue. On macOS and other platforms we usually compile with `-fvisibility=hidden` but the unit tests were compiled without this flag. Reviewers: george.karpenkov, kubamracek, kcc, yln Subscribers: mgorny, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58055 llvm-svn: 355143
* [hwasan] Fix vfork handling with large stack limit.Evgeniy Stepanov2019-02-281-3/+1
| | | | | | | | | | | Remove the maximum stack cleanup size check. With ulimit -s unlimited main thread stack can be very large, but we don't really have a choice other than cleaning all of it. It should be reasonably fast - hwasan cleans large shadow ranges with a single madvise call. This change fixes check-hwasan after ulimit -s unlimited. llvm-svn: 355137
* Revert "Revert "[sanitizers] Restore internal_readlink for x32""H.J. Lu2019-02-282-1/+9
| | | | | | | | | This reverts revision 354601 and disables ReadBinaryNameCached check on Windows since Windows has no working ReadBinaryName. Differential Revision: https://reviews.llvm.org/D58788 llvm-svn: 355129
* [sanitizer] Fix vfork interceptor on i386 w/ dynamic runtime.Evgeniy Stepanov2019-02-281-2/+16
| | | | | | | | PLT calls on i386 expect GOT base address in %ebx. This call does not need to go through PLT strictly speaking, but I'd rather avoid future surprises and implement the most general case. llvm-svn: 355125
* [PGO] Update InstrProfData.inc to sync with llvmRong Xu2019-02-281-0/+2
| | | | llvm-svn: 355119
* [NFC][Sanitizer] Weak linkage is not available on WindowsJulian Lettner2019-02-282-7/+14
| | | | | | | | | | | The concept of weak linkage is not available on Windows. The available workarounds in LLVM/sanitizer runtimes have their own problems. Define a separte symbol ubsan_GetStackTrace to work around the issue now. At lest this way it is painfully obvious that we still have to do more cleanup. Follow-up to revision: https://reviews.llvm.org/D58651 llvm-svn: 355113
* [sanitizer] Got rid of text relocations in i386 vfork interceptor.Evgeniy Stepanov2019-02-281-2/+6
| | | | llvm-svn: 355064
* Add username to TODO comment in sanitizer to satisfy sanitizer lint check. NFCDouglas Yung2019-02-281-1/+1
| | | | llvm-svn: 355062
* [NFC][TSan] Don't define GetStackTrace when compiling for GoJulian Lettner2019-02-281-0/+2
| | | | | | rdar://48455255 llvm-svn: 355053
* [NFC][Sanitizer] Use correct WEAK annotation to make Windows workJulian Lettner2019-02-281-1/+1
| | | | | | | The previous fix didn't work for Windows: https://github.com/llvm/llvm-project/commit/52b751088b11547e0f4ef0589ebbe5e57752c68c llvm-svn: 355052
* [Sanitizer] Attempt to fix linker error on ARM variantsJulian Lettner2019-02-272-11/+14
| | | | | | | Previous commit: https://github.com/llvm/llvm-project/commit/a0884da62a471f08c65a03e337aea23203a43eb8 llvm-svn: 355046
* [compiler-rt] Windows Trace Logging for error reports.Matthew G McGovern2019-02-272-2/+36
| | | | | | | | Adds option for collecting sanitixer dumps via trace logging. - Set log_to_syslog=1 to enable this output. - Consult https://aka.ms/windowstracelogging for details on use. llvm-svn: 355045
* [sanitizer] Fix compilation errors in r355030.Evgeniy Stepanov2019-02-275-5/+12
| | | | | | | | Disable hwasan interceptor on non-linux, non-x86-or-arm platforms. Add @plt to the asm call that clang intergrated-as infers but gcc does not. llvm-svn: 355041
* [NFC][Sanitizer] Pull up GetStackTrace into sanitizer_commonJulian Lettner2019-02-2713-108/+114
| | | | | | | | | | | | | | | | | | | | We already independently declare GetStackTrace in all (except TSan) sanitizer runtime headers. Lets move it to sanitizer_stacktrace.h to have one canonical way to fill in a BufferedStackFrame. Also enables us to use it in sanitizer_common itself. This patch defines GetStackTrace for TSan and moves the function from ubsan_diag.cc to ubsan_diag_standalone.cc to avoid duplicate symbols for the UBSan-ASan runtime. Other than that this patch just moves the code out of headers and into the correct namespace. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58651 llvm-svn: 355039
* Fixup compilation/test failures after r354960 and r355013.James Y Knight2019-02-271-4/+6
| | | | llvm-svn: 355034
* [hwasan, asan] Intercept vfork.Evgeniy Stepanov2019-02-2720-4/+284
| | | | | | | | | | | | | | | Summary: Intercept vfork on arm, aarch64, i386 and x86_64. Reviewers: pcc, vitalybuka Subscribers: kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58533 llvm-svn: 355030
* [NFC][Sanitizer] Hard-code fast/slow unwinder at call siteJulian Lettner2019-02-2710-25/+47
| | | | | | | | | | | | | Also assert that the caller always gets what it requested. This purely mechanical change simplifies future refactorings and eventual removal of BufferedStackTrace::Unwind. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58557 llvm-svn: 355022
* [libFuzzer][Windows] Port fork mode to WindowsJonathan Metzman2019-02-275-12/+77
| | | | | | | | | | | | | | | | | | | | | Summary: Port libFuzzer's fork mode to Windows. Implement Windows versions of MkDir, RmDir, and IterateDirRecursive to do this. Don't print error messages under new normal uses of FileSize (on a non-existent file). Implement portable way of piping output to /dev/null. Fix test for Windows and comment fork-sigusr.test on why it won't be ported to Win. Reviewers: zturner Reviewed By: zturner Subscribers: kcc, zturner, jdoerfert, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58513 llvm-svn: 355019
* Attempt to fix buildbot after r354972 [#1]. NFCI.Alexey Lapshin2019-02-271-2/+6
| | | | llvm-svn: 355013
OpenPOWER on IntegriCloud