lib/Analysis/AssumptionCache.cpp:137: void llvm::AssumptionCache::removeAffectedValues(AssumeInst *): Assertion `Found && "already unregistered or incorrect cache state"' failed.
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Encountered in stage3 (bootstrapping build) in CI: https://github.com/llvm/llvm-project/actions/runs/27967103371/job/82903721978?pr=199111
```
[2955/2965] Generating FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.o
FAILED: compiler-rt/lib/fuzzer/tests/FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/tests/FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.o
cd /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/tests && /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -Wall -Wno-unused-parameter -Wno-unknown-warning-option -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -I/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/include -g -Wno-covered-switch-default -Wno-suggest-override -DGTEST_NO_LLVM_SUPPORT=1 -DGTEST_HAS_RTTI=0 -I/home/gha/actions-runner/_work/llvm-project/llvm-project/runtimes/../third-party/unittest/googletest/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/runtimes/../third-party/unittest/googletest -I/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/fuzzer -fno-rtti -O2 -nostdinc++ -fno-exceptions -fvisibility=hidden -isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/include/c++/v1 -std=c++17 -c -o FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.o /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp
clang++: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Analysis/AssumptionCache.cpp:137: void llvm::AssumptionCache::removeAffectedValues(AssumeInst *): Assertion `Found && "already unregistered or incorrect cache state"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
Stack dump:
0. Program arguments: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -Wall -Wno-unused-parameter -Wno-unknown-warning-option -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -I/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/include -g -Wno-covered-switch-default -Wno-suggest-override -DGTEST_NO_LLVM_SUPPORT=1 -DGTEST_HAS_RTTI=0 -I/home/gha/actions-runner/_work/llvm-project/llvm-project/runtimes/../third-party/unittest/googletest/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/runtimes/../third-party/unittest/googletest -I/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/fuzzer -fno-rtti -O2 -nostdinc++ -fno-exceptions -fvisibility=hidden -isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/include/c++/v1 -std=c++17 -c -o FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.o /home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp
1. parser at end of file
2. Optimizer
3. Running pass "function(drop-unnecessary-assumes,float2int,lower-constant-intrinsics,loop(loop-rotate,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize,drop-unnecessary-assumes,infer-alignment,loop-load-elim,instcombine,simplifycfg,slp-vectorizer,vector-combine,instcombine,loop-unroll,transform-warning,sroa,infer-alignment,instcombine,loop-mssa(licm),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,mergeicmps,expand-memcmp,tailcallelim,simplifycfg)" on module "/home/gha/actions-runner/_work/llvm-project/llvm-project/compiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp"
4. Running pass "drop-unnecessary-assumes" on function "_ZNK6fuzzer7Command11hasArgumentERKNSt8__Fuzzer12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE"
#0 0x000055e0fd76eaf8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x205baf8)
#1 0x000055e0fd76ba71 llvm::sys::RunSignalHandlers() (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x2058a71)
#2 0x000055e0fd76d6fc llvm::sys::CleanupOnSignal(unsigned long) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x205a6fc)
#3 0x000055e0fd6d23d6 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#4 0x00007f14bf215330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#5 0x00007f14bf26eb2c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#6 0x00007f14bf26eb2c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#7 0x00007f14bf26eb2c pthread_kill ./nptl/pthread_kill.c:89:10
#8 0x00007f14bf21527e raise ./signal/../sysdeps/posix/raise.c:27:6
#9 0x00007f14bf1f88ff abort ./stdlib/abort.c:81:7
#10 0x00007f14bf1f881b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#11 0x00007f14bf20b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#12 0x000055e0fca48d4b llvm::AssumptionCache::removeAffectedValues(llvm::AssumeInst*) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x1335d4b)
#13 0x000055e0fca48e0f llvm::AssumptionCache::replaceAssumption(llvm::WeakVH&, llvm::AssumeInst*) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x1335e0f)
#14 0x000055e101057cb9 llvm::DropUnnecessaryAssumesPass::run(llvm::Function&, llvm::AnalysisManager&) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x5944cb9)
#15 0x000055e0fd27ab79 llvm::PassManager>::run(llvm::Function&, llvm::AnalysisManager&) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x1b67b79)
#16 0x000055e0fd27ea4c llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager&) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x1b6ba4c)
#17 0x000055e0fd279d19 llvm::PassManager>::run(llvm::Module&, llvm::AnalysisManager&) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x1b66d19)
#18 0x000055e0fd993b69 (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr>&, std::unique_ptr>&, clang::BackendConsumer*) BackendUtil.cpp:0:0
#19 0x000055e0fd9892ea clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr, std::unique_ptr>, clang::BackendConsumer*) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x22762ea)
#20 0x000055e0fdf41aa4 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x282eaa4)
#21 0x000055e0ff8ab709 clang::ParseAST(clang::Sema&, bool, bool) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x4198709)
#22 0x000055e0fe21b0b6 clang::FrontendAction::Execute() (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x2b080b6)
#23 0x000055e0fe17aa09 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x2a67a09)
#24 0x000055e0fe30816f clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x2bf516f)
#25 0x000055e0fc42832b cc1_main(llvm::ArrayRef, char const*, void*) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0xd1532b)
#26 0x000055e0fc4242d5 ExecuteCC1Tool(llvm::SmallVectorImpl&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr) driver.cpp:0:0
#27 0x000055e0fc42672d int llvm::function_ref&)>::callback_fn(long, llvm::SmallVectorImpl&) driver.cpp:0:0
#28 0x000055e0fdfac109 void llvm::function_ref::callback_fn>, std::__cxx11::basic_string, std::allocator>*, bool*) const::$_0>(long) Job.cpp:0:0
#29 0x000055e0fd6d20ee llvm::CrashRecoveryContext::RunSafely(llvm::function_ref) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x1fbf0ee)
#30 0x000055e0fdfab6ac clang::driver::CC1Command::Execute(llvm::ArrayRef>, std::__cxx11::basic_string, std::allocator>*, bool*) const (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x28986ac)
#31 0x000055e0fdf6803c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x285503c)
#32 0x000055e0fdf68257 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl>&, bool) const (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x2855257)
#33 0x000055e0fdf87778 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl>&) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0x2874778)
#34 0x000055e0fc423b3d clang_main(int, char**, llvm::ToolContext const&) (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0xd10b3d)
#35 0x000055e0fc433bed main (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0xd20bed)
#36 0x00007f14bf1fa1ca __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#37 0x00007f14bf1fa28b call_init ./csu/../csu/libc-start.c:128:20
#38 0x00007f14bf1fa28b __libc_start_main ./csu/../csu/libc-start.c:347:5
#39 0x000055e0fc421cc5 _start (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/./bin/clang+++0xd0ecc5)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 23.0.0git (https://github.com/llvm/llvm-project b242228f0cdb09a792faf07f2efba801c1251e4f)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bootstrapping-build/bin
Build config: +assertions
clang++: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING CRASH REPRODUCER FILES TO THE BUG REPORT:
clang++: note: diagnostic msg: /tmp/FuzzerUnittest-acb856.cpp
clang++: note: diagnostic msg: /tmp/FuzzerUnittest-acb856.sh
clang++: note: diagnostic msg:
********************
```
Contributor guide
Research direction
Start with llvm/lib/Analysis/AssumptionCache.cpp:137 and trace removeAffectedValues through replaceAssumption, then inspect DropUnnecessaryAssumesPass in the stack trace. Reproduce the stage3 failure using compiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp and verify that the bootstrap build no longer aborts with the incorrect cache-state assertion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100