summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[TSan] Improve handling of stack pointer mangling in {set,long}jmp, ↵Julian Lettner2019-07-092-51/+10
| | | | | | | | pt.8" This reverts commit 521f77e6351fd921f5a81027c7c72addca378989. llvm-svn: 365534
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.8Julian Lettner2019-07-092-10/+51
| | | | | | | | | | | | Refine longjmp key management. For Linux, re-implement key retrieval in C (instead of assembly). Removal of `InitializeGuardPtr` and a final round of cleanups will be done in the next commit. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D64092 llvm-svn: 365513
* [sanitizers][windows] FIX: Rtl-Heap Interception and testsMatthew G McGovern2019-07-0915-16/+16
| | | | | | | | | | | | - Adds interceptors for Rtl[Allocate|Free|Size|ReAllocate]Heap - Adds unit tests for the new interceptors and expands HeapAlloc tests to demonstrate new functionality. Reviewed as D62927 - adds fixes for ~win and x64 tests > llvm-svn: 365381 llvm-svn: 365424
* [sanitizers][windows] Rtl-Heap Interception and testsMatthew G McGovern2019-07-0925-55/+1081
| | | | | | | | | - Adds interceptors for Rtl[Allocate|Free|Size|ReAllocate]Heap - Adds unit tests for the new interceptors and expands HeapAlloc tests to demonstrate new functionality. Reviewed as D62927 llvm-svn: 365422
* [TSan] Fix linker error for Linux/AArch64Julian Lettner2019-07-091-1/+3
| | | | llvm-svn: 365415
* [Sanitizers] Remove clang_rt.sancov_{begin,end} on SolarisRainer Orth2019-07-083-42/+0
| | | | | | | | | | | | | | | | There's no point to manually create the __start___sancov_guards and __stop___sancov_guards sections and labels on Solaris any longer. They were originally introduced in https://reviews.llvm.org/D40899 and https://reviews.llvm.org/D40903. - The Solaris 11.4 ld supports creating them out of the box. - We already unconditionally use Solaris 11.4 features like the ld -z gnu-version-script-compat option and fully working .preinit_array support in compiler-rt. - The current files don't assemble on SPARC because the assembler syntax may be different between /bin/as and GNU as. Tested on amd64-pc-solaris2.11. Differential Revision: https://reviews.llvm.org/D63601 llvm-svn: 365399
* Revert "[sanitizers][windows] Rtl-Heap Interception and tests"JF Bastien2019-07-0825-1081/+55
| | | | | | | | | | | | | | | | | | | | | | | | Causes build failure on clang-ppc64be-linux-lnt: compiler-rt/lib/asan/asan_malloc_win.cc:23:2: error: #error "Missing arch or unsupported platform for Windows." #error "Missing arch or unsupported platform for Windows." ^~~~~ compiler-rt/lib/asan/asan_malloc_win.cc:25:10: fatal error: heapapi.h: No such file or directory #include <heapapi.h> ^~~~~~~~~~~ compilation terminated. [39/1151] Building CXX object projects/compiler-rt/lib/asan/CMakeFiles/RTAsan.powerpc64.dir/asan_debugging.cc.o [40/1151] Building CXX object projects/compiler-rt/lib/asan/CMakeFiles/RTAsan.powerpc64.dir/asan_malloc_win.cc.o FAILED: projects/compiler-rt/lib/asan/CMakeFiles/RTAsan.powerpc64.dir/asan_malloc_win.cc.o /usr/bin/c++ -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iprojects/compiler-rt/lib/asan -Icompiler-rt/lib/asan -Iinclude -I/home/buildbots/ppc64be-clang-lnt-test/clang-ppc64be-lnt/llvm/include -Icompiler-rt/lib/asan/.. -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -std=c++11 -Wno-unused-parameter -O2 -UNDEBUG -m64 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -fno-lto -O3 -g -Wno-variadic-macros -Wno-non-virtual-dtor -fno-rtti -MD -MT projects/compiler-rt/lib/asan/CMakeFiles/RTAsan.powerpc64.dir/asan_malloc_win.cc.o -MF projects/compiler-rt/lib/asan/CMakeFiles/RTAsan.powerpc64.dir/asan_malloc_win.cc.o.d -o projects/compiler-rt/lib/asan/CMakeFiles/RTAsan.powerpc64.dir/asan_malloc_win.cc.o -c compiler-rt/lib/asan/asan_malloc_win.cc compiler-rt/lib/asan/asan_malloc_win.cc:23:2: error: #error "Missing arch or unsupported platform for Windows." #error "Missing arch or unsupported platform for Windows." ^~~~~ compiler-rt/lib/asan/asan_malloc_win.cc:25:10: fatal error: heapapi.h: No such file or directory #include <heapapi.h> ^~~~~~~~~~~ llvm-svn: 365384
* [sanitizers][windows] Rtl-Heap Interception and testsMatthew G McGovern2019-07-0825-55/+1081
| | | | | | | | | - Adds interceptors for Rtl[Allocate|Free|Size|ReAllocate]Heap - Adds unit tests for the new interceptors and expands HeapAlloc tests to demonstrate new functionality. Reviewed as D62927 llvm-svn: 365381
* Revert "[TSan] Attempt to fix iOS on-device test"Julian Lettner2019-07-081-4/+7
| | | | | | This reverts commit a2ca358291a3a621bfae66eeb01f51eeb69d2dd4. llvm-svn: 365375
* Revert "[TSan] Attempt to fix linker error for Linux on AArch64"Julian Lettner2019-07-082-1/+9
| | | | | | This reverts commit be4148062b155f3be52e0f6ebcb228f2dc137dcf. llvm-svn: 365367
* [ubsan][test] Fix cast-overflow.cpp and delete float-divide-by-zero test ↵Fangrui Song2019-07-082-2/+1
| | | | | | after D63793/rC365272 llvm-svn: 365307
* [ubsan][test] Fix several UBSan-* :: TestCases/ImplicitConversion tests on ↵Rainer Orth2019-07-086-120/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Solaris A couple of UBSan-* :: TestCases/ImplicitConversion testcases FAIL on Solaris/x86 (and Solaris/SPARC with https://reviews.llvm.org/D40900): FAIL: UBSan-AddressSanitizer-i386 :: TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c (49187 of 49849) ******************** TEST 'UBSan-AddressSanitizer-i386 :: TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c' FAILED ******************** [...] Command Output (stderr): -- /vol/llvm/src/compiler-rt/local/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c:53:11: error: CHECK: expected string not found in input // CHECK: {{.*}}signed-integer-truncation-or-sign-change-blacklist.c:[[@LINE-1]]:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed) ^ <stdin>:1:1: note: scanning from here /vol/llvm/src/compiler-rt/local/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c:52:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int8_t' (aka 'char') changed the value to -1 (8-bit, signed) ^ <stdin>:1:1: note: with "@LINE-1" equal to "52" /vol/llvm/src/compiler-rt/local/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c:52:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int8_t' (aka 'char') changed the value to -1 (8-bit, signed) ^ <stdin>:1:69: note: possible intended match here /vol/llvm/src/compiler-rt/local/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c:52:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int8_t' (aka 'char') changed the value to -1 (8-bit, signed) ^ This is always a difference for int8_t where signed char is expected, but only char seen. I could trace this to <sys/int_types.h> which has /* * Basic / Extended integer types * * The following defines the basic fixed-size integer types. * * Implementations are free to typedef them to Standard C integer types or * extensions that they support. If an implementation does not support one * of the particular integer data types below, then it should not define the * typedefs and macros corresponding to that data type. Note that int8_t * is not defined in -Xs mode on ISAs for which the ABI specifies "char" * as an unsigned entity because there is no way to define an eight bit * signed integral. */ #if defined(_CHAR_IS_SIGNED) typedef char int8_t; #else #if defined(__STDC__) typedef signed char int8_t; #endif #endif _CHAR_IS_SIGNED is always defined on both sparc and x86. Since it seems ok to have either form, I've changed the affected tests to use '{{(signed )?}}char' instead of 'signed char'. Tested on x86_64-pc-solaris2.11, sparcv9-sun-solaris2.11, and x86_64-pc-linux-gnu. Differential Revision: https://reviews.llvm.org/D63984 llvm-svn: 365303
* [ubsan][test] Don't disable ubsan testing on 64-bit Solaris/x86Rainer Orth2019-07-082-8/+4
| | | | | | | | | | | Unlike asan, which isn't supported yet on 64-bit Solaris/x86, there's no reason to disable ubsan. This patch does that, but keeps the 64-bit ubsan-with-asan tests disabled. Tested on x86_64-pc-solaris2.11. Differential Revision: https://reviews.llvm.org/D63982 llvm-svn: 365302
* [TSan] Attempt to fix iOS on-device testJulian Lettner2019-07-061-4/+4
| | | | llvm-svn: 365257
* XFAIL a few failing TSan-fiber tests for iOSJulian Lettner2019-07-055-0/+5
| | | | llvm-svn: 365254
* Remove `XFAIL: ios` from test that passes in CIJulian Lettner2019-07-051-1/+0
| | | | llvm-svn: 365253
* Revert "[TSan] Improve handling of stack pointer mangling in {set,long}jmp, ↵Julian Lettner2019-07-051-4/+32
| | | | | | | | pt.4" This reverts commit 6bb13da7c16f2a677cc285bb6ffeb79dfb0cfe64. llvm-svn: 365244
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.5Julian Lettner2019-07-051-39/+4
| | | | | | | | | | Remove unnecessary computation of mangled SP for ARM64 architecture. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D64022 llvm-svn: 365230
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.4Julian Lettner2019-07-051-32/+4
| | | | | | | | | | | For x86_64, since we don't clobber %rsi (2nd argument) anymore, we don't have to save/restore it. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D63946 llvm-svn: 365229
* [scudo][standalone] Link tests against libatomicKostya Kortchinsky2019-07-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Some clang versions (< 6.0) do not inline the atomic builtin functions leaving unresolved references to `__atomic_load_8` and so on (seems to be mostly 64-bit atomics on 32-bit platforms). I tried without success to use some cmake magic to detect when that would be the case, and decided to fall back to unconditionally linking libatomic. Reviewers: morehouse, eugenis, vitalybuka, hctim, tejohnson Reviewed By: tejohnson Subscribers: mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D64134 llvm-svn: 365052
* [scudo][standalone] Potential fix for missing sized deleteKostya Kortchinsky2019-07-032-1/+4
| | | | | | | | | | | | | | | | | | | | | Summary: In some setups, using `-fsized-deallocation` would end up not finding a sized delete operator at link time. For now, avoid using the flag and declare the sized delete operator in the cpp test only. This is a tentative fix as I do not have the failing setup. Reviewers: rnk, morehouse, hctim, eugenis, vitalybuka Reviewed By: rnk, hctim Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D64086 llvm-svn: 365045
* Attempt #2 to fix gcc builds. This time checkMitch Phillips2019-07-021-1/+1
| | | | | | against CXX compiler ID instead of CRT test ID. llvm-svn: 364975
* Only use -mno-omit-leaf-frame-pointer with clang builds.Mitch Phillips2019-07-021-2/+4
| | | | | | Fix build breakage caused by D64085 llvm-svn: 364972
* [GWP-ASan] [Scudo] Add GWP-ASan backtrace for alloc/free to Scudo.Mitch Phillips2019-07-022-2/+11
| | | | | | | | | | | | | | | | | | | | | Summary: Adds allocation and deallocation stack trace support to Scudo. The default provided backtrace library for GWP-ASan is supplied by the libc unwinder, and is suitable for production variants of Scudo. If Scudo in future has its own unwinder, it may choose to use its own over the generic unwinder instead. Reviewers: cryptoad Reviewed By: cryptoad Subscribers: kubamracek, mgorny, #sanitizers, llvm-commits, morehouse, vlad.tsyrklevich, eugenis Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D64085 llvm-svn: 364966
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.7Julian Lettner2019-07-024-29/+36
| | | | | | | | | | | Factor out `ExtractLongJmpSp` helper function and move platform-specific code to tsan_platform_{linux,mac}.cc. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D64050 llvm-svn: 364947
* [GWP-ASan] Add generic unwinders and structure backtrace output.Mitch Phillips2019-07-0224-137/+434
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds two flavours of generic unwinder and all the supporting cruft. If the supporting allocator is okay with bringing in sanitizer_common, they can use the fast frame-pointer based unwinder from sanitizer_common. Otherwise, we also provide the backtrace() libc-based unwinder as well. Of course, the allocator can always specify its own unwinder and unwinder-symbolizer. The slightly changed output format is exemplified in the first comment on this patch. It now better incorporates backtrace information, and displays allocation details on the second line. Reviewers: eugenis, vlad.tsyrklevich Reviewed By: eugenis, vlad.tsyrklevich Subscribers: srhines, kubamracek, mgorny, cryptoad, #sanitizers, llvm-commits, morehouse Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D63841 llvm-svn: 364941
* [Sanitizers] Remove obsolete OpenFile from sanitizer_solaris.ccRainer Orth2019-07-021-5/+0
| | | | | | | | | | | I noticed that the instance of OpenFile in sanitizer_solaris.cc is no longer needed. Removed as follows, tested on x86_64-pc-solaris2.11. Differential Revision: https://reviews.llvm.org/D63764 llvm-svn: 364892
* Revert Remove scudo standalone tests from check-allReid Kleckner2019-07-011-2/+0
| | | | | | | | This reverts r364877 (git commit dfae3705b75e6b5e1e163c78ab2df705a3388d89) This didn't solve my problem so I've reverted it. llvm-svn: 364878
* Remove scudo standalone tests from check-allReid Kleckner2019-07-011-0/+2
| | | | | | | | | They appear to fail to link in various 32-bit configurations for unknown reasons. This change was already reverted, and it seems preferable to me to make forward progress and remove this once the problems are fully understood. llvm-svn: 364877
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.3Julian Lettner2019-07-012-36/+8
| | | | | | | | | | Remove unnecessary computation of mangled SP for x86_64 architecture. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D63944 llvm-svn: 364874
* [TSan] Fix initialized and declared ‘extern’ warningJulian Lettner2019-07-011-2/+5
| | | | | | | | | | | | Avoid the following warning which fails a bot (via -Werror). ``` /tmp/gotsan.JfrpVPu7pG/gotsan.cc:10456:25: error: ‘_tsan_pointer_chk_guard’ initialized and declared ‘extern’ [-Werror] extern "C" __tsan::uptr _tsan_pointer_chk_guard = 0; ^~~~~~~~~~~~~~~~~~~~~~~ ``` llvm-svn: 364823
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.2Julian Lettner2019-07-012-8/+4
| | | | | | | | | | | | Switch `LongJmp` over to lookup JmpBuf via plain old (unmangled) SP. This makes the computation of mangled SPs in the TSan assembly files unnecessary, which will be cleaned up in follow-up revisions. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D63942 llvm-svn: 364818
* [TSan] Attempt to fix linker error for Linux on AArch64Julian Lettner2019-06-292-9/+2
| | | | | | Introduced in 5be69ebe121d5b6ea284c3dc6d1cd5098c94f353. llvm-svn: 364700
* [TSan] Fix build build breakage on AndroidJulian Lettner2019-06-281-1/+1
| | | | | | Introduced in 5be69ebe121d5b6ea284c3dc6d1cd5098c94f353. llvm-svn: 364676
* [TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.1Julian Lettner2019-06-284-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TSan needs to infer which calls to setjmp/longjmp are corresponding pairs. My understanding is, that we can't simply use the jmp_buf address, since this buffer is just a plain data structure storing the environment (registers) with no additional semantics, i.e., it can be copied around and is still expected to work. So we use the stack pointer (SP) instead. The setjmp interceptor stores some metadata, which is then consumed in the corresponding call to longjmp. We use the SP as an "index" (stable identifier) into the metadata table. So far so good. However, when mangling is used, the setjmp interceptor observes the UNmangled SP, but the longjmp interceptor only knows the mangled value for SP. To still correlate corresponding pairs of calls, TSan currently derives the mangled representation in setjmp and uses it as the stable identifer, so that longjmp can do it's lookup. Currently, this works since "mangling" simply means XOR with a secret value. However, in the future we want to use operations that do not allow us to easily go from unmangled -> mangled (pointer authentication). Going from mangled -> unmangled should still be possible (for pointer authentication it means zeroing a few bits). This patch is part 1 of changing set/longjmp interceptors to use the unmangled SP for metadata lookup. Instead of deriving the mangled SP in setjmp, we will derive the unmangled SP in longjmp. Since this change involves difficult-to-test code, it will be done in (at least) 2 parts: This patch only replicates the existing behavior and checks that the newly computed value for SP matches with what we have been doing so far. This should help me to fix issues on architectures I cannot test directly. I tested this patch on x86-64 (Linux/Darwin) and arm64 (Darwin). This patch will also address an orthogonal issue: there is a lot of code duplication in the assembly files, because the `void __tsan_setjmp(uptr sp, uptr mangled_sp)` already demands the mangled SP. This means that the code for computing the mangled SP is duplicated at every call site (in assembly). Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D60981 llvm-svn: 364662
* hwasan: Fix an off-by-one error in PrintTagsAroundAddr.Peter Collingbourne2019-06-271-1/+1
| | | | | | | | Previously we were printing 16 rows of tags, not 17. Differential Revision: https://reviews.llvm.org/D63906 llvm-svn: 364609
* hwasan: Teach the runtime to identify the local variable being accessed in ↵Peter Collingbourne2019-06-2711-85/+250
| | | | | | | | | | | | | | UAR reports. Each function's PC is recorded in the ring buffer. From there we can access the function's local variables and reconstruct the tag of each one with the help of the information printed by llvm-symbolizer's new FRAME command. We can then find the variable that was likely being accessed by matching the pointer's tag against the reconstructed tag. Differential Revision: https://reviews.llvm.org/D63469 llvm-svn: 364607
* [libFuzzer] Migrate to the new exception syscalls on FuchsiaPetr Hosek2019-06-271-26/+28
| | | | | | | | | This is part of the transition to the new Fuchsia exception syscalls signature. Differential Revision: https://reviews.llvm.org/D63897 llvm-svn: 364594
* [sanitizer_common] Switch from zx_clock_get_new to zx_clock_getPetr Hosek2019-06-271-1/+1
| | | | | | | | | This is part of the soft-transition to the new system call name. These two system calls are the same so this change is no-op. Differential Revision: https://reviews.llvm.org/D63895 llvm-svn: 364593
* [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.*Reid Kleckner2019-06-27105-115/+115
| | | | | | | | | | | | | These lit configuration files are really Python source code. Using the .py file extension helps editors and tools use the correct language mode. LLVM and Clang already use this convention for lit configuration, this change simply applies it to all of compiler-rt. Reviewers: vitalybuka, dberris Differential Revision: https://reviews.llvm.org/D63658 llvm-svn: 364591
* [scudo][standalone] Introduce the C & C++ wrappers [fixed]Kostya Kortchinsky2019-06-2713-37/+921
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a redo of D63612. Two problems came up on some bots: - `__builtin_umull_overflow` was not declared. This is likely due to an older clang or gcc, so add a guard with `__has_builtin` and fallback to a division in the event the builtin doesn't exist; - contradicting definition for `malloc`, etc. This is AFAIU due to the fact that we ended up transitively including `stdlib.h` in the `.inc` due to it being the flags parser header: so move the include to the cc instead. This should fix the issues, but since those didn't come up in my local tests it's mostly guesswork. Rest is the same! Reviewers: morehouse, hctim, eugenis, vitalybuka, dyung, hans Reviewed By: morehouse, dyung, hans Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63831 llvm-svn: 364547
* [GWP-ASan] D63736 broke ARMv7/v8 sanitizer bots.Mitch Phillips2019-06-261-1/+1
| | | | | | | | Remove ARM32/ARM64 support for GWP-ASan due to a strange SEGV when running scudo's preinit.c test. Disabling to make the bots go green while investigating. llvm-svn: 364486
* Revert r364332 "[scudo][standalone] Introduce the C & C++ wrappers"Hans Wennborg2019-06-2611-909/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes the build fail with e.g. llvm/projects/compiler-rt/lib/scudo/standalone/wrappers_c.inc:20:68: error: declaration of 'void* calloc(size_t, size_t)' has a different exception specifier INTERFACE WEAK void *SCUDO_PREFIX(calloc)(size_t nmemb, size_t size) { ^ See llvm-commits thread. > Summary: > This CL adds C & C++ wrappers and associated tests. Those use default > configurations for a Scudo combined allocator that will likely be > tweaked in the future. > > This is the final CL required to have a functional C & C++ allocator > based on Scudo. > > The structure I have chosen is to define the core C allocation > primitives in an `.inc` file that can be customized through defines. > This allows to easily have 2 (or more) sets of wrappers backed by > different combined allocators, as demonstrated by the `Bionic` > wrappers: one set for the "default" allocator, one set for the "svelte" > allocator. > > Currently all the tests added have been gtests, but I am planning to > add some more lit tests as well. > > Reviewers: morehouse, eugenis, vitalybuka, hctim, rengolin > > Reviewed By: morehouse > > Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits > > Tags: #llvm, #sanitizers > > Differential Revision: https://reviews.llvm.org/D63612 llvm-svn: 364400
* [compiler-rt][test] Set shared_libasan_path in test/asan/lit.cfg on SolarisRainer Orth2019-06-261-1/+1
| | | | | | | | | | | | While checking warnings from the Solaris buildbots, I noticed llvm-lit: /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/projects/compiler-rt/test/asan/lit.cfg:119: warning: %shared_libasan substitution not set but dynamic ASan is available. Fixed as follows. Tested on x86_64-pc-solaris2.11. Differential Revision: https://reviews.llvm.org/D63761 llvm-svn: 364394
* Follow up fix for r364366.Dan Liew2019-06-261-1/+1
| | | | | | | | | When setting the parallelism group support MSan and use a syntactically compact condition. rdar://problem/51754620 llvm-svn: 364369
* Add USan+ASan and UBSan+TSan tests to shadow-memory lit parallelism group.Dan Liew2019-06-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously we were running these tests without the "shadow-memory" lit parallelism group even though we run the ASan and TSan tests in this group to avoid problems with many processes using shadow memory in parallel. On my local machine the UBSan+TSan tests would previously timeout if I set a 30 second per test limit. With this change I no longer see individual test timeouts. This change was made in response to the greendragon build bot reporting individual test timeouts for these tests. Given that the UBSan+ASan and UBSan+TSan tests did not have a parallelism group previously it's likely that some other change has caused the performance degradation. However I haven't been able to track down the cause so until we do, this change seems reasonable and is in line with what we already do with ASan and TSan tests. rdar://problem/51754620 Reviewers: yln, kubamracek, vsk, samsonov Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D63797 llvm-svn: 364366
* [GWP-ASan] Guard against recursive allocs. Pack TLS for perf.Mitch Phillips2019-06-252-15/+51
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Add a recursivity guard for GPA::allocate(). This means that any recursive allocations will fall back to the supporting allocator. In future patches, we will introduce stack trace collection support. The unwinder will be provided by the supporting allocator, and we can't guarantee they don't call malloc() (e.g. backtrace() on posix may call dlopen(), which may call malloc(). Furthermore, this patch packs the new TLS recursivity guard into a thread local struct, so that TLS variables should be hopefully not fall across cache lines. Reviewers: vlad.tsyrklevich, morehouse, eugenis Reviewed By: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits, eugenis Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D63736 llvm-svn: 364356
* [scudo] Correct a behavior on the shared TSD registryKostya Kortchinsky2019-06-252-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There is an error in the shared TSD registry logic when looking for a TSD in the slow path. There is an unlikely event when a TSD's precedence was 0 after attempting a `tryLock` which indicated that it was grabbed by another thread in between. We dealt with that case by continuing to the next iteration, but that meant that the `Index` was not increased and we ended up trying to lock the same TSD. This would manifest in heavy contention, and in the end we would still lock a TSD, but that was a wasted iteration. So, do not `continue`, just skip the TSD as a potential candidate. This is in both the standalone & non-standalone versions. Reviewers: morehouse, eugenis, vitalybuka, hctim Reviewed By: morehouse Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63783 llvm-svn: 364345
* [scudo][standalone] Introduce the C & C++ wrappersKostya Kortchinsky2019-06-2511-36/+909
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This CL adds C & C++ wrappers and associated tests. Those use default configurations for a Scudo combined allocator that will likely be tweaked in the future. This is the final CL required to have a functional C & C++ allocator based on Scudo. The structure I have chosen is to define the core C allocation primitives in an `.inc` file that can be customized through defines. This allows to easily have 2 (or more) sets of wrappers backed by different combined allocators, as demonstrated by the `Bionic` wrappers: one set for the "default" allocator, one set for the "svelte" allocator. Currently all the tests added have been gtests, but I am planning to add some more lit tests as well. Reviewers: morehouse, eugenis, vitalybuka, hctim, rengolin Reviewed By: morehouse Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63612 llvm-svn: 364332
* [sanitizer] Enabled getpw_getgr.cc on iOSVitaly Buka2019-06-251-1/+0
| | | | | | | | | | | | | | Reviewers: kubamracek, delcypher, yln Reviewed By: delcypher Subscribers: yln, delcypher, llvm-commits, kubamracek, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D57786 llvm-svn: 364261
OpenPOWER on IntegriCloud