[compiler-rt] [sanitizer-common][rtsan] Add rtsan to sanitizer-common suites (PR #217094)

Chris Apple via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 11:59:05 PDT 2026


https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/217094

>From 6440a68c4bfabd355d6845aef2475ed59c3e87a1 Mon Sep 17 00:00:00 2001
From: Chris Apple <cja-private at pm.me>
Date: Fri, 31 Jul 2026 16:45:41 -0700
Subject: [PATCH 1/3] [sanitizer-common][rtsan] Add rtsan to sanitizer-common
 suites

---
 compiler-rt/test/sanitizer_common/CMakeLists.txt              | 2 +-
 .../test/sanitizer_common/TestCases/Darwin/abort_on_error.cpp | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt
index 739879d961248..31de8228faa8d 100644
--- a/compiler-rt/test/sanitizer_common/CMakeLists.txt
+++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt
@@ -7,7 +7,7 @@ set(SANITIZER_COMMON_TESTSUITES)
 # FIXME(dliew): We should switch to COMPILER_RT_SANITIZERS_TO_BUILD instead of
 # the hard coded `SUPPORTED_TOOLS_INIT` list once we know that the other
 # sanitizers work.
-set(SUPPORTED_TOOLS_INIT asan lsan hwasan msan tsan ubsan)
+set(SUPPORTED_TOOLS_INIT asan lsan hwasan msan tsan ubsan rtsan)
 set(SUPPORTED_TOOLS)
   foreach(SANITIZER_TOOL ${SUPPORTED_TOOLS_INIT})
     string(TOUPPER ${SANITIZER_TOOL} SANITIZER_TOOL_UPPER)
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Darwin/abort_on_error.cpp b/compiler-rt/test/sanitizer_common/TestCases/Darwin/abort_on_error.cpp
index f94bd51ed9e04..4bca815c433fd 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Darwin/abort_on_error.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Darwin/abort_on_error.cpp
@@ -14,12 +14,12 @@
 
 int global;
 
-int main() {
+int main() [[clang::nonblocking]] {
 #if defined(USING_ubsan)
   volatile int *null = 0;
   *null = 0;
 #else
-  volatile int *a = new int[100];
+  volatile int *a = new int[100]; // allocation triggers RTSan report
   delete[] a;
   global = a[0]; // use-after-free: triggers ASan/TSan report.
 #endif

>From 01d1f4d7bcac627c5e9429e942a5b8808634483e Mon Sep 17 00:00:00 2001
From: Chris Apple <cja-private at pm.me>
Date: Wed, 26 Aug 2026 20:34:44 -0700
Subject: [PATCH 2/3] PR: Disable a few more unsupported tests

---
 .../test/sanitizer_common/TestCases/Linux/tls_get_addr.c      | 2 +-
 .../TestCases/sanitizer_coverage_trace_pc_guard-init.cpp      | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_get_addr.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_get_addr.c
index a4a4f64ed3706..2547495fe3dc1 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_get_addr.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_get_addr.c
@@ -8,7 +8,7 @@
 // XFAIL: i386-linux
 
 // These don't intercept __tls_get_addr.
-// XFAIL: lsan,hwasan,ubsan
+// XFAIL: lsan,hwasan,ubsan,rtsan
 
 // FIXME: Fails for unknown reasons.
 // UNSUPPORTED: powerpc64le-target-arch
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-init.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-init.cpp
index cd5ea30713a57..560875b074083 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-init.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-init.cpp
@@ -2,6 +2,10 @@
 //
 // REQUIRES: has_sancovcc,stable-runtime,x86_64-linux
 //
+
+// rtsan doesn't currently support coverage
+// UNSUPPORTED: rtsan
+
 // RUN: rm -rf %t_workdir
 // RUN: mkdir -p %t_workdir
 // RUN: cd %t_workdir

>From f50d87263e3d3ef3f0f8d167ca240bc2b535a25c Mon Sep 17 00:00:00 2001
From: Chris Apple <cja-private at pm.me>
Date: Wed, 26 Aug 2026 21:26:54 -0700
Subject: [PATCH 3/3] PR: Unsupported coverage, signal handlers, instruction
 dumping, tls

---
 .../TestCases/Linux/aligned_alloc-alignment.cpp                 | 2 +-
 .../sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp     | 1 +
 .../sanitizer_common/TestCases/Linux/dump_registers_x86_64.cpp  | 1 +
 compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cpp       | 1 +
 .../test/sanitizer_common/TestCases/Linux/pvalloc-overflow.cpp  | 2 +-
 .../sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp     | 2 +-
 .../sanitizer_common/TestCases/Posix/dump_instruction_bytes.cpp | 1 +
 compiler-rt/test/sanitizer_common/TestCases/Posix/fpe.cpp       | 1 +
 .../test/sanitizer_common/TestCases/reallocarray-overflow.cpp   | 2 +-
 .../TestCases/sanitizer_coverage_allowlist_ignorelist.cpp       | 2 +-
 .../sanitizer_coverage_inline8bit_counter_default_impl.cpp      | 1 +
 .../sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp | 1 +
 12 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/aligned_alloc-alignment.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/aligned_alloc-alignment.cpp
index ef7f1cb44e60c..ee0a071380f7b 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/aligned_alloc-alignment.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/aligned_alloc-alignment.cpp
@@ -14,7 +14,7 @@
 
 // REQUIRES: stable-runtime
 
-// UNSUPPORTED: android, ubsan
+// UNSUPPORTED: android, rtsan, ubsan
 
 #include <assert.h>
 #include <errno.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp
index d0400afe743b3..c4f89947abe24 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/decorate_proc_maps.cpp
@@ -3,6 +3,7 @@
 
 // REQUIRES: stable-runtime
 // XFAIL: android && asan
+// UNSUPPORTED: rtsan
 
 #include <errno.h>
 #include <fcntl.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/dump_registers_x86_64.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/dump_registers_x86_64.cpp
index aac3c3fbd1052..093f2a02c3293 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/dump_registers_x86_64.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/dump_registers_x86_64.cpp
@@ -4,6 +4,7 @@
 // RUN: not %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-DUMP --strict-whitespace
 //
 // REQUIRES: x86_64-target-arch && glibc
+// UNSUPPORTED: rtsan
 
 #include <signal.h>
 
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cpp
index fb9133ee80d06..e73e50c25e4b6 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/ill.cpp
@@ -7,6 +7,7 @@
 
 // FIXME: seems to fail on ARM
 // REQUIRES: x86_64-target-arch
+// UNSUPPORTED: rtsan
 #include <assert.h>
 #include <stdio.h>
 #include <sanitizer/asan_interface.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/pvalloc-overflow.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/pvalloc-overflow.cpp
index b082191cb0092..55424c11d8d2a 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/pvalloc-overflow.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/pvalloc-overflow.cpp
@@ -6,7 +6,7 @@
 
 // REQUIRES: stable-runtime
 
-// UNSUPPORTED: android, target={{.*(freebsd|netbsd).*}}, ubsan
+// UNSUPPORTED: android, rtsan, target={{.*(freebsd|netbsd).*}}, ubsan
 
 // Checks that pvalloc overflows are caught. If the allocator is allowed to
 // return null, the errno should be set to ENOMEM.
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp
index 3e9ff924a3c4a..f63e44caa008b 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp
@@ -6,7 +6,7 @@
 // UNSUPPORTED: i386-linux
 
 // Do not intercept __tls_get_addr
-// UNSUPPORTED: hwasan, lsan, ubsan, android
+// UNSUPPORTED: hwasan, lsan, ubsan, android, rtsan
 
 // FIXME: Investigate
 // UNSUPPORTED: target=powerpc64{{.*}}
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/dump_instruction_bytes.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/dump_instruction_bytes.cpp
index f42802a34582b..51ea5080f066a 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/dump_instruction_bytes.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/dump_instruction_bytes.cpp
@@ -6,6 +6,7 @@
 // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NODUMP
 
 // REQUIRES: x86-target-arch
+// UNSUPPORTED: rtsan
 
 int main() {
 #if defined(__x86_64__)
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/fpe.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/fpe.cpp
index 0bbe906567993..4ac2f43a8ab65 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/fpe.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/fpe.cpp
@@ -6,6 +6,7 @@
 
 // FIXME: seems to fail on ARM
 // REQUIRES: x86_64-target-arch
+// UNSUPPORTED: rtsan
 #include <assert.h>
 #include <stdio.h>
 #include <sanitizer/asan_interface.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/reallocarray-overflow.cpp b/compiler-rt/test/sanitizer_common/TestCases/reallocarray-overflow.cpp
index 245a5b47ab246..6e78b08249beb 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/reallocarray-overflow.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/reallocarray-overflow.cpp
@@ -2,7 +2,7 @@
 // RUN: %env_tool_opts=allocator_may_return_null=0 not %run %t 2>&1 | FileCheck %s
 // RUN: %env_tool_opts=allocator_may_return_null=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NULL
 
-// REQUIRES: stable-runtime && !ubsan && !darwin
+// REQUIRES: stable-runtime && !ubsan && !darwin && !rtsan
 
 #include <stdio.h>
 
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_allowlist_ignorelist.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_allowlist_ignorelist.cpp
index 933997cedd9f8..3a857cd2cc983 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_allowlist_ignorelist.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_allowlist_ignorelist.cpp
@@ -3,7 +3,7 @@
 // options
 
 // REQUIRES: has_sancovcc,stable-runtime
-// UNSUPPORTED: darwin
+// UNSUPPORTED: darwin, rtsan
 // XFAIL: ubsan,tsan
 // XFAIL: android && asan
 
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter_default_impl.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter_default_impl.cpp
index 1d1fbf7299e8b..03920491a73d7 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter_default_impl.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter_default_impl.cpp
@@ -2,6 +2,7 @@
 // -fsanitize-coverage=inline-8bit-counters,pc-table
 
 // REQUIRES: has_sancovcc,stable-runtime,linux,x86_64-target-arch
+// UNSUPPORTED: rtsan
 
 /// In glibc 2.39+, fprintf has a nonnull attribute. Disable nonnull-attribute,
 /// which would increase counters for ubsan.
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp
index ba59e28f688a7..dc8f999e7f951 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cpp
@@ -2,6 +2,7 @@
 //
 // REQUIRES: x86_64-linux
 // XFAIL: tsan
+// UNSUPPORTED: rtsan
 //
 // RUN: rm -rf %t_workdir
 // RUN: mkdir -p %t_workdir



More information about the llvm-commits mailing list