Skip to content

Conversation

@topperc
Copy link
Collaborator

@topperc topperc commented Nov 19, 2025

This prevents it from being optimized out in non-assert builds.

Update X86 test to remove REQUIRES: asserts and check for LLVM ERROR. Add FileCheck to RISC-V test and remove UNSUPPORTED.

This is the more complete fix for #168772 and #168525.

This prevents it from being optimized out in non-assert builds.

Update X86 test to remove REQUIRES: asserts and check for LLVM ERROR.
Add FileCheck to RISC-V test and remove UNSUPPORTED.

This is the better fix for llvm#168772 and llvm#168525.
@topperc topperc requested review from lenary and mgudim November 19, 2025 21:28
@topperc topperc changed the title [CFIInsert] Turn a reachable llvm_unreachable into a report_fatal_error. [CFIInserter] Turn a reachable llvm_unreachable into a report_fatal_error. Nov 19, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 19, 2025

@llvm/pr-subscribers-backend-x86

Author: Craig Topper (topperc)

Changes

This prevents it from being optimized out in non-assert builds.

Update X86 test to remove REQUIRES: asserts and check for LLVM ERROR. Add FileCheck to RISC-V test and remove UNSUPPORTED.

This is the better fix for #168772 and #168525.


Full diff: https://github.com/llvm/llvm-project/pull/168777.diff

3 Files Affected:

  • (modified) llvm/lib/CodeGen/CFIInstrInserter.cpp (+1-1)
  • (modified) llvm/test/CodeGen/RISCV/cfi-multiple-locations.mir (+4-3)
  • (modified) llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir (+1-3)
diff --git a/llvm/lib/CodeGen/CFIInstrInserter.cpp b/llvm/lib/CodeGen/CFIInstrInserter.cpp
index 14098bc821617..1e65dd230dc86 100644
--- a/llvm/lib/CodeGen/CFIInstrInserter.cpp
+++ b/llvm/lib/CodeGen/CFIInstrInserter.cpp
@@ -272,7 +272,7 @@ void CFIInstrInserter::calculateOutgoingCFAInfo(MBBCFAInfo &MBBInfo) {
           CSRLocMap.insert(
               {CFI.getRegister(), CSRSavedLocation(CSRReg, CSROffset)});
         } else if (It->second.Reg != CSRReg || It->second.Offset != CSROffset) {
-          llvm_unreachable("Different saved locations for the same CSR");
+          report_fatal_error("Different saved locations for the same CSR");
         }
         CSRSaved.set(CFI.getRegister());
       }
diff --git a/llvm/test/CodeGen/RISCV/cfi-multiple-locations.mir b/llvm/test/CodeGen/RISCV/cfi-multiple-locations.mir
index d2e5a8208cecf..55515aa364016 100644
--- a/llvm/test/CodeGen/RISCV/cfi-multiple-locations.mir
+++ b/llvm/test/CodeGen/RISCV/cfi-multiple-locations.mir
@@ -1,7 +1,8 @@
-# RUN: llc -x mir < %s -mtriple=riscv64 \
+# RUN: not --crash llc %s -mtriple=riscv64 \
 # RUN: -run-pass=cfi-instr-inserter \
-# RUN: -riscv-enable-cfi-instr-inserter=true
-# UNSUPPORTED: target={{.*}}
+# RUN: -riscv-enable-cfi-instr-inserter=true 2>&1 | FileCheck %s
+
+# CHECK: LLVM ERROR: Different saved locations for the same CSR
 
 # Technically, it is possible that a callee-saved register is saved in multiple different locations.
 # CFIInstrInserter should handle this, but currently it does not.
diff --git a/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir b/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir
index ef9fb22476a71..8211f8940d27a 100644
--- a/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir
+++ b/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir
@@ -1,4 +1,3 @@
-# REQUIRES: asserts
 # RUN: not --crash llc -o - %s -mtriple=x86_64-- \
 # RUN:     -run-pass=cfi-instr-inserter 2>&1 | FileCheck %s
 # Test that CSR being saved in multiple locations can be caught by
@@ -10,8 +9,7 @@
   }
 ...
 ---
-# CHECK: Different saved locations for the same CSR
-# CHECK-NEXT: UNREACHABLE executed 
+# CHECK: LLVM ERROR: Different saved locations for the same CSR
 name: inconsistentlocs
 body: |
   bb.0:

@llvmbot
Copy link
Member

llvmbot commented Nov 19, 2025

@llvm/pr-subscribers-backend-risc-v

Author: Craig Topper (topperc)

Changes

This prevents it from being optimized out in non-assert builds.

Update X86 test to remove REQUIRES: asserts and check for LLVM ERROR. Add FileCheck to RISC-V test and remove UNSUPPORTED.

This is the better fix for #168772 and #168525.


Full diff: https://github.com/llvm/llvm-project/pull/168777.diff

3 Files Affected:

  • (modified) llvm/lib/CodeGen/CFIInstrInserter.cpp (+1-1)
  • (modified) llvm/test/CodeGen/RISCV/cfi-multiple-locations.mir (+4-3)
  • (modified) llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir (+1-3)
diff --git a/llvm/lib/CodeGen/CFIInstrInserter.cpp b/llvm/lib/CodeGen/CFIInstrInserter.cpp
index 14098bc821617..1e65dd230dc86 100644
--- a/llvm/lib/CodeGen/CFIInstrInserter.cpp
+++ b/llvm/lib/CodeGen/CFIInstrInserter.cpp
@@ -272,7 +272,7 @@ void CFIInstrInserter::calculateOutgoingCFAInfo(MBBCFAInfo &MBBInfo) {
           CSRLocMap.insert(
               {CFI.getRegister(), CSRSavedLocation(CSRReg, CSROffset)});
         } else if (It->second.Reg != CSRReg || It->second.Offset != CSROffset) {
-          llvm_unreachable("Different saved locations for the same CSR");
+          report_fatal_error("Different saved locations for the same CSR");
         }
         CSRSaved.set(CFI.getRegister());
       }
diff --git a/llvm/test/CodeGen/RISCV/cfi-multiple-locations.mir b/llvm/test/CodeGen/RISCV/cfi-multiple-locations.mir
index d2e5a8208cecf..55515aa364016 100644
--- a/llvm/test/CodeGen/RISCV/cfi-multiple-locations.mir
+++ b/llvm/test/CodeGen/RISCV/cfi-multiple-locations.mir
@@ -1,7 +1,8 @@
-# RUN: llc -x mir < %s -mtriple=riscv64 \
+# RUN: not --crash llc %s -mtriple=riscv64 \
 # RUN: -run-pass=cfi-instr-inserter \
-# RUN: -riscv-enable-cfi-instr-inserter=true
-# UNSUPPORTED: target={{.*}}
+# RUN: -riscv-enable-cfi-instr-inserter=true 2>&1 | FileCheck %s
+
+# CHECK: LLVM ERROR: Different saved locations for the same CSR
 
 # Technically, it is possible that a callee-saved register is saved in multiple different locations.
 # CFIInstrInserter should handle this, but currently it does not.
diff --git a/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir b/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir
index ef9fb22476a71..8211f8940d27a 100644
--- a/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir
+++ b/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir
@@ -1,4 +1,3 @@
-# REQUIRES: asserts
 # RUN: not --crash llc -o - %s -mtriple=x86_64-- \
 # RUN:     -run-pass=cfi-instr-inserter 2>&1 | FileCheck %s
 # Test that CSR being saved in multiple locations can be caught by
@@ -10,8 +9,7 @@
   }
 ...
 ---
-# CHECK: Different saved locations for the same CSR
-# CHECK-NEXT: UNREACHABLE executed 
+# CHECK: LLVM ERROR: Different saved locations for the same CSR
 name: inconsistentlocs
 body: |
   bb.0:

@github-actions
Copy link

github-actions bot commented Nov 19, 2025

🐧 Linux x64 Test Results

  • 186417 tests passed
  • 4863 tests skipped

Copy link
Member

@lenary lenary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks

@topperc topperc merged commit 8608344 into llvm:main Nov 20, 2025
10 checks passed
@topperc topperc deleted the pr/multiple-cfi-test branch November 20, 2025 06:32
@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux running on sanitizer-buildbot1 while building llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/22564

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:246: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:257: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/i386-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:235: warning: Compiler lib dir != compiler-rt lib dir
Compiler libdir:     "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/i386-unknown-linux-gnu"
compiler-rt libdir:  "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:246: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:257: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 4666 of 10467 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50
FAIL: SanitizerCommon-tsan-x86_64-Linux :: Linux/pthread_mutex.cpp (2456 of 4666)
******************** TEST 'SanitizerCommon-tsan-x86_64-Linux :: Linux/pthread_mutex.cpp' FAILED ********************
Exit Code: 66

Command Output (stderr):
--
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang  --driver-mode=g++ -gline-tables-only -fsanitize=thread  -m64 -funwind-tables  -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test -ldl -O1 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_mutex.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Linux/Output/pthread_mutex.cpp.tmp &&  /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Linux/Output/pthread_mutex.cpp.tmp # RUN: at line 1
+ /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang --driver-mode=g++ -gline-tables-only -fsanitize=thread -m64 -funwind-tables -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test -ldl -O1 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_mutex.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Linux/Output/pthread_mutex.cpp.tmp
+ /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Linux/Output/pthread_mutex.cpp.tmp
ThreadSanitizer: CHECK failed: tsan_platform.h:992 "((IsAppMemImpl::Apply<Mapping>(x))) != (0)" (0x0, 0x0) (tid=3877355)
    #0 __tsan::CheckUnwind() /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:696:21 (pthread_mutex.cpp.tmp+0x100dc5)
    #1 __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:86:5 (pthread_mutex.cpp.tmp+0x8ab12)
    #2 unsigned long __tsan::MemToShadowImpl::Apply<__tsan::Mapping48AddressSpace>(unsigned long) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_platform.h:992:5 (pthread_mutex.cpp.tmp+0x1007eb)
    #3 auto __tsan::SelectMapping<__tsan::MemToShadowImpl, unsigned long>(unsigned long) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_platform.h:800:10 (pthread_mutex.cpp.tmp+0x1007eb)
    #4 __tsan::MemToShadow(unsigned long) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_platform.h:1003:7 (pthread_mutex.cpp.tmp+0x1007eb)
    #5 __tsan::DontNeedShadowFor(unsigned long, unsigned long) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp (pthread_mutex.cpp.tmp+0x1007eb)
    #6 __tsan::ThreadFinish(__tsan::ThreadState*) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp:244:5 (pthread_mutex.cpp.tmp+0x11fcb8)
    #7 __tsan::DestroyThreadState() /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1003:3 (pthread_mutex.cpp.tmp+0xe1581)
    #8 thread_finalize(void*) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1032:3 (pthread_mutex.cpp.tmp+0xe1581)
    #9 <null> <null> (libc.so.6+0x9f84f) (BuildId: ae7440bbdce614e0e79280c3b2e45b1df44e639c)
    #10 <null> <null> (libc.so.6+0xa26ae) (BuildId: ae7440bbdce614e0e79280c3b2e45b1df44e639c)
    #11 <null> <null> (libc.so.6+0x133b5b) (BuildId: ae7440bbdce614e0e79280c3b2e45b1df44e639c)


--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 

8 warning(s) in tests
Slowest Tests:
--------------------------------------------------------------------------
71.67s: ThreadSanitizer-x86_64 :: deadlock_detector_stress_test.cpp
56.18s: ThreadSanitizer-x86_64 :: restore_stack.cpp
42.78s: libFuzzer-i386-default-Linux :: fork.test
42.33s: libFuzzer-i386-default-Linux :: fork_corpus_groups.test
42.15s: libFuzzer-i386-libcxx-Linux :: fork.test
42.02s: libFuzzer-i386-static-libcxx-Linux :: fork_corpus_groups.test
41.66s: libFuzzer-x86_64-libcxx-Linux :: fork_corpus_groups.test
Step 11 (test compiler-rt debug) failure: test compiler-rt debug (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:246: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:257: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/i386-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:235: warning: Compiler lib dir != compiler-rt lib dir
Compiler libdir:     "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/i386-unknown-linux-gnu"
compiler-rt libdir:  "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:246: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:257: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 4666 of 10467 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50
FAIL: SanitizerCommon-tsan-x86_64-Linux :: Linux/pthread_mutex.cpp (2456 of 4666)
******************** TEST 'SanitizerCommon-tsan-x86_64-Linux :: Linux/pthread_mutex.cpp' FAILED ********************
Exit Code: 66

Command Output (stderr):
--
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang  --driver-mode=g++ -gline-tables-only -fsanitize=thread  -m64 -funwind-tables  -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test -ldl -O1 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_mutex.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Linux/Output/pthread_mutex.cpp.tmp &&  /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Linux/Output/pthread_mutex.cpp.tmp # RUN: at line 1
+ /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang --driver-mode=g++ -gline-tables-only -fsanitize=thread -m64 -funwind-tables -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test -ldl -O1 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/pthread_mutex.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Linux/Output/pthread_mutex.cpp.tmp
+ /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/tsan-x86_64-Linux/Linux/Output/pthread_mutex.cpp.tmp
ThreadSanitizer: CHECK failed: tsan_platform.h:992 "((IsAppMemImpl::Apply<Mapping>(x))) != (0)" (0x0, 0x0) (tid=3877355)
    #0 __tsan::CheckUnwind() /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:696:21 (pthread_mutex.cpp.tmp+0x100dc5)
    #1 __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:86:5 (pthread_mutex.cpp.tmp+0x8ab12)
    #2 unsigned long __tsan::MemToShadowImpl::Apply<__tsan::Mapping48AddressSpace>(unsigned long) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_platform.h:992:5 (pthread_mutex.cpp.tmp+0x1007eb)
    #3 auto __tsan::SelectMapping<__tsan::MemToShadowImpl, unsigned long>(unsigned long) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_platform.h:800:10 (pthread_mutex.cpp.tmp+0x1007eb)
    #4 __tsan::MemToShadow(unsigned long) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_platform.h:1003:7 (pthread_mutex.cpp.tmp+0x1007eb)
    #5 __tsan::DontNeedShadowFor(unsigned long, unsigned long) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp (pthread_mutex.cpp.tmp+0x1007eb)
    #6 __tsan::ThreadFinish(__tsan::ThreadState*) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp:244:5 (pthread_mutex.cpp.tmp+0x11fcb8)
    #7 __tsan::DestroyThreadState() /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1003:3 (pthread_mutex.cpp.tmp+0xe1581)
    #8 thread_finalize(void*) /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1032:3 (pthread_mutex.cpp.tmp+0xe1581)
    #9 <null> <null> (libc.so.6+0x9f84f) (BuildId: ae7440bbdce614e0e79280c3b2e45b1df44e639c)
    #10 <null> <null> (libc.so.6+0xa26ae) (BuildId: ae7440bbdce614e0e79280c3b2e45b1df44e639c)
    #11 <null> <null> (libc.so.6+0x133b5b) (BuildId: ae7440bbdce614e0e79280c3b2e45b1df44e639c)


--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..

8 warning(s) in tests
Slowest Tests:
--------------------------------------------------------------------------
71.67s: ThreadSanitizer-x86_64 :: deadlock_detector_stress_test.cpp
56.18s: ThreadSanitizer-x86_64 :: restore_stack.cpp
42.78s: libFuzzer-i386-default-Linux :: fork.test
42.33s: libFuzzer-i386-default-Linux :: fork_corpus_groups.test
42.15s: libFuzzer-i386-libcxx-Linux :: fork.test
42.02s: libFuzzer-i386-static-libcxx-Linux :: fork_corpus_groups.test
41.66s: libFuzzer-x86_64-libcxx-Linux :: fork_corpus_groups.test
Step 14 (test compiler-rt default) failure: test compiler-rt default (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:246: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:257: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/i386-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:235: warning: Compiler lib dir != compiler-rt lib dir
Compiler libdir:     "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/i386-unknown-linux-gnu"
compiler-rt libdir:  "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:246: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:257: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 10486 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
FAIL: libFuzzer-x86_64-static-libcxx-Linux :: reduce_inputs.test (10392 of 10486)
******************** TEST 'libFuzzer-x86_64-static-libcxx-Linux :: reduce_inputs.test' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
rm -rf /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C # RUN: at line 3
+ rm -rf /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C
mkdir -p /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C # RUN: at line 4
+ mkdir -p /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowSimpleTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest # RUN: at line 5
+ /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowSimpleTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowTest # RUN: at line 6
+ /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowTest
/home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest  -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60   -runs=1000000 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test # RUN: at line 7
+ /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C
+ FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test
/home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -runs=0 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test --check-prefix=COUNT # RUN: at line 11
+ /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -runs=0 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64StaticLibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C
+ FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test --check-prefix=COUNT
/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test:12:8: error: COUNT: expected string not found in input
COUNT: seed corpus: files: 4
       ^
<stdin>:1:1: note: scanning from here
INFO: Running with entropic power schedule (0xFF, 100).
^
<stdin>:7:7: note: possible intended match here
INFO: seed corpus: files: 3 min: 2b max: 3b total: 7b rss: 31Mb
      ^

Input file: <stdin>
Check file: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: INFO: Running with entropic power schedule (0xFF, 100). 
check:12'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found

@@ -1,7 +1,8 @@
# RUN: llc -x mir < %s -mtriple=riscv64 \
# RUN: not --crash llc %s -mtriple=riscv64 \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change llc will now open cfi-multiple-locations.s for writing in the local directory (which may be write protected). Can we add back the "-x mir < " or add "-o -" or something to avoid this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants