Addresses tests flakes described in
https://github.com/llvm/llvm-project/issues/55460
The test being updated can fail in FileCheck to match when given long
enough stack traces. This can be problematic when file system paths
become long enough to cause the majority of the long function name to
become truncated. We found in our CI that the truncated output would
often fail to match, thereby causing the test to fail when it should not.
Here we change the test to match on sybolizer output that should be more
reliable than matching inside the long function name.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D126102
This is a follow up to [Sanitizers][Darwin] Rename Apple macro SANITIZER_MAC -> SANITIZER_APPLE (D125816)
Performed a global search/replace as in title against LLVM sources
Differential Revision: https://reviews.llvm.org/D126263
While attempting to get the 64-bit lsan allocator working for Fuchsia, I
noticed this function would incorrectly return false for pointers returned
by the 64-bit allocator. On AArch64, this function attempts to get the VMA
size dynamically by counting the number of leading zeros from the function
frame address. This will fail if the frame address is significantly below an
allocated pointer (that is, the frame address has more leading zeros than an
allocated pointer). This is possible on Fuchsia and linux (when not called
from the initial thread stack).
It seems the intended use of this function is to speed up pointer scanning by
filtering out addresses that user code might not be able to access. Other
platforms this check is done on seem to hardcode the VMA size/shift, so it
seems appropriate to do this for aarch64 as well. This implies pointers on
aarch64 where the VMA size is <64 will pass through, but bad pointers will
still be caught by subsequent scan checks.
This patch also renames the function to something more fitting of what it's
trying to do.
Differential Revision: https://reviews.llvm.org/D123814
3bd112c720 fixed the fuzzing test on Linux, which, after
https://reviews.llvm.org/D125933, has one less branch. Turns out, on
Windows, that it still has the extra branch. I'm guessing that's because
exit() isn't known to be noreturn on Windows or something.
Either way, just make the test more tolerant.
https://reviews.llvm.org/D125933 improved some of LLVM's handling of
binary ORs, which meant we have one less conditional branch, because the
'if (Size > 5 && Data[5] == 'R')' and 'if (bits == 63)' branches are now
correctly folded.
Add a set of tests that iterate over possible combinations of
memory orders for lock free stack implementation.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D110552
Initial introduction of the new macro before obsoleting the old one - the old name was really confusing.
Also moved SANITIZER_WATCHOS and SANITIZER_TVOS definitions under common #if defined(__APPLE__) block
Differential Revision: https://reviews.llvm.org/D125816
The spinlock requires that lock-free operations are available;
otherwise, the implementation just calls itself. As discussed in
D120026.
Differential Revision: https://reviews.llvm.org/D123080
Thread create/destroy events are not guaranteed to belivered on the
parent thread, e.g., output from a CI job:
```
5: THREAD_CREATE 0x7e8000104000, self: 0x1102ebdc0, name: n/a
6: THREAD_START 0x7e8000104000, self: 0x7e8000104000, name: n/a
7: Hello from pthread
8: THREAD_TERMINATE 0x7e8000104000, self: 0x7e8000104000, name: child thread
9: THREAD_DESTROY 0x7e8000104000, self: 0x7e8000104000, name: child thread
```
Here, THREAD_DESTROY is delivered on the thread being destroyed.
rdar://92679941
On arm64 the read/write flag is set on the esr register.
Adding this flag check for arm64 enables a more accurate
print out for sanitizer signal reports and matches the
behavior on x86.
Fixes bug: https://bugs.llvm.org/show_bug.cgi?id=27543https://github.com/google/sanitizers/issues/653
These tests are now passing:
SanitizerCommon-asan-arm64-Darwin :: Posix/illegal_read_test.cpp
SanitizerCommon-asan-arm64-Darwin :: Posix/illegal_write_test.cpp
SanitizerCommon-asan-arm64e-Darwin :: Posix/illegal_read_test.cpp
SanitizerCommon-asan-arm64e-Darwin :: Posix/illegal_write_test.cpp
SanitizerCommon-tsan-arm64-Darwin :: Posix/illegal_read_test.cpp
SanitizerCommon-tsan-arm64-Darwin :: Posix/illegal_write_test.cpp
SanitizerCommon-tsan-arm64e-Darwin :: Posix/illegal_read_test.cpp
SanitizerCommon-tsan-arm64e-Darwin :: Posix/illegal_write_test.cpp
SanitizerCommon-ubsan-arm64-Darwin :: Posix/illegal_read_test.cpp
SanitizerCommon-ubsan-arm64-Darwin :: Posix/illegal_write_test.cpp
SanitizerCommon-ubsan-arm64e-Darwin :: Posix/illegal_read_test.cpp
SanitizerCommon-ubsan-arm64e-Darwin :: Posix/illegal_write_test.cpp
rdar://92104440
Differential Revision: https://reviews.llvm.org/D125416
This halves the size of LargeTest, dropping time to compile this
file locally from 14s to 5.5s. Hopefully this will also fix the
persistent timeouts in pre-merge checks.
Differential Revision: https://reviews.llvm.org/D124237
Also enable on X86_64.
The directory would change during the test execution. This should not
necessarily prevent us from indexing a directory (a user might
potentially do that if they specify a parent directory of the actual
symbols directory, and change unrelated files).
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D125143
The globals are better expressed as members of the Symbolizer, and all
functions operating on it should be methods instead.
Also using the standard idiom of wrapping the main code in
`if __name__ == '__main__'`.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D125032
Since D97044, libc++ implements <stdatomic.h>, which is not compatible
with the <atomic> header in C++03 mode. To fix the tests, avoid using
<stdatomic.h> at all, since it is not strictly required.
rdar://92867529
Differential Revision: https://reviews.llvm.org/D125118
This changes the ELFNix platform Orc runtime to use, when available,
the __unw_add_dynamic_eh_frame_section interface provided by libunwind
for registering .eh_frame sections loaded by JITLink. When libunwind
is not being used for unwinding, the ELFNix platform detects this and
defaults to the __register_frame interface provided by libgcc_s.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D114961
The mechanism behind "check-all" is recording params of add_lit_testsuite()
calls in global variables LLVM_LIT_*, and then creating an extra suite with
their union at the end.
This avoids composing the check-* targets directly, which doesn't work well.
We generalize this by allowing multiple families of variables LLVM_{name}_LIT_*:
umbrella_lit_testsuite_begin(check-foo)
... test suites here will be added to LLVM_FOO_LIT_* variables ...
umbrella_lit_testsuite_end(check-foo)
(This also moves some implementation muck out of {llvm,clang}/CMakeLists.txt
This patch also changes check-clang-tools to use be an umbrella test target,
which means the clangd and clang-pseudo tests are included in it, along with the
the other testsuites that already are (like check-clang-extra-clang-tidy).
Differential Revision: https://reviews.llvm.org/D121838
The globals are better expressed as members of the Symbolizer, and all
functions operating on it should be methods instead.
Also using the standard idiom of wrapping the main code in
`if __name__ == '__main__'`.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D125032