[all-commits] [llvm/llvm-project] b23cac: [compiler-rt] Add 'csan' library for the concurren...
Joseph Huber via All-commits
all-commits at lists.llvm.org
Fri Oct 2 07:54:48 PDT 2026
Branch: refs/heads/users/jhuber6/csan
Home: https://github.com/llvm/llvm-project
Commit: b23cacd5fbbe3511b664f9619ba939eff1ba06b4
https://github.com/llvm/llvm-project/commit/b23cacd5fbbe3511b664f9619ba939eff1ba06b4
Author: Joseph Huber <huberjn at outlook.com>
Date: 2026-10-02 (Fri, 02 Oct 2026)
Changed paths:
M compiler-rt/cmake/caches/AMDGPU.cmake
M compiler-rt/cmake/config-ix.cmake
A compiler-rt/lib/csan/CMakeLists.txt
A compiler-rt/lib/csan/csan.cpp
A compiler-rt/lib/csan/csan.h
A compiler-rt/lib/csan/csan_defs.h
A compiler-rt/lib/csan/csan_flags.inc
A compiler-rt/lib/csan/csan_gpu.cpp
A compiler-rt/lib/csan/csan_offload_packet.h
A compiler-rt/lib/csan/csan_report.cpp
A compiler-rt/lib/csan/csan_watch.h
A compiler-rt/lib/csan/offload/CMakeLists.txt
A compiler-rt/lib/csan/offload/csan_offload.h
A compiler-rt/lib/csan/offload/csan_offload_hsa_interceptors.cpp
A compiler-rt/lib/csan/offload/csan_offload_report.cpp
M compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
M compiler-rt/lib/sanitizer_common/sanitizer_offload_opcodes.h
A compiler-rt/test/csan/AMDGPU/aba-race.hip
A compiler-rt/test/csan/AMDGPU/array-race.hip
A compiler-rt/test/csan/AMDGPU/atomic-nonatomic.hip
A compiler-rt/test/csan/AMDGPU/atomic.hip
A compiler-rt/test/csan/AMDGPU/disjoint.hip
A compiler-rt/test/csan/AMDGPU/global-race.hip
A compiler-rt/test/csan/AMDGPU/helper-race.hip
A compiler-rt/test/csan/AMDGPU/lds-disjoint.hip
A compiler-rt/test/csan/AMDGPU/lds-race.hip
A compiler-rt/test/csan/AMDGPU/lit.local.cfg.py
A compiler-rt/test/csan/AMDGPU/memcpy-large-race.hip
A compiler-rt/test/csan/AMDGPU/memcpy-race.hip
A compiler-rt/test/csan/AMDGPU/memmove-race.hip
A compiler-rt/test/csan/AMDGPU/openmp-race.cpp
A compiler-rt/test/csan/AMDGPU/race.h
A compiler-rt/test/csan/AMDGPU/shared-watchpoints.hip
A compiler-rt/test/csan/AMDGPU/single-thread.hip
A compiler-rt/test/csan/AMDGPU/write-read-race.hip
A compiler-rt/test/csan/CMakeLists.txt
A compiler-rt/test/csan/access-sizes.cpp
A compiler-rt/test/csan/atomic-nonatomic.cpp
A compiler-rt/test/csan/atomic.cpp
A compiler-rt/test/csan/halt-on-error.cpp
A compiler-rt/test/csan/ignore-thread.cpp
A compiler-rt/test/csan/large-access.cpp
A compiler-rt/test/csan/large-range-race.cpp
A compiler-rt/test/csan/lit.common.cfg.py
A compiler-rt/test/csan/lit.site.cfg.py.in
A compiler-rt/test/csan/race.cpp
A compiler-rt/test/csan/read-read.cpp
A compiler-rt/test/csan/single-thread.cpp
A compiler-rt/test/csan/unknown-origin.cpp
M compiler-rt/test/lit.common.cfg.py
Log Message:
-----------
[compiler-rt] Add 'csan' library for the concurrency sanitizer
Summary:
Adds the runtime for the concurrency sanitizer, both CPU and GPU.
Fundamentally, this works using the following pseudocode:
```c
static u64 watchpoints[N]; // Hash-indexed, zero is empty.
// Emitted before the access, so we never trip on our own write.
void check_access(volatile void *addr, u32 size, u32 type) {
// Every access probes. A read conflicts only with a watched write, a
// write conflicts with either.
if (u64 *wp = find_watchpoint(addr, size, type))
consume(wp, this_pc()); // Hand our location to the owner.
if (!should_sample()) // Wave-uniform, 1-in-N chance.
return;
u64 *wp = arm_watchpoint(addr, size, type);
if (!wp) // Slot is already taken.
return;
auto old = read(addr, size);
delay(ctx.rand()); // Randomized, bounded.
if (void *peer = disarm(wp))
report_race(addr, this_pc(), peer);
else if (read(addr, size) != old)
report_race(addr, this_pc(), UNKNOWN);
}
```
This implementation is kept intentionally minimal to simplify the review
process. Many options are planned for later. The intended use is for
users to pass `-fsanitize=concurrency` for supported compilations.
Commit: 6c0ff5a72cfafbeacda0b4ecdcff3b66b4557b6d
https://github.com/llvm/llvm-project/commit/6c0ff5a72cfafbeacda0b4ecdcff3b66b4557b6d
Author: Joseph Huber <huberjn at outlook.com>
Date: 2026-10-02 (Fri, 02 Oct 2026)
Changed paths:
M compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
M compiler-rt/cmake/config-ix.cmake
M compiler-rt/lib/csan/CMakeLists.txt
M compiler-rt/lib/csan/csan_gpu.cpp
M compiler-rt/lib/csan/offload/CMakeLists.txt
M compiler-rt/test/csan/CMakeLists.txt
Log Message:
-----------
comments
Commit: 1b61044426b75d30deb53ba03a19b2d40093e85b
https://github.com/llvm/llvm-project/commit/1b61044426b75d30deb53ba03a19b2d40093e85b
Author: Joseph Huber <huberjn at outlook.com>
Date: 2026-10-02 (Fri, 02 Oct 2026)
Changed paths:
M compiler-rt/lib/csan/CMakeLists.txt
A compiler-rt/lib/csan/csan.syms.extra
M compiler-rt/lib/csan/offload/CMakeLists.txt
M compiler-rt/lib/csan/offload/csan_offload_hsa_interceptors.cpp
A compiler-rt/lib/csan/offload/csan_offload_preinit.cpp
M compiler-rt/test/csan/AMDGPU/global-race.hip
M compiler-rt/test/csan/AMDGPU/openmp-race.cpp
A compiler-rt/test/csan/hsa-load-order.cpp
A compiler-rt/test/csan/hsa-missing.cpp
M compiler-rt/test/csan/lit.common.cfg.py
M compiler-rt/test/csan/race.cpp
Log Message:
-----------
[compiler-rt] Remove dlsym interceptor and support `-shared-libsan` for CSan
Summary:
Follow the UBSan offload runtime. Offload now resolves HSA through the
global scope, so the `dlsym` interceptor is no longer needed. The real
HSA entry points are still taken from the loaded HSA library rather than
`RTLD_NEXT`, since every DSO with a static runtime exports the same
wrappers and they would otherwise chain back into each other.
Build `libclang_rt.csan.so` with the offload objects folded in. The
exported HSA wrappers report failure when HSA is absent and warn when HSA
was loaded ahead of the runtime. The preinit hook moves to a separate
`csan_offload-preinit` archive for executables.
Commit: 4da2d7a4bdb07461474e7438491b8d90e144e066
https://github.com/llvm/llvm-project/commit/4da2d7a4bdb07461474e7438491b8d90e144e066
Author: Joseph Huber <huberjn at outlook.com>
Date: 2026-10-02 (Fri, 02 Oct 2026)
Changed paths:
M compiler-rt/lib/csan/csan.cpp
M compiler-rt/lib/csan/csan_gpu.cpp
A compiler-rt/test/csan/AMDGPU/volatile.hip
A compiler-rt/test/csan/volatile.cpp
Log Message:
-----------
Remove separate volatile entry points
Commit: 5daee6596ca126e1faf59dc3766bc6b52b80d605
https://github.com/llvm/llvm-project/commit/5daee6596ca126e1faf59dc3766bc6b52b80d605
Author: Joseph Huber <huberjn at outlook.com>
Date: 2026-10-02 (Fri, 02 Oct 2026)
Changed paths:
M compiler-rt/lib/csan/csan.cpp
M compiler-rt/test/csan/access-sizes.cpp
Log Message:
-----------
Use unaligned loads when snapshotting watched values
Compare: https://github.com/llvm/llvm-project/compare/a22dd47342b5...5daee6596ca1
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list