aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-04-18[builtins] Build x86_64 with GENERIC_TF_SOURCESHEADmastermainYi Kong
Change-Id: I59213ad8ee3c88ec55c821e0160310dd624cae54 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@358706 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-16[builtins] Add __cmpsf2 for ARM version of comparesf2Yi Kong
The generic version of comparesf2 defines __cmpsf2 alias for libgcc compatibility, but the ARM overlay is missing the alias. Differential Revision: https://reviews.llvm.org/D60805 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@358542 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-16[HWASan] Fixed slow DWARF unwinding.Mitch Phillips
Summary: CFA was setup incorrectly, as there is an 8-byte gap at the top of the stack for SP 16-byte alignment purposes. Reviewers: eugenis Reviewed By: eugenis Subscribers: kubamracek, javed.absar, #sanitizers, llvm-commits, pcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60798 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@358535 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20Make __cpu_model a hidden symbol, to match libgcc.Sterling Augustine
Also hide __cpu_inicator_init and __cpu_features2 for similar reasons. Summary: Make __cpu_model a hidden symbol, to match libgcc. Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59561 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@356581 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20[HWASan] Use less Printf() calls in register dump.Mitch Phillips
Summary: Explicitly print 4 registers/line in each iteration during register dump. Reduces logcat spam as we get a single logcat message per call to Printf(), even if the output isn't newline-terminated. This brings the output format in logcat closer to that of the normal textual dump. Reviewers: eugenis, pcc Reviewed By: pcc Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D59320 Change-Id: I84e48bb2ea11a32173faa39f8b742d0623449ebd git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@356166 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20Runtime flags for malloc bisection.Evgeniy Stepanov
Reviewers: kcc, pcc Subscribers: kubamracek, mgorny, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58162 Change-Id: I1c17d53f07f7954f670b675d9739d358348b1ac4 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354156 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-20Fix false positive when tag_in_malloc=0,tag_in_free=1.Evgeniy Stepanov
Summary: With tag_in_free=1, malloc() can not assume that the memory is untagged, and needs to retag is to 0. Reviewers: pcc, kcc Subscribers: kubamracek, jfb, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58158 Change-Id: I8e09206f2d1d9041457943ad8a3cd638cfbb8778 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354155 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-08[HWASan] Save + print registers when tag mismatch occurs in AArch64.Mitch Phillips
Summary: This change change the instrumentation to allow users to view the registers at the point at which tag mismatch occured. Most of the heavy lifting is done in the runtime library, where we save the registers to the stack and emit unwind information. This allows us to reduce the overhead, as very little additional work needs to be done in each __hwasan_check instance. In this implementation, the fast path of __hwasan_check is unmodified. There are an additional 4 instructions (16B) emitted in the slow path in every __hwasan_check instance. This may increase binary size somewhat, but as most of the work is done in the runtime library, it's manageable. The failure trace now contains a list of registers at the point of which the failure occured, in a format similar to that of Android's tombstones. It currently has the following format: Registers where the failure occurred (pc 0x0055555561b4): x0 0000000000000014 x1 0000007ffffff6c0 x2 1100007ffffff6d0 x3 12000056ffffe025 x4 0000007fff800000 x5 0000000000000014 x6 0000007fff800000 x7 0000000000000001 x8 12000056ffffe020 x9 0200007700000000 x10 0200007700000000 x11 0000000000000000 x12 0000007fffffdde0 x13 0000000000000000 x14 02b65b01f7a97490 x15 0000000000000000 x16 0000007fb77376b8 x17 0000000000000012 x18 0000007fb7ed6000 x19 0000005555556078 x20 0000007ffffff768 x21 0000007ffffff778 x22 0000000000000001 x23 0000000000000000 x24 0000000000000000 x25 0000000000000000 x26 0000000000000000 x27 0000000000000000 x28 0000000000000000 x29 0000007ffffff6f0 x30 00000055555561b4 ... and prints after the dump of memory tags around the buggy address. Every register is saved exactly as it was at the point where the tag mismatch occurs, with the exception of x16/x17. These registers are used in the tag mismatch calculation as scratch registers during __hwasan_check, and cannot be saved without affecting the fast path. As these registers are designated as scratch registers for linking, there should be no important information in them that could aid in debugging. Reviewers: pcc, eugenis Reviewed By: pcc, eugenis Subscribers: srhines, kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, hiraditya, jdoerfert, llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58857 Change-Id: I7efa8a42509e9e00ebdb5b6a0ddde8c6dc08ae7e git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355738 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-08[builtins] Rounding mode support for addxf3/subxf3Yi Kong
Implement rounding mode support for addxf3/subxf3. On architectures that implemented the support, this will access the corresponding floating point environment register to apply the correct rounding. For other architectures, it will keep the current behaviour and use IEEE-754 default rounding mode (to nearest, ties to even). ARM32/AArch64 support implemented in this change. i386 and AMD64 will be added in a follow up change. Change-Id: Idd8044ffb121e82d1ec2160b11cfcf5b5805167d
2019-03-05Fix unsymbolized stack history printing.Evgeniy Stepanov
Summary: When symbols are unavailable, the current code prints sp: ... pc: ... (null) (null) instead of module name + offset. Change the output to include module name and offset, and also to match the regular sanitizer stack trace format so that it is recognized by symbolize.py out of the box. Reviewers: kcc, pcc Subscribers: kubamracek, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58267 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354157 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05[hwasan] Disable vfork code when building w/o interceptors.Evgeniy Stepanov
Don't define vfork when OMPILER_RT_HWASAN_WITH_INTERCEPTORS=OFF. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355165 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05[hwasan] Fix vfork handling with large stack limit.Evgeniy Stepanov
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355137 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05[sanitizer] Fix vfork interceptor on i386 w/ dynamic runtime.Evgeniy Stepanov
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355125 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05[sanitizer] Got rid of text relocations in i386 vfork interceptor.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355064 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05[sanitizer] Fix compilation errors in r355030.Evgeniy Stepanov
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355041 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04[hwasan, asan] Intercept vfork.Evgeniy Stepanov
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 Change-Id: I40a534cf1539f256bcba769360d0adf6ae16e3ab git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355030 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04[sanitizer] Common macro for .note.GNU-stack directives (NFC)Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354632 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-02Revert "Add option to disable linking of libcxx into fuzzer"Pirama Arumuga Nainar
Bug: http://b/123257989 This reverts commit 70375fadea305578c21ccafd51af55032964788e. This change has been unnecessary ever since r334144, where linking of libcxx into libfuzzer was restricted to Linux and Fuchsia.
2019-03-01Merge 00d38a06e4 for LLVM update to 353983Yi Kong
Change-Id: I8413b4a1839487444fc6255c61fff89c27303dae
2019-03-01revert to previous base llvm-svn.349610Yi Kong
Change-Id: I08740d76c18c91e87f643871953c6feae0081289
2019-02-13 Dmitry Vyukov
tsan: add fiber support This patch adds functions for managing fibers: __tsan_get_current_fiber() __tsan_create_fiber() __tsan_destroy_fiber() __tsan_switch_to_fiber() __tsan_set_fiber_name() See the added tests for use examples. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D54889 [The previous commit of this change was reverted, this is a resubmit with a squashed fix for check_analyze.sh and COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED] git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353947 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13Revert "tsan: update check_analyze.sh"Diana Picus
This reverts commit r353820, to go with the revert of r353817. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353942 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13Revert "tsan: add fiber support"Diana Picus
This reverts commit r353817 because we think it broke AARch64 and PowerPC buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353939 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[profile] Provide lprofGetHostName for all windows environmentsMartin Storsjo
This function doesn't use anything MSVC specific but works fine for any _WIN32 target. Differential Revision: https://reviews.llvm.org/D58106 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353918 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[CMake] Avoid clang dependencies in the runtimes buildPetr Hosek
Dependencies like clang aren't available in the runtimes build, this was accidentally omitted in D57992. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353914 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[libFuzzer] a bit of refactoring of the fork modeKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353910 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[Sanitizer][NFC] Darwin: limit parallism for sanitizer_common testsJulian Lettner
Many sanitizer_common tests (ASan, TSan) run with a "sanitized process space" so we need to limit their parallism. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353909 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13[xray][tests][RHDTS] Add -lstdc++ after LLVM libs, resolving link error with ↵Hubert Tong
RHDTS Summary: A link error was encountered when using the Red Hat Developer Toolset. In the RHDTS, `libstdc++.so` is a linker script that may resolve symbols to a static library. This patch places `-lstdc++` later in the ordering. Reviewers: sfertile, nemanjai, tstellar, dberris Reviewed By: dberris Subscribers: dberris, mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58144 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353905 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[tsan] #undef one-letter macrosEvgeniy Stepanov
buildgo.sh puts most of sanitizer_common together in a single source file. These single-letter macros end up affecting a lot of unrelated code; #undef them as early as possible. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353902 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[libFuzzer] move the implementation of the fork mode into a separate fileKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353891 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12tsan: update check_analyze.shDmitry Vyukov
Update numbers after 353817. This was extensively benchmarked in https://reviews.llvm.org/D54889 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353820 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12tsan: add fiber supportDmitry Vyukov
This patch adds functions for managing fibers: __tsan_get_current_fiber() __tsan_create_fiber() __tsan_destroy_fiber() __tsan_switch_to_fiber() __tsan_set_fiber_name() See the added tests for use examples. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D54889 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353817 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12tsan: Introduce in_symbolizer() function for Thread sanitizerDmitry Vyukov
This change is preparation for fiber support. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D58104 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353805 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[CMake] Avoid internal dependencies in the runtimes buildPetr Hosek
When performing runtimes build, dependencies like clang and clang-headers aren't available. This was accidentally omitted in D57992. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353796 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[libFuzzer] make the fork mode less verboseKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353794 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[libFuzzer] teach the fork mode to ignore OOMs and timeoutsKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353792 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[sanitizer] Don't compile GetPathAssumingFileIsRelativeToExec on FuchsiaPetr Hosek
This avoids the unused function warning during compilation. Differential Revision: https://reviews.llvm.org/D58082 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353787 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[CMake][XRay] Silence llvm-config error when checking library supportPetr Hosek
Otherwise this propagates all the way to CMake and results in an error during configuration. We check and handle the result and report warning separately so this is not changing the behavior. Differential Revision: https://reviews.llvm.org/D58086 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353784 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[libFuzzer] replace slow std::mt19937 with a much faster std::minstd_rand; ↵Kostya Serebryany
second attempt after failed r352732, this time with a fix for cmake git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353782 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[libFuzzer] simplify the code for print_coverage=1 so that it doesn't fail ↵Kostya Serebryany
on broken debug info git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353781 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[libFuzzer] Make coverage.test work on ARM64Julian Lettner
Summary: This test instruments the following code with coverage, runs the fuzzer once, and asserts that there are uncovered PCs. The ARM64 backend optimizes this code using the `csel` (Conditional select) instruction, which removes all branching from the resulting machine code. The test then fails because we do not have any uncovered PCs. The easiest solution for now is to turn off optimization for the DSOs used in this test. ``` int DSO1(int a) { if (a < 123456) return 0; return 1; } ``` rdar://47646400 Reviewers: kcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58087 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353780 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[libFuzzer] run the -fork=1 tests only on linuxKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353777 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12[libFuzzer] extend the -fork=1 functionality. Still not fully usable, but ↵Kostya Serebryany
good enough for the first unit test git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353775 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11[NFC] Re-enable XFAILed fuzzer test on iOSJulian Lettner
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353737 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-09tsan: Implement pthread_exit() interceptor for Thread sanitizerVitaly Buka
This change is preparation for fiber support. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D57876 Context: https://reviews.llvm.org/D54889 llvm-svn: 353385 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353627 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-09[tsan] Remove debug logging and disable test on ppc64beVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353624 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-09[tsan] Remove debug logging and disable test on ppc64beVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353623 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-09[tsan] Debug failing test on PPC botVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353617 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-09[tsan] Remove pthread_exit interceptorVitaly Buka
Crashes PPC bot git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353604 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-09[CMake] Don't set <PROJECT>_STANDALONE_BUILDPetr Hosek
We shouldn't be treating runtimes builds as standalone builds since we have enough of the context loaded into the runtimes environment. Differential Revision: https://reviews.llvm.org/D57992 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353601 91177308-0d34-0410-b5e6-96231b3b80d8