Commit Graph

19491 Commits

Author SHA1 Message Date
Vitaly Buka
233078fd8d [nfc][asan] clang-format for #145087 2025-06-30 11:34:04 -07:00
Justin King
b2b20eeb54 tsan: Support free_sized and free_aligned_sized from C23 (#144531)
Adds support to TSan for `free_sized` and `free_aligned_sized` from C23.

Other sanitizers will be handled with their own separate PRs.

For https://github.com/llvm/llvm-project/issues/144435

Signed-off-by: Justin King <jcking@google.com>
2025-06-30 11:09:46 -07:00
Qinkun Bao
3923dd4484 Fix uncaught-exception.test. (#146190)
See https://github.com/llvm/llvm-project/pull/125924
To match a literal plus sign, it must be escaped with a backslash (`\`).
2025-06-27 22:23:51 -04:00
Qinkun Bao
72060f1cfd Fix uncaught-exception.test. (#146181)
See https://github.com/llvm/llvm-project/pull/125924

I didn't test it as I don't have access to a windows machine.
2025-06-27 21:59:58 -04:00
Sterling-Augustine
23f1ba3ee4 Reapply "[NFC][DebugInfo][DWARF] Create new low-level dwarf library (#… (#145959) (#146112)
Reapply "[NFC][DebugInfo][DWARF] Create new low-level dwarf library (#…
(#145959)
    
This reapplies cbf781f0bd, with fixes for
the shared-library build and the unconventional sanitizer-runtime build.

Original Description:

This is the culmination of a series of changes described in [1].
    
Although somewhat large by line count, it is almost entirely mechanical,
creating a new library in DebugInfo/DWARF/LowLevel. This new library has
very minimal dependencies, allowing it to be used from more places than
the normal DebugInfo/DWARF library--in particular from MC.
    
1.
https://discourse.llvm.org/t/rfc-debuginfo-dwarf-refactor-into-to-lower-and-higher-level-libraries/86665/2
2025-06-27 11:05:49 -07:00
John Brawn
ec1c73b2ec [compiler-rt][ARM] Only use bxaut when the target has pacbti (#146057)
Most pacbti instructions are a nop when the target does not have pacbti,
and thus safe to execute, but bxaut is an undefined instruction. When we
don't have pacbti (e.g. if we're compiling compiler-rt with
-mbranch-protection=standard in order to be forward-compatible with
pacbti while still working on targets without it) then we need to use
separate aut and bx instructions.
2025-06-27 13:26:09 +01:00
Kunqiu Chen
bc90166a50 [TSan] Clarify and enforce shadow end alignment (#144648)
In TSan, every `k` bytes of application memory (where `k = 8`) maps to a
single shadow/meta cell. This design leads to two distinct outcomes when
calculating the end of a shadow range using `MemToShadow(addr_end)`,
depending on the alignment of `addr_end`:

- **Exclusive End:** If `addr_end` is aligned (`addr_end % k == 0`),
`MemToShadow(addr_end)` points to the first shadow cell *past* the
intended range. This address is an exclusive boundary marker, not a cell
to be operated on.
- **Inclusive End:** If `addr_end` is not aligned (`addr_end % k != 0`),
`MemToShadow(addr_end)` points to the last shadow cell that *is* part of
the range (i.e., the same cell as `MemToShadow(addr_end - 1)`).

Different TSan functions have different expectations for whether the
shadow end should be inclusive or exclusive. However, these expectations
are not always explicitly enforced, which can lead to subtle bugs or
reliance on unstated invariants.


The core of this patch is to ensure that functions ONLY requiring an
**exclusive shadow end** behave correctly.

1.  Enforcing Existing Invariants:
For functions like `MetaMap::MoveMemory` and `MapShadow`, the assumption
is that the end address is always `k`-aligned. While this holds true in
the current codebase (e.g., due to some external implicit conditions),
this invariant is not guaranteed by the function's internal context. We
add explicit assertions to make this requirement clear and to catch any
future changes that might violate this assumption.

2.  Fixing Latent Bugs:
In other cases, unaligned end addresses are possible, representing a
latent bug. This was the case in `UnmapShadow`. The `size` of a memory
region being unmapped is not always a multiple of `k`. When this
happens, `UnmapShadow` would fail to clear the final (tail) portion of
the shadow memory.

This patch fixes `UnmapShadow` by rounding up the `size` to the next
multiple of `k` before clearing the shadow memory. This is safe because
the underlying OS `unmap` operation is page-granular, and the page size
is guaranteed to be a multiple of `k`.

Notably, this fix makes `UnmapShadow` consistent with its inverse
operation, `MemoryRangeImitateWriteOrResetRange`, which already performs
a similar size round-up.

In summary, this PR:

- **Adds assertions** to `MetaMap::MoveMemory` and `MapShadow` to
enforce their implicit requirement for k-aligned end addresses.
- **Fixes a latent bug** in `UnmapShadow` by rounding up the size to
ensure the entire shadow range is cleared. Two new test cases have been
added to cover this scenario.
  - Removes a redundant assertion in `__tsan_java_move`.
- Fixes an incorrect shadow end calculation introduced in commit
4052de6. The previous logic, while fixing an overestimation issue, did
not properly account for `kShadowCell` alignment and could lead to
underestimation.
2025-06-27 14:43:34 +08:00
Jake Egan
60285d98ef [asan] Implement address sanitizer on AIX: build configuration (#139583)
Update asan build configuration for AIX:
- Adds import lists
- Guards shared library code

Issue: #138916

---------

Co-authored-by: Hubert Tong <hubert.reinterpretcast@gmail.com>
2025-06-25 11:26:39 -04:00
Jake Egan
287b24e189 [asan] Implement address sanitizer on AIX: address descriptions (#138891)
Adapt address description logic for AIX. 

Issue: https://github.com/llvm/llvm-project/issues/138916
2025-06-25 11:18:15 -04:00
Kunqiu Chen
956bab0381 [TSan] Add 2 test cases related to incomplete shadow cleanup in unmap (#145472)
Once part of PR #144648, follow the reviewer's advice and split into
this separate PR.

`unmap` works at page granularity, but supports an arbitrary non-zero
size as an argument, which results in possible shadow undercleaning in
the existing TSan implementation when `size % kShadowCell != 0`.

This change introduces two test cases to verify the shadow cleaning
effect in `unmap`.

- java_heap_init2.cpp: Imitating java_heap_init cpp, verify the
incomplete cleaning of meta
- munmap_clear_shadow.c: verify the incomplete cleaning of shadow
2025-06-25 15:22:54 +08:00
Thurston Dang
c85466dcd4 Reapply "[msan] Automatically print shadow for failing outlined checks" (#145611) (#145615)
This reverts commit 5eb5f0d876 i.e.,
relands 1b71ea411a.

Test case was failing on aarch64 because the long double type is
implemented differently on x86 vs aarch64. This reland restricts the
test to x86.

----

Original CL description:
    
A commonly used aid for debugging MSan reports is
`__msan_print_shadow()`, which requires manual app code annotations
(typically of the variable in the UUM report or nearby). This is in
contrast to ASan, which automatically prints out the shadow map when a
check fails.
    
This patch changes MSan to print the shadow that failed an outlined
check (checks are outlined per function after the
`-msan-instrumentation-with-call-threshold` is exceeded) if verbosity >=
1. Note that we do not print out the shadow map of "neighboring"
variables because this is technically infeasible; see "Caveat" below.
    
This patch can be easier to use than `__msan_print_shadow()` because
this does not require manual app code annotations. Additionally, due to
optimizations, `__msan_print_shadow()` calls can sometimes spuriously
affect whether a variable is initialized.
    
As a side effect, this patch also enables outlined checks for
arbitrary-sized shadows (vs. the current hardcoded handlers for
{1,2,4,8}-byte shadows).
    
Caveat: the shadow does not necessarily correspond to an individual user
variable, because MSan instrumentation may combine and/or truncate
multiple shadows prior to emitting a check that the mangled shadow is
zero (e.g., `convertShadowToScalar()`,
`handleSSEVectorConvertIntrinsic()`, `materializeInstructionChecks()`).
OTOH it is arguably a strength that this feature emit the shadow that
directly matters for the MSan check, but which cannot be obtained using
the MSan API.
2025-06-24 20:33:11 -07:00
Thurston Dang
5eb5f0d876 Revert "[msan] Automatically print shadow for failing outlined checks" (#145611)
Reverts llvm/llvm-project#145107

Reason: buildbot breakage
(https://lab.llvm.org/buildbot/#/builders/51/builds/18512)
2025-06-24 15:53:19 -07:00
Thurston Dang
1b71ea411a [msan] Automatically print shadow for failing outlined checks (#145107)
A commonly used aid for debugging MSan reports is `__msan_print_shadow()`, which requires manual app code annotations (typically of the variable in the UUM report or nearby). This is in contrast to ASan, which automatically prints out the shadow map when a check fails.

This patch changes MSan to print the shadow that failed an outlined check (checks are outlined per function after the `-msan-instrumentation-with-call-threshold` is exceeded) if verbosity >= 1. Note that we do not print out the shadow map of "neighboring" variables because this is technically infeasible; see "Caveat" below.

This patch can be easier to use than `__msan_print_shadow()` because this does not require manual app code annotations. Additionally, due to optimizations, `__msan_print_shadow()` calls can sometimes spuriously affect whether a variable is initialized.

As a side effect, this patch also enables outlined checks for arbitrary-sized shadows (vs. the current hardcoded handlers for {1,2,4,8}-byte shadows).

Caveat: the shadow does not necessarily correspond to an individual user variable, because MSan instrumentation may combine and/or truncate multiple shadows prior to emitting a check that the mangled shadow is zero (e.g., `convertShadowToScalar()`, `handleSSEVectorConvertIntrinsic()`, `materializeInstructionChecks()`). OTOH it is arguably a strength that this feature emit the shadow that directly matters for the MSan check, but which cannot be obtained using the MSan API.
2025-06-24 15:09:44 -07:00
Kunqiu Chen
74aab3045d [TSan, NFC] Eliminate useless calculations in TSan (#145283)
Previously, TSan repeatedly calculated some values in some cases, and
this change eliminates these duplicate calculations.
2025-06-23 15:24:03 +08:00
Camsyn
20c04a646b [NFC][Sanitizer] Fix incorrect desc of [beg, end] to [beg, end)
Correct the interval desc of ReleaseMemoryPagesToOS from [beg, end] to
[beg, end), as it actually does.

The previous incorrect description of [beg, end] might cause an
incorrect invoke as follows: `ReleaseMemoryPagesToOS(0, kPageSize - 1);`
2025-06-23 15:21:34 +08:00
Kunqiu Chen
99af99c665 [TSan] Fix p == end == ShadowMem::end in ShadowSet (#144994)
In `ShadowSet`, when `p == end == ShadowMem::end`, it triggered an
assertion fail previously.

Now we do not allow `p == end` anymore in `ShadowSet`.
2025-06-21 23:02:41 +08:00
Iris Shi
fa117715ca [RISCV] Implement Feature Bit for Q (#145001) 2025-06-21 11:32:28 +08:00
Justin King
bfef8732be msan: Support free_sized and free_aligned_sized from C23 (#144529)
Adds support to MSan for `free_sized` and `free_aligned_sized` from C23.

Other sanitizers will be handled with their own separate PRs.

For https://github.com/llvm/llvm-project/issues/144435

Signed-off-by: Justin King <jcking@google.com>
2025-06-20 09:16:40 -07:00
int-zjt
b6b8fa3b15 [llvm-cov][gcov] Support multi-files coverage in one basic block (#144504)
In the current gcov implementation, all lines within a basic block are
attributed to the source file of the block's containing function. This
is inaccurate when a block contains lines from other files (e.g., via
#include "foo.inc").

Commit
[406e81b](406e81b79d)
attempted to address this by filtering lines based on debug info types,
but this approach has two limitations:

* **Over-filtering**: Some valid lines belonging to the function are
incorrectly excluded.
* **Under-counting**: Lines not belonging to the function are filtered
out and omitted from coverage statistics.

**GCC Reference Behavior**
GCC's gcov implementation handles this case correctly.This change aligns
the LLVM behavior with GCC.

**Proposed Solution**
1. **GCNO Generation**:

* **Current**: Each block stores a single GCOVLines record (filename +
lines).

* **New**: Dynamically create new GCOVLines records whenever consecutive
lines in a block originate from different source files. Group subsequent
lines from the same file under one record.

2. **GCNO Parsing**:

* **Current**: Lines are directly attributed to the function's source
file.

* **New**: Introduce a GCOVLocation type to track filename/line mappings
within blocks. Statistics will reflect the actual source file for each
line.
2025-06-20 01:24:19 -07:00
Justin King
f780955e1d lsan: fix macos build after #144604 (#144818)
Fixes build failures on macOS, including

https://green.lab.llvm.org/job/llvm.org/job/clang-stage1-RA/

llvm-project/compiler-rt/lib/lsan/lsan_interceptors.cpp:579:3: error: use of undeclared identifier 'LSAN_MAYBE_INTERCEPT_FREE_SIZED'
13:23:58    579 |   LSAN_MAYBE_INTERCEPT_FREE_SIZED;
13:23:58        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13:23:58  /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/compiler-rt/lib/lsan/lsan_interceptors.cpp:580:3: error: use of undeclared identifier 'LSAN_MAYBE_INTERCEPT_FREE_ALIGNED_SIZED'
13:23:58    580 |   LSAN_MAYBE_INTERCEPT_FREE_ALIGNED_SIZED;
13:23:58        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13:23:58  2 errors generated.
2025-06-19 18:38:45 +01:00
Kunqiu Chen
681db064d2 [TSan] Make Shadow/Meta region inclusive-exclusive (#144647)
This commit changes the interval shadow/meta address check from
inclusive-inclusive ( $[\mathrm{start}, \mathrm{end}]$ ) to
inclusive-exclusive ( $[\mathrm{start}, \mathrm{end})$ ), to resolve the
ambiguity of the end point address. This also aligns the logic with the
check for `isAppMem` (i.e., inclusive-exclusive), ensuring consistent
behavior across all memory classifications.

1. The `isShadowMem` and `isMetaMem` checks previously used an
inclusive-inclusive interval, i.e., $[\mathrm{start}, \mathrm{end}]$,
which could lead to a boundary address being incorrectly classified as
both Shadow and Meta memory, e.g., 0x3000_0000_0000 in
`Mapping48AddressSpace`.
- What's more, even when Shadow doesn't border Meta, `ShadowMem::end`
cannot be considered a legal shadow address, as TSan protects the gap,
i.e., `ProtectRange(ShadowEnd(), MetaShadowBeg());`

2. `ShadowMem`/`MetaMem` addresses are derived from `AppMem` using an
affine-like transformation (`* factor + bias`). This transformation
includes two extra modifications: high- and low-order bits are masked
out, and for Shadow Memory, an optional XOR operation may be applied to
prevent conflicts with certain AppMem regions.
- Given that all AppMem regions are defined as inclusive-exclusive
intervals, $[\mathrm{start}, \mathrm{end})$, the resulting Shadow/Meta
regions should logically also be inclusive-exclusive.

Note: This change is purely for improving code consistency and should
have no functional impact. In practice, the exact endpoint addresses of
the Shadow/Meta regions are generally not reached.
2025-06-19 16:25:51 +08:00
David Justo
d265105b8f Augment uncaught-exception.test fuzzer test to be msvc-compatible (#125924)
Today, the `uncaught-exception.test` fuzzer test checks for the string
"libFuzzer: deadly signal" in the program output as the result of an
uncaught exception.

Although this is correct for `clang`, `msvc` reports a different error
message: "libFuzzer: uncaught C++ exception". Since `msvc` reuses the
`libFuzzer` infrastructure for ASan regression testing, it would help us
greatly if the test handled the `msvc` divergence more gracefully.

**This PR:** augments this test so check for a different string (namely
"libFuzzer: uncaught C++ exception") if the compiler target matches the
`msvc` naming scheme.

I understand if this is outside the scope of support for LLVM as well,
and I'm also open for different approaches here. Thanks!
2025-06-18 17:13:25 -07:00
Muhammad Omair Javaid
7b6963ea67 [compiler-rt] [Fuzzer] Fix tests linking buildbot failure (#144495)
Fix for #144495 by 6f4add3 broke sanitizer-aarch64-linux buildbot.

compiler-rt/lib/fuzzer/tests build failed because the linker was
looking gcc_s without '-l' appended.

The CMake script was adding the library name without the required
'-l' prefix. This patch adds the -l prefix changing gcc_s to -lgcc_s
and gcc to -lgcc.

https://lab.llvm.org/buildbot/#/builders/51/builds/18170
2025-06-19 03:21:20 +05:00
Justin King
22a69a266d lsan: Support free_sized and free_aligned_sized from C23 (#144604)
Adds support to LSan for `free_sized` and `free_aligned_sized` from C23.

Other sanitizers will be handled with their own separate PRs.

For https://github.com/llvm/llvm-project/issues/144435

This is attempt number 2.

Signed-off-by: Justin King <jcking@google.com>
2025-06-18 12:57:49 -07:00
Justin King
d9f7979a63 sanitizer_common: add unsupported test for free_sized and free_aligned_sized from C23 (#144727)
Signed-off-by: Justin King <jcking@google.com>
2025-06-18 10:24:38 -07:00
Christopher Ferris
a2cee05449 [scudo] Make report pointers const. (#144624)
Mark as many of the reportXX functions that take pointers const. This
avoid the need to use const_cast when calling these functions on an
already const pointer.

Fix reportHeaderCorruption calls where an argument was passed into an
append call that didn't use them.
2025-06-18 09:12:53 -07:00
Omair Javaid
6f4add3480 [compiler-rt] [Fuzzer] Fix ARMv7 test link failure by linking unwinder (#144495)
compiler-rt/lib/fuzzer/tests build was failing on armv7, with undefined
references to unwinder symbols, such as __aeabi_unwind_cpp_pr0.

This occurs because the test is built with `-nostdlib++` but `libunwind`
is not explicitly linked to the final test executable.

This patch resolves the issue by adding CMake logic to explicitly link
the required unwinder to the fuzzer tests, inspired by the same solution
used to fix Scudo build failures by https://reviews.llvm.org/D142888.
2025-06-18 19:23:54 +05:00
Kunqiu Chen
10f29a6072 [MSan] Fix wrong unpoison size in SignalAction (#144071)
MSan should unpoison the parameters of extended signal handlers. 
However, MSan unpoisoned the second parameter with the wrong size 
`sizeof(__sanitizer_sigaction)`, inconsistent with its real type 
`siginfo_t`.

This commit fixes this issue by correcting the size to 
`sizeof(__sanitizer_siginfo)`.
2025-06-18 14:53:33 +08:00
Justin King
80f3a28bbe Revert "lsan: Support free_sized and free_aligned_sized from C23" (#144575)
Reverts llvm/llvm-project#144415

Need to update approach to handle Apple platforms gracefully.
2025-06-17 11:28:14 -07:00
Garvit Gupta
3a06e9a710 Conditionalise the addition of Aarch64 function Multi versioning support on aarch64 target (#143749)
Currently, `ENABLE_BAREMETAL_AARCH64_FMV` is added to builtin defines
for all baremetal targets though it is only needed for aarch64. This
patch fixes this by adding it only for aarch64 target.
2025-06-17 23:09:38 +05:30
Justin King
95418bc8a8 lsan: Support free_sized and free_aligned_sized from C23 (#144415)
Adds support to LSan for `free_sized` and `free_aligned_sized` from C23.

Other sanitizers will be handled with their own separate PRs.

For #144435

Signed-off-by: Justin King <jcking@google.com>
2025-06-16 14:29:08 -07:00
Yuta Saito
60a59e350b [ASan] Recognize WASI platform in sanitizer_platform.h (#139017) 2025-06-17 06:23:50 +09:00
Chris Apple
b983431c28 [rtsan] Fix issue when intercepted function was not execve in test (#144018) 2025-06-15 06:55:22 -07:00
Chris Apple
147a4c7743 [rtsan] Fix issue where close test would lead to crash (#144017) 2025-06-15 06:54:11 -07:00
Kunqiu Chen
2796c41249 [MSan] Fix minor issues in testcases (#144073)
Previously,
1. ifaddrs.cpp : mistake `size_t (xxx)` as `sizeof (xxx)`, resulting in 
inadequate checks.
2. qsort.cpp : mistake `kSize2` as `kSize1`, resulting in an unexpected
buffer overlow issue.
2025-06-14 14:59:36 +08:00
Kazu Hirata
cd573e0a54 [compiler-rt] Remove unused local variables (NFC) (#144010) 2025-06-12 22:45:08 -07:00
Charles Zablit
20d5d09e99 [compiler-rt] remove unused default in compiler-rt lit tests (#143738)
In https://github.com/llvm/llvm-project/pull/143183 was mistakenly added
a default value to `python_root_dir` in lit tests of compiler-rt.

This is unused by the lit tests of compiler-rt, as it was meant to be
used by `lldb`.

This patch removes this change.
2025-06-12 11:37:25 +01:00
Jameson Nash
082251bba4 [AArch64] fix trampoline implementation: use X15 (#126743)
AAPCS64 reserves any of X9-X15 for a compiler to choose to use for this
purpose, and says not to use X16 or X18 like GCC (and the previous
implementation) chose to use. The X18 register may need to get used by
the kernel in some circumstances, as specified by the platform ABI, so
it is generally an unwise choice. Simply choosing a different register
fixes the problem of this being broken on any platform that actually
follows the platform ABI (which is all of them except EABI, if I am
reading this linux kernel bug correctly
https://lkml2.uits.iu.edu/hypermail/linux/kernel/2001.2/01502.html). As
a side benefit, also generate slightly better code and avoids needing
the compiler-rt to be present. I did that by following the XCore
implementation instead of PPC (although in hindsight, following the
RISCV might have been slightly more readable). That X18 is wrong to use
for this purpose has been known for many years (e.g.
https://www.mail-archive.com/gcc@gcc.gnu.org/msg76934.html) and also
known that fixing this to use one of the correct registers is not an ABI
break, since this only appears inside of a translation unit. Some of the
other temporary registers (e.g. X9) are already reserved inside llvm for
internal use as a generic temporary register in the prologue before
saving registers, while X15 was already used in rare cases as a scratch
register in the prologue as well, so I felt that seemed the most logical
choice to choose here.
2025-06-11 21:49:01 -04:00
Jake Egan
d7c6cad744 [sanitizer_common] Implement interception on AIX (#138606)
Adjust AIX interceptor support in sanitizer_common. 

Issue: https://github.com/llvm/llvm-project/issues/138916
2025-06-11 20:22:15 -04:00
Aiden Grossman
3cef099ced [TySan][CMake] Depend on tysan for check-tysan in runtimes build (#143597)
The runtimes build expects libclang_rt.tysan.a to be available, but the
check-tysan target does not actually depend on it when built using a
runtimes build with LLVM_ENABLE_RUNTIMES pointing at ./llvm. This means
we get test failures when running check-compiler-rt due to the missing
static archive.

This patch also makes check-tysan depend on tysan when we are using the
runtimes build.

This is causing premerge failures currently since we recently migrated
to the runtimes build.
2025-06-10 18:06:13 -07:00
Florian Mayer
32d2b6ba47 [HWASAN] Disable LSan test on Android (#143625)
Android HWASan does not support LSan.
2025-06-10 15:58:53 -07:00
Andrew Rogers
c30952592a [compiler-rt] replicate changes from llvm/ProfileData/InstrProfData.inc (#143574)
## Purpose
The compiler-rt project `check-same-common-code.test` test case started
failing after #142861 was merged. This change addresses the failure.

## Overview
This patch replicates the changes made by #142861 to
llvm/include/llvm/ProfileData/InstrProfData.inc in the duplicated file
compiler-rt/include/profile/InstrProfData.inc. These files otherwise
match.

## Validation
Locally built `check-profile` target and verified
`check-same-common-code.test` now passes.
2025-06-10 10:45:21 -07:00
Victor Campos
a59a8ae1a9 [compiler-rt][ARM] Add missing PACBTI support to assembly aeabi functions (#142400)
Some of the aeabi functions were missing PACBTI support. The lack of it
resulted in exceptions at runtime if the running environment had PAC
and/or BTI enabled.

This patch adds this support. This involves the addition of PACBTI
instructions, depending on whether each of these features is enabled,
plus the saving and restoring of the PAC code that resides in r12. Some
of the common code has been put in preprocessor macros to reduce
duplication, but not all, especially since some register saving and
restoring is very specific to each context.
2025-06-10 10:20:42 +01:00
Peter Collingbourne
b3837f1392 cfi: Re-enable tests with lld on i386. NFCI.
Originally disabled because of #34200 but that bug has long since
been fixed.

Reviewers: fmayer

Reviewed By: fmayer

Pull Request: https://github.com/llvm/llvm-project/pull/143459
2025-06-09 16:41:13 -07:00
Sam Elliott
6f6dc9c8ba [RISCV] Implement Feature Bits for B, E, H (#143436)
As defined in riscv-non-isa/riscv-c-api-doc#109.
2025-06-09 15:01:18 -07:00
Thurston Dang
a178c06add [tsan] Don't symbolize stack traces if dl_iterate_phdr is not ready (#143199)
When a CHECK() fails during TSan initialization, it may segfault (e.g., https://github.com/google/sanitizers/issues/837#issuecomment-2939267531). This is because a failed CHECK() will attempt to print a symbolized stack trace, which requires dl_iterate_phdr, but the interceptor may not yet be set up.

This patch fixes the issue by not symbolizing the stack trace if the dl_iterate_phdr interceptor is not ready.
2025-06-09 09:29:16 -07:00
Charles Zablit
b62488f832 [lldb] make lit use the same PYTHONHOME for building and testing (#143183)
When testing LLDB, we want to make sure to use the same Python as the
one we used to build it.

This patch used the CMake variable `Python3_ROOT_DIR` to set the
`PYTHONHOME` env variable in LLDB lit tests, in order to ensure of this.

Please see https://github.com/swiftlang/swift/pull/82063 for the
original issue.
2025-06-09 10:20:39 +01:00
Victor Campos
a6532bd154 [compiler-rt][AArch64] Readd SME ABI routines files to the build (#142953)
Commit 75c3ff8c0b inadvertently removed
some files from the build related to the SME ABI routines.

This patch fixes the issue by reintroducing the files to the build in
CMake.
2025-06-05 14:27:42 +01:00
Rainer Orth
70fce92027 [sanitizer_common] Remove <procfs.h> workaround on Solaris (#142758)
`sanitizer_procmaps_solaris.cpp` currently uses `#undef
_FILE_OFFSET_BITS` to hack around the fact that old versions of Solaris
`<procfs.h>` don't work in a largefile environment:

```
/usr/include/sys/procfs.h:42:2: error: #error "Cannot use procfs in the large file compilation environment"
   42 | #error  "Cannot use procfs in the large file compilation environment"
      |  ^~~~~
```

However, this is no longer an issue on either Solaris 11.4 or Illumos.
The workaround only existed for the benefit of Solaris 11.3. While that
had never been supported by LLVM, the sanitizer runtime libs were
imported into GCC's `libsanitzer`. With the removal of Solaris 11.3
support in GCC 15, this is no longer an issue and the workaround can be
removed.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
2025-06-05 08:34:09 +02:00
Florian Mayer
0eccf1385c [LSan] skip leaks from dlerror (#142876)
We have known false positives, and the return value is never
user-managed anyway.
2025-06-04 20:04:16 -07:00