Issue |
128427
|
Summary |
[clang] clang-analyzer-osx.SecKeychainAPI crash on failed assertion
|
Labels |
clang
|
Assignees |
|
Reporter |
douzzer
|
Crash first showed up in `llvm-core/clang-21.0.0_pre20250221` (`21.0.0git58159909`), OK on previous run with `21.0.0git2cd8207b`, and OK on pre20250222 with `-clang-analyzer-osx.SecKeychainAPI` added to `checks`.
```
clang-tidy: /tmp/portage/llvm-core/clang-21.0.0_pre20250221/work/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp:317: void {anonymous}::MacOSKeychainAPIChecker::checkPreStmt(const clang::CallExpr*, clang::ento::CheckerContext&) const: Assertion `ArgSM' failed.
```
Analysis target was http://github.com/wolfssl/wolfssl at commit 29c3ffb5ee, failing identically on all configurations. Here's an example failing config for the record:
```
./configure --enable-all
CFLAGS="-g -fdebug-types-section -Wunreachable-code-break -Wunreachable-code-return -Wimplicit-fallthrough"
```
Backtrace:
```
1. <eof> parser at end of file
2. While analyzing stack:
#0 Calling ShrinkOutputBuffer at line 11053
#1 Calling SendBuffered at line 40734
#2 Calling SendHelloVerifyRequest
3. /home/wolfbot/tmp/wolfssl_test_workdir.37125/wolfssl/src/internal.c:10921:5 <Spelling=./wolfssl/wolfcrypt/types.h:552:86>: Error evaluating statement
4. /home/wolfbot/tmp/wolfssl_test_workdir.37125/wolfssl/src/internal.c:10921:5 <Spelling=./wolfssl/wolfcrypt/types.h:552:86>: Error evaluating statement
#0 0x00007fc61c36a6f0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm/21/bin/../lib64/libLLVM.so.21.0git58159909+0xf6a6f0)
#1 0x00007fc61c367a04 llvm::sys::RunSignalHandlers() (/usr/lib/llvm/21/bin/../lib64/libLLVM.so.21.0git58159909+0xf67a04)
#2 0x00007fc61c367ba5 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007fc61ae4e600 __restore_rt libc_sigaction.c:0:0
#4 0x00007fc61aea7824 __pthread_kill_implementation /usr/src/debug/sys-libs/glibc-2.41/glibc-2.41/nptl/pthread_kill.c:44:76
#5 0x00007fc61ae4e4ce gsignal /usr/src/debug/sys-libs/glibc-2.41/glibc-2.41/signal/../sysdeps/posix/raise.c:27:6
#6 0x00007fc61ae36350 abort /usr/src/debug/sys-libs/glibc-2.41/glibc-2.41/stdlib/abort.c:81:3
#7 0x00007fc61ae362b9 __assert_perror_fail /usr/src/debug/sys-libs/glibc-2.41/glibc-2.41/assert/assert-perr.c:31:1
#8 0x00007fc6269d352a (anonymous namespace)::MacOSKeychainAPIChecker::checkPreStmt(clang::CallExpr const*, clang::ento::CheckerContext&) const (.cold) MacOSKeychainAPIChecker.cpp:0:0
#9 0x00007fc62929e868 clang::ento::CheckerManager::runCheckersForStmt(bool, clang::ento::ExplodedNodeSet&, clang::ento::ExplodedNodeSet const&, clang::Stmt const*, clang::ento::ExprEngine&, bool) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x329e868)
#10 0x00007fc629306b42 clang::ento::ExprEngine::VisitCallExpr(clang::CallExpr const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x3306b42)
#11 0x00007fc6292dadd9 clang::ento::ExprEngine::Visit(clang::Stmt const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x32dadd9)
#12 0x00007fc6292ddbb2 clang::ento::ExprEngine::ProcessStmt(clang::Stmt const*, clang::ento::ExplodedNode*) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x32ddbb2)
#13 0x00007fc6292e51e2 clang::ento::ExprEngine::processCFGElement(clang::CFGElement, clang::ento::ExplodedNode*, unsigned int, clang::ento::NodeBuilderContext*) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x32e51e2)
#14 0x00007fc6292a84cd clang::ento::CoreEngine::HandlePostStmt(clang::CFGBlock const*, unsigned int, clang::ento::ExplodedNode*) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x32a84cd)
#15 0x00007fc6292a890d clang::ento::CoreEngine::dispatchWorkItem(clang::ento::ExplodedNode*, clang::ProgramPoint, clang::ento::WorkListUnit const&) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x32a890d)
#16 0x00007fc6292a8bb4 clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*, unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x32a8bb4)
#17 0x00007fc62966d6a0 (anonymous namespace)::AnalysisConsumer::HandleCode(clang::Decl*, unsigned int, clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*, llvm::DenseMapInfo<clang::Decl const*, void>>*) AnalysisConsumer.cpp:0:0
#18 0x00007fc62966ed74 (anonymous namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&) AnalysisConsumer.cpp:0:0
#19 0x00007fc628fea320 clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x2fea320)
#20 0x00007fc626c7510c clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0xc7510c)
#21 0x00007fc628fa3ac5 clang::FrontendAction::Execute() (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x2fa3ac5)
#22 0x00007fc628f2d81e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x2f2d81e)
#23 0x00007fc6291bafb8 clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x31bafb8)
#24 0x0000564371b3b343 clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&, clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool, bool, llvm::StringRef)::ActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) ClangTidy.cpp:0:0
#25 0x00007fc6291b2fb1 clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::shared_ptr<clang::CompilerInvocation>, std::shared_ptr<clang::PCHContainerOperations>) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x31b2fb1)
#26 0x00007fc6291b63ce clang::tooling::ToolInvocation::run() (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x31b63ce)
#27 0x00007fc6291b8042 clang::tooling::ClangTool::run(clang::tooling::ToolAction*) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.0git58159909+0x31b8042)
#28 0x0000564371b4b841 clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&, clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool, bool, llvm::StringRef) (/usr/lib/llvm/21/bin/clang-tidy+0xe37841)
#29 0x000056437114d559 clang::tidy::clangTidyMain(int, char const**) (/usr/lib/llvm/21/bin/clang-tidy+0x439559)
#30 0x00007fc61ae38048 __libc_start_call_main /usr/src/debug/sys-libs/glibc-2.41/glibc-2.41/csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#31 0x00007fc61ae3810b call_init /usr/src/debug/sys-libs/glibc-2.41/glibc-2.41/csu/../csu/libc-start.c:128:20
#32 0x00007fc61ae3810b __libc_start_main@GLIBC_2.2.5 /usr/src/debug/sys-libs/glibc-2.41/glibc-2.41/csu/../csu/libc-start.c:347:5
#33 0x0000564371145755 _start /usr/src/debug/sys-libs/glibc-2.41/glibc-2.41/csu/../sysdeps/x86_64/start.S:117:0
make[2]: *** [Makefile:8387: src/libwolfssl_la-internal.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:9413: all-recursive] Error 1
make: *** [Makefile:5509: all] Error 2
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs