Android does not do any checking of new/delete mismatches, so disable
this test when compiling for Android.
Reviewed By: Chia-hungDuan
Differential Revision: https://reviews.llvm.org/D152958
This reverts commit 9d9a7732e14d7d4c0db7b46d6ebe588e8f43b951.
This was a workaround for some platform and it has been fixed in
bfa02523b2e7ed66368ea61866a474e55ef354a3
Differential Revision: https://reviews.llvm.org/D152964
On Android, the min alignment is 16 bytes. This test needs
the BlockDelta to match the min alignment, so set this value
differently for Android.
Update the comment in to explain these details.
Reviewed By: Chia-hungDuan
Differential Revision: https://reviews.llvm.org/D152884
If `path` is null, `user_path` must also be null. With the current code path, the message of explicitly disabling symbolizer will never be reported. This patch adjusts the if-else structure to make that message can be reported.
Reviewed By: cchen15, MaskRay
Differential Revision: https://reviews.llvm.org/D148907
Tests are subset of llvm/unittests/ADT/ArrayRefTest.cpp.
Added more members to match tests and
make class more useful.
Reviewed By: hctim
Differential Revision: https://reviews.llvm.org/D152760
SPARC jmp requires a delay slot after, and without it will likely result
in a crash. For now, just disable interceptor trampolines on SPARC,
because the specific usecase for them (3 interceptors) does not exist on
SPARC (yet). We can revisit, and carefully implement the support for
SPARC when required.
Reported-by: ro
On Android, the 32 bit value of 8 for BlockDelta results in a
failure because a valid pointer can never be found.
Change the code to always use 16 which passes on both 32 bit
and 64 bit.
Verified that re-introducing the old bug causes the test to fail
on both 32 bit and 64 with the new BlockDelta value.
Reviewed By: Chia-hungDuan
Differential Revision: https://reviews.llvm.org/D152767
Some platforms do not support pvalloc/valloc so add checks so
that these tests are only run on the appropriate platforms.
Reviewed By: Chia-hungDuan
Differential Revision: https://reviews.llvm.org/D152756
MBlock could be null (in the context of a call from RunFreeHooks)
if a static object was runtime initialized before tsan finished
initializing and that object later did a free().
While having the check isn't strictly required by
__sanitizer_get_allocated_size_fast's contract, a user's static object
would expect ptrs returned from malloc to be valid inputs.
Differential Revision: https://reviews.llvm.org/D152755
Some patches around D109843 added `REQUIRES: freebsd` but they have no effects
due to sanitizer_common/TestCases/Linux/lit.local.cfg.py . I informed the author
but don't plan to move the tests.
Build bots have been failing with:
/usr/bin/ld: read-only segment has dynamic relocations
Remove support for interceptor trampoline on s390, and revert new
implementation of __tls_get_offset.
Fix inline asm trampoline type. Some architectures will complain:
<inline asm>:8:41: error: expected STT_<TYPE_IN_UPPER_CASE>, '#<type>', '%<type>' or "<type>"
8 | .type __interceptor_trampoline_malloc, @function
Just use %function instead, which is what is also used in
sanitizer_asm.h
Rework Linux (and *BSD) interceptors to allow for up to 3 (2 for *BSD)
simultaneous interceptors. See code comments for details.
The main motivation is to support new sampling sanitizers (in the spirit
of GWP-ASan), that have to intercept few functions. Unfortunately, the
reality is that there are user interceptors that exist in the wild.
To support foreign user interceptors, foreign dynamic analysis
interceptors, and compiler-rt interceptors all at the same time,
including any combination of them, this change enables up to 3
interceptors on Linux (2 on *BSD).
v2:
* Revert to to the simpler "weak wrapper -(alias)-> __interceptor"
scheme on architectures that cannot implement a trampoline efficiently
due to complexities of resolving a preemptible symbol (PowerPC64
ELFv2 global entry, and i386 PIC).
* Avoid duplicate intercepted functions in gen_dynamic_list.py, due to
matching __interceptor_X and ___interceptor_X.
* Fix s390 __tls_get_offset.
Reviewed By: dvyukov, MaskRay, vitalybuka
Differential Revision: https://reviews.llvm.org/D151085
I recently discovered that `.profraw` headers are expected to be 8 byte
aligned.
643ba926c1/llvm/lib/ProfileData/InstrProfReader.cpp (L503-L506)
When function entry coverage mode is used, function counters are single
bytes, so it is likely that the size of the counters section is not 8
byte aligned. We can add padding after the counters section to guarantee
this.
Reviewed By: kyulee, gulfem
Differential Revision: https://reviews.llvm.org/D152479
The commit broke asan_symbolize.py script on Darwin which depended on
using the complete module path to symolize crash traces offline.
This reverts commit f6ea869f7c043c70722b8db6be94d9ad4cc9eb92.
rdar://110487521
On Darwin, we do not want to show the BuildId appended at the end of stack
frames in Sanitizers. The BuildId/UUID can be seen by using the
print_module_map=1 sanitizer option.
Differential Revision: https://reviews.llvm.org/D150298
rdar://108324403
CMake older than 3.20.0 is no longer supported.
This removes work-arounds for no longer supported versions.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D152102
Typically the size required to represent a dirent is stored in `d_reclen`. But
this not always the case for FreeBSD (for example, when walking a directory
over NFS).
This leads to ASAN false positives for `scandir` and similar functions. Because
ASAN uses `d_reclen` for the range to validate, it can overrun when `d_reclen` is
incorrect (too large).
This change adds `__sanitizer_dirsiz` which fixes the dirent size calculation
for FreeBSD. Other platforms continue to use `d_reclen`.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D151583
This fixes broken mingw builds since
0a71e25e2448ee471b1ebe74e910c5de9b9c82b4. Clang-cl style builds
were broken similarly, but were fixed in
caa2c1bacbd76c017ebbb4fd13861f0f66770299, with the comment
"Do not redefine builtins on Windows", even if the fix only affected
Clang-cl style builds.