summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* [compiler-rt] [test] Disable ASLR on LSAN+ASAN tests on NetBSDMichał Górny2019-12-181-0/+2
|
* [compiler-rt] [test] Disable ASLR for fuzzer tests on NetBSDMichał Górny2019-12-181-0/+3
|
* [compiler-rt] Sync NetBSD ioctl definitions with 9.99.26Kamil Rytarowski2019-12-184-6/+47
| | | | Document the minimal version supported to 9.0.
* [lit] Remove lit's REQUIRES-ANY directiveThomas Preud'homme2019-12-1710-10/+10
| | | | | | | | | | | | | | | | | Summary: Remove REQUIRES-ANY alias lit directive since it is hardly used and can be easily implemented using an OR expression using REQUIRES. Fixup remaining testcases still using REQUIRES-ANY. Reviewers: probinson, jdenny, gparker42 Reviewed By: gparker42 Subscribers: eugenis, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, delcypher, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits, #sanitizers, llvm-commits Tags: #llvm, #clang, #sanitizers Differential Revision: https://reviews.llvm.org/D71408
* [sanitizer] Construct InternalMmapVector without memory allocation.Igor Kudrin2019-12-172-2/+2
| | | | | | | | | Construction of InternalMmapVector is often followed by a call to reserve(), which may result in immediate reallocation of the memory for the internal storage. This patch delays that allocation until it is really needed. Differential Revision: https://reviews.llvm.org/D71342
* Change `asan/TestCases/Darwin/malloc_zone-protected.cpp` to call abort so ↵Dan Liew2019-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | that it **always crashes**. Summary: This is needed because on some platforms we can't install signal handlers and so the application just traps (i.e. crashes) rather than being intercepted by ASan's signal handler which in the default Darwin config doesn't exit with a crashing exit code. rdar://problem/57984547 Reviewers: yln, kubamracek, jfb Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71573
* [TSan][Darwin] Avoid calling pthread_self() before libpthread is initializedJulian Lettner2019-12-161-1/+6
| | | | | | | | | | | | | | This skips calling `pthread_self` when `main_thread_identity` hasn't been initialized yet. `main_thread_identity` is only ever assigned in `__tsan::InitializePlatform`. This change should be relatively safe; we are not changing behavior other than skipping the call to `pthread_self` when `main_thread_identity == 0`. rdar://57822138 Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D71559
* [ubsan] Enable testing of .m filesVedant Kumar2019-12-131-1/+1
| | | | | This allows `.m` test files, like the existing Misc/bool.m, to be tested.
* [LSAN] Increase stack space for guard-page.c testAlex Richardson2019-12-131-2/+2
| | | | | | | | | | | | | | | | | | Summary: When running the tests on a Ubuntu 18.04 machine this test is crashing for me inside the runtime linker. My guess is that it is trying to save more registers (possibly large vector ones) and the current stack space is not sufficient. Reviewers: samsonov, kcc, eugenis Reviewed By: eugenis Subscribers: eugenis, merge_guards_bot, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71461
* [NFC] Guard scudo_standalone's optional dependency on GWP-ASan behind flags.Mitch Phillips2019-12-131-1/+3
|
* [GWP-ASan] [Scudo] ifdef entire GWP-ASan tests.Mitch Phillips2019-12-131-4/+2
| | | | | | | | | Turns out that gtest in LLVM is only 1.8.0 (the newest version 1.10.0) supports the GTEST_SKIP() macro, and apparently I didn't build w/o GWP-ASan. Should fix the GN bot, as well as any bots that may spuriously break on platforms where the code wasn't correctly ifdef'd out as well.
* [Scudo] [GWP-ASan] Add GWP-ASan to Scudo Standalone.Mitch Phillips2019-12-139-1/+127
| | | | | | | | | | | | | | | | Summary: Adds GWP-ASan to Scudo standalone. Default parameters are pulled across from the GWP-ASan build. No backtrace support as of yet. Reviewers: cryptoad, eugenis, pcc Reviewed By: cryptoad Subscribers: merge_guards_bot, mgorny, #sanitizers, llvm-commits, cferris, vlad.tsyrklevich, pcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71229
* [iOS sim] Simplify iossim_run.py scriptJulian Lettner2019-12-121-3/+2
|
* [sanitizers] Redirect stdout and stderr to TASK_LOGEric Christopher2019-12-121-1/+1
| | | | | | | | | | | | At some point cpplint.py became very noisy during a build spewing a few hundred lines of "Done processing..." even with SILENT=1 in cmake. This attempts to redirect the stdout of "Done processing" to the task log along with any errors. Tested by this with and without SILENT=1 to check things. Differential Revision: https://reviews.llvm.org/D71402 Reviewed By: eugenis
* [compiler-rt] libFuzzer: update -merge_control_file= help message.Max Moroz2019-12-121-1/+2
| | | | | | | | | | | | | | | | Summary: The motivation for this change is to have a distinguisher in libFuzzer that would let the runner know whether multistep merge is supported or not by a particular fuzz target binary. Otherwise, multistep merge fails to execute with older version of libFuzzer, and there is no way to verify that easily. Reviewers: kcc Subscribers: dberris, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71423
* [fuzzer] Add basic support for emscripten.Jonathan Metzman2019-12-126-7/+29
| | | | | | | | | | | | | | | | | | | | | | | Summary: Add basic support for emscripten. This enables libFuzzer to build (using build.sh) for emscripten and fuzz a target compiled with -fsanitize-coverage=inline-8bit-counters. Basic fuzzing and bug finding work with this commit. RSS limit and timeouts will not work because they depend on system functions that are not implemented/widely supported in emscripten. Reviewers: kcc, vitalybuka, hctim Reviewed By: hctim Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71285
* Revert unintentional change to compiler-rt as part of the __bit_reference ↵Eric Christopher2019-12-121-1/+1
| | | | revert.
* [compiler-rt] Add a critical section when flushing gcov countersCalixte Denizet2019-12-121-1/+24
| | | | | | | | | | | | | | | | | Summary: Counters can be flushed in a multi-threaded context for example when the process is forked in different threads (https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp#L632-L663). In order to avoid pretty bad things, a critical section is needed around the flush. We had a lot of crashes in this code in Firefox CI when we switched to clang for linux ccov builds and those crashes disappeared with this patch. Reviewers: marco-c, froydnj, dmajor, davidxl, vsk Reviewed By: marco-c, dmajor Subscribers: ahatanak, froydnj, dmajor, dberris, jfb, #sanitizers, llvm-commits, sylvestre.ledru Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D70910
* Temporarily Revert "[libc++] Fix -Wdeprecated-copy warnings in __bit_reference"Eric Christopher2019-12-121-1/+1
| | | | | | as it's causing test failures due to mismatched visibility. This reverts commit 02bb20223bda5add729402962c70d0ebd0d98af2.
* [TSan] Pacify flaky test on DarwinJulian Lettner2019-12-111-7/+18
| | | | | | | | | | | This flaky test that I added really gives our CI a lot of headaches. Although I was never able to reproduce this locally, it sporadically hangs/fails on our bots. I decided to silently pass the test whenever we are unable to setup the proper test condition after 10 retries. This is of course suboptimal and a last recourse. Please let me know if you know how to test this better. rdar://57844626
* [profile] Avoid allocating a page on the stack, NFCVedant Kumar2019-12-114-14/+33
| | | | | | | | | | | | | | | | | | | | | When writing out a profile, avoid allocating a page on the stack for the purpose of writing out zeroes, as some embedded environments do not have enough stack space to accomodate this. Instead, use a small, fixed-size zero buffer that can be written repeatedly. For a synthetic file with >100,000 functions, I did not measure a significant difference in profile write times. We are removing a page-length zero-fill `memset()` in favor of several smaller buffered `fwrite()` calls: in practice, I am not sure there is much of a difference. The performance impact is only expected to affect the continuous sync mode (%c) -- zero padding is less than 8 bytes in all other cases. rdar://57810014 Differential Revision: https://reviews.llvm.org/D71323
* [profile] Delete stale profiles in test/profile/instrprof-value-prof.test, NFCVedant Kumar2019-12-111-0/+1
|
* [profile] Delete stale profile in test/profile/instrprof-set-filename.c, NFCVedant Kumar2019-12-111-0/+2
|
* [SanitizerCommon] Reduce wasting memory in LowLevelAllocator.Igor Kudrin2019-12-112-1/+12
| | | | | | | | | MmapOrDie allocates memory multiple to page size. LowLevelAllocator should use all that memory for the internal buffer because there are chances that subsequent requests may be small enough to fit in that space. Differential Revision: https://reviews.llvm.org/D71275
* scudo: Tweak how we align UserPtr. NFCI.Peter Collingbourne2019-12-101-5/+6
| | | | | | | | | | | | Instead of testing whether the pointer is aligned, just align it unconditionally and compare it to the original pointer. This moves the computation of UserPtr up to before we start preparing the header, so that the memory tagging code will be able to read the original header containing the bounds of the previous allocation before it gets potentially clobbered by the pointer realignment code. Differential Revision: https://reviews.llvm.org/D71292
* scudo: Move getChunkFromBlock() allocated check into caller. NFCI.Peter Collingbourne2019-12-101-17/+9
| | | | | | | | With tag-on-free we will need to get the chunk of a deallocated block. Change getChunkFromBlock() so that it doesn't check that the chunk is allocated, and move the check into the caller, so that it can be reused for this purpose. Differential Revision: https://reviews.llvm.org/D71291
* [profile] Add explanatory comments to instrprof-darwin-exports.c, NFCVedant Kumar2019-12-101-3/+11
|
* [scudo][standalone] Define hasHardwareCRC32 for other archsKostya Kortchinsky2019-12-101-1/+3
| | | | | | | | | | | | | | | | | Summary: The function was only defined for x86 and arm families, which ends up being an issue for PPC in g3. Define the function, simply returning `false` for "other" architectures. Reviewers: hctim, pcc, cferris, eugenis, vitalybuka Subscribers: kristof.beyls, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71223
* Revert "[compiler-rt] Add a critical section when flushing gcov counters"Akira Hatanaka2019-12-091-24/+1
| | | | | | | This reverts commit 88f5bf77f92899b19fdafdffc7b060f930c1cb8b as it broke green dragon bots. http://lab.llvm.org:8080/green/job/clang-stage1-RA/4401/
* Remove unused Unit test directory for xray.Eric Christopher2019-12-092-43/+0
|
* [hwasan] Offline symbolization script.Evgenii Stepanov2019-12-093-0/+286
| | | | | | | | | | | | | | | Summary: A script to symbolize hwasan reports after the fact using unstripped binaries. Supports stack-based reports. Requires llvm-symbolizer (addr2line is not an option). Reviewers: pcc, hctim Subscribers: mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71148
* scudo: Add a basic malloc/free benchmark.Peter Collingbourne2019-12-095-0/+126
| | | | Differential Revision: https://reviews.llvm.org/D71104
* [GWP-ASan] 32-bit test pointers, allow multi-init for test.Mitch Phillips2019-12-092-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: GWP-ASan test currently fail on 32-bit platforms, as some of the pointers are larger than `uintptr_t` on 32-bit platforms. Fix up all those instances. Also add an uncompress varint test where the result is an underflow. Furthermore, allow multi-init for testing. Each gtest when running `check-gwp_asan` apparently runs in its own instance, but when integrating these tests into Android, this behaviour isn't the same. We remove the global multi-init check here, to allow for testing to work elsewhere, and we're not really worried about multi-init anyway as it's part of our contract with the allocator. Reviewers: eugenis, vlad.tsyrklevich Reviewed By: eugenis Subscribers: #sanitizers, llvm-commits, pcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71121
* [compiler-rt] Add a critical section when flushing gcov countersCalixte Denizet2019-12-091-1/+24
| | | | | | | | | | | | | | | | | Summary: Counters can be flushed in a multi-threaded context for example when the process is forked in different threads (https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp#L632-L663). In order to avoid pretty bad things, a critical section is needed around the flush. We had a lot of crashes in this code in Firefox CI when we switched to clang for linux ccov builds and those crashes disappeared with this patch. Reviewers: marco-c, froydnj, dmajor, davidxl Reviewed By: marco-c, dmajor Subscribers: froydnj, dmajor, dberris, jfb, #sanitizers, llvm-commits, sylvestre.ledru Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D70910
* [compiler-rt] [test] Disable ASLR on ASAN/MSAN/TSAN tests on NetBSDMichał Górny2019-12-066-0/+21
| | | | | | | | Use a new %run wrapper for ASAN/MSAN/TSAN tests that calls paxctl in order to disable ASLR on the test executables. This makes it possible to test sanitizers on systems where ASLR is enabled by default. Differential Revision: https://reviews.llvm.org/D70958
* scudo: Fix one of the C wrapper tests on Android.Peter Collingbourne2019-12-051-2/+11
| | | | | | | | | The test ScudoWrappersCTest.Realloc expects realloc of memalign to work on Android, but this relies on dealloc_type_mismatch being set to false. Commit 0d3d4d3b0 caused us to start setting it to true in the C wrapper tests, which broke the test. Set it to the correct value on Android. Differential Revision: https://reviews.llvm.org/D71078
* scudo: Fix the build of wrappers_c_test.cpp on Android.Peter Collingbourne2019-12-051-0/+2
| | | | | | | The Android headers don't provide a declaration of valloc or pvalloc, so we need to declare them ourselves. Differential Revision: https://reviews.llvm.org/D71077
* [compiler-rt] FuzzedDataProvider: do not call memcpy on empty vector.Max Moroz2019-12-041-0/+6
| | | | | | | | | | | | | | | | Summary: Some versions of memcpy mark pointer arguments as __nonnull, that triggers UBSan errors even when the length passed is 0. Reviewers: manojgupta, metzman Subscribers: dberris, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D71031 [compiler-rt] FDP: assert that num_bytes_to_consume == 0 when size == 0.
* Revert "[Coverage] Revise format to reduce binary size"Vedant Kumar2019-12-041-40/+9
| | | | | | | | | | This reverts commit e18531595bba495946aa52c0a16b9f9238cff8bc. On Windows, there is an error: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/54963/steps/stage%201%20check/logs/stdio error: C:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\test\profile\Profile-x86_64\Output\instrprof-merging.cpp.tmp.v1.o: Failed to load coverage: Malformed coverage data
* [Coverage] Revise format to reduce binary sizeVedant Kumar2019-12-041-9/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revise the coverage mapping format to reduce binary size by: 1. Naming function records and marking them `linkonce_odr`, and 2. Compressing filenames. This shrinks the size of llc's coverage segment by 82% (334MB -> 62MB) and speeds up end-to-end single-threaded report generation by 10%. For reference the compressed name data in llc is 81MB (__llvm_prf_names). Rationale for changes to the format: - With the current format, most coverage function records are discarded. E.g., more than 97% of the records in llc are *duplicate* placeholders for functions visible-but-not-used in TUs. Placeholders *are* used to show under-covered functions, but duplicate placeholders waste space. - We reached general consensus about giving (1) a try at the 2017 code coverage BoF [1]. The thinking was that using `linkonce_odr` to merge duplicates is simpler than alternatives like teaching build systems about a coverage-aware database/module/etc on the side. - Revising the format is expensive due to the backwards compatibility requirement, so we might as well compress filenames while we're at it. This shrinks the encoded filenames in llc by 86% (12MB -> 1.6MB). See CoverageMappingFormat.rst for the details on what exactly has changed. Fixes PR34533 [2], hopefully. [1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118428.html [2] https://bugs.llvm.org/show_bug.cgi?id=34533 Differential Revision: https://reviews.llvm.org/D69471
* [compiler-rt] Disable fuzzer large.test when LLVM_ENABLE_EXPENSIVE_CHECKS=ONAlex Lorenz2019-12-034-0/+7
| | | | | | | | | | | | | This test is timing out on Green Dragon http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/ and looks like it's not executed on other bots with expensive checks enabled http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-ubuntu http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win The test times out at the C++ source file takes too long to build (2+ hours on my machine), as clang spends a lot of time in IR/MIR verifiers. Differential Revision: https://reviews.llvm.org/D70024
* Rename `tsan/race_range_pc.cc` to `test/tsan/race_range_pc.cpp`.Dan Liew2019-12-031-0/+0
| | | | The old suffix was preventing it from being executed by default.
* [scudo][standalone] Add chunk ownership functionKostya Kortchinsky2019-12-033-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | Summary: In order to be compliant with tcmalloc's extension ownership determination function, we have to expose a function that will say if a chunk was allocated by us. As to whether or not this has security consequences: someone able to call this function repeatedly could use it to determine secrets (cookie) or craft a valid header. So this should not be exposed directly to untrusted user input. Add related tests. Additionally clang-format caught a few things to change. Reviewers: hctim, pcc, cferris, eugenis, vitalybuka Subscribers: JDevlieghere, jfb, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D70908
* Revert "Revert 1689ad27af5 "[builtins] Implement rounding mode support for ↵Yi Kong2019-11-274-2/+50
| | | | | | | | | i386/x86_64"" Don't build specilised fp_mode.c on MSVC since it does not support inline ASM on x86_64. This reverts commit a19f0eec94e195cac676d0d473882b48f4fded90.
* [clang][CodeGen] Implicit Conversion Sanitizer: handle increment/decrement ↵Roman Lebedev2019-11-273-0/+364
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (PR44054)(take 2) Summary: Implicit Conversion Sanitizer is *almost* feature complete. There aren't *that* much unsanitized things left, two major ones are increment/decrement (this patch) and bit fields. As it was discussed in [[ https://bugs.llvm.org/show_bug.cgi?id=39519 | PR39519 ]], unlike `CompoundAssignOperator` (which is promoted internally), or `BinaryOperator` (for which we always have promotion/demotion in AST) or parts of `UnaryOperator` (we have promotion/demotion but only for certain operations), for inc/dec, clang omits promotion/demotion altogether, under as-if rule. This is technically correct: https://rise4fun.com/Alive/zPgD As it can be seen in `InstCombineCasts.cpp` `canEvaluateTruncated()`, `add`/`sub`/`mul`/`and`/`or`/`xor` operators can all arbitrarily be extended or truncated: https://github.com/llvm/llvm-project/blob/901cd3b3f62d0c700e5d2c3f97eff97d634bec5e/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp#L1320-L1334 But that has serious implications: 1. Since we no longer model implicit casts, do we pessimise their AST representation and everything that uses it? 2. There is no demotion, so lossy demotion sanitizer does not trigger :] Now, i'm not going to argue about the first problem here, but the second one **needs** to be addressed. As it was stated in the report, this is done intentionally, so changing this in all modes would be considered a penalization/regression. Which means, the sanitization-less codegen must not be altered. It was also suggested to not change the sanitized codegen to the one with demotion, but i quite strongly believe that will not be the wise choice here: 1. One will need to re-engineer the check that the inc/dec was lossy in terms of `@llvm.{u,s}{add,sub}.with.overflow` builtins 2. We will still need to compute the result we would lossily demote. (i.e. the result of wide `add`ition/`sub`traction) 3. I suspect it would need to be done right here, in sanitization. Which kinda defeats the point of using `@llvm.{u,s}{add,sub}.with.overflow` builtins: we'd have two `add`s with basically the same arguments, one of which is used for check+error-less codepath and other one for the error reporting. That seems worse than a single wide op+check. 4. OR, we would need to do that in the compiler-rt handler. Which means we'll need a whole new handler. But then what about the `CompoundAssignOperator`, it would also be applicable for it. So this also doesn't really seem like the right path to me. 5. At least X86 (but likely others) pessimizes all sub-`i32` operations (due to partial register stalls), so even if we avoid promotion+demotion, the computations will //likely// be performed in `i32` anyways. So i'm not really seeing much benefit of not doing the straight-forward thing. While looking into this, i have noticed a few more LLVM middle-end missed canonicalizations, and filed [[ https://bugs.llvm.org/show_bug.cgi?id=44100 | PR44100 ]], [[ https://bugs.llvm.org/show_bug.cgi?id=44102 | PR44102 ]]. Those are not specific to inc/dec, we also have them for `CompoundAssignOperator`, and it can happen for normal arithmetics, too. But if we take some other path in the patch, it will not be applicable here, and we will have most likely played ourselves. TLDR: front-end should emit canonical, easy-to-optimize yet un-optimized code. It is middle-end's job to make it optimal. I'm really hoping reviewers agree with my personal assessment of the path this patch should take.. This originally landed in 9872ea4ed1de4c49300430e4f1f4dfc110a79ab9 but got immediately reverted in cbfa237892e55b7129a1178c9b03f26683d643af because the assertion was faulty. That fault ended up being caused by the enum - while there will be promotion, both types are unsigned, with same width. So we still don't need to sanitize non-signed cases. So far. Maybe the assert will tell us this isn't so. Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=44054 | PR44054 ]]. Refs. https://github.com/google/sanitizers/issues/940 Reviewers: rjmccall, erichkeane, rsmith, vsk Reviewed By: erichkeane Subscribers: mehdi_amini, dexonsmith, cfe-commits, #sanitizers, llvm-commits, aaron.ballman, t.p.northover, efriedma, regehr Tags: #llvm, #clang, #sanitizers Differential Revision: https://reviews.llvm.org/D70539
* scudo: Limit the number of bytes tested in a realloc test.Peter Collingbourne2019-11-271-1/+1
| | | | | | | | | | | | | | | | | This test was previously effectively doing: P = malloc(X); write X bytes to P; P = realloc(P, X - Y); P = realloc(P, X) and expecting that all X bytes stored to P would still be identical after the final realloc. This happens to be true for the current scudo implementation of realloc, but is not guaranteed to be true by the C standard ("Any bytes in the new object beyond the size of the old object have indeterminate values."). This implementation detail will change with the new memory tagging support, which unconditionally zeros newly allocated granules when memory tagging is enabled. Fix this by limiting the number of bytes that we test to the minimum size that we realloc the allocation to. Differential Revision: https://reviews.llvm.org/D70761
* scudo: Replace a couple of macros with their expansions.Peter Collingbourne2019-11-2716-67/+64
| | | | | | | | | The macros INLINE and COMPILER_CHECK always expand to the same thing (inline and static_assert respectively). Both expansions are standards compliant C++ and are used consistently in the rest of LLVM, so let's improve consistency with the rest of LLVM by replacing them with the expansions. Differential Revision: https://reviews.llvm.org/D70793
* scudo: Call setCurrentTSD(nullptr) when bringing down the TSD registry in tests.Peter Collingbourne2019-11-271-0/+1
| | | | | | | | | Otherwise, we will hit a use-after-free when testing multiple instances of the same allocator on the same thread. This only recently became a problem with D70552 which caused us to run both ScudoCombinedTest.BasicCombined and ScudoCombinedTest.ReleaseToOS on the unit tests' main thread. Differential Revision: https://reviews.llvm.org/D70760
* Make memory dump same as the one in asan.Martin Liska2019-11-271-1/+2
| | | | | | | Shadow memory (and short granules) are not prepended with memory address and arrow at the end of line is removed. Differential Revision: https://reviews.llvm.org/D70707
* [scudo][standalone] Make tests work on FuchsiaKostya Kortchinsky2019-11-2725-90/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This CL makes unit tests compatible with Fuchsia's zxtest. This required a few changes here and there, but also unearthed some incompatibilities that had to be addressed. A header is introduced to allow to account for the zxtest/gtest differences, some `#if SCUDO_FUCHSIA` are used to disable incompatible code (the 32-bit primary, or the exclusive TSD). It also brought to my attention that I was using `__scudo_default_options` in different tests, which ended up in a single binary, and I am not sure how that ever worked. So move this to the main cpp. Additionally fully disable the secondary freelist on Fuchsia as we do not track VMOs for secondary allocations, so no release possible. With some modifications to Scudo's BUILD.gn in Fuchsia: ``` [==========] 79 tests from 23 test cases ran (10280 ms total). [ PASSED ] 79 tests ``` Reviewers: mcgrathr, phosek, hctim, pcc, eugenis, cferris Subscribers: srhines, jfb, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D70682
OpenPOWER on IntegriCloud