Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang analyzer 15.0.1 fails with CTU and Z3 solver 4.11.2 #58119

Open
dilyanpalauzov opened this issue Oct 3, 2022 · 5 comments
Open

clang analyzer 15.0.1 fails with CTU and Z3 solver 4.11.2 #58119

dilyanpalauzov opened this issue Oct 3, 2022 · 5 comments
Labels
clang:static analyzer crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@dilyanpalauzov
Copy link

dilyanpalauzov commented Oct 3, 2022

As opposed to #58118 the current report does print its coredump on stdout/stderr and does not create core file.

With CodeChecker 6.20.0, self-compiled clang 15.0.1, enabled Z3 solver 4.11.2 on openldap branch OPENLDAP_REL_ENG_2_6, calling

> CodeChecker analyze ./compile_commands.json --ctu --z3=on --output ./reports

prints

[ERROR 2022-10-03 10:18] - Analyzing utils.c with clangsa CTU failed!                                                                   
[ERROR 2022-10-03 10:18] -                                                                                                              
                                                                                                                                        
[ERROR 2022-10-03 10:18] -                                                                                                              
CTU loaded AST file: ast/git/openldap/libraries/libldap/utf-8.c.ast
CTU loaded AST file: ast/git/openldap/libraries/liblber/memory.c.ast 
CTU loaded AST file: ast/git/openldap/libraries/liblber/bprint.c.ast 
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /usr/local/bin/clang-15 --analyze -Qunused-arguments -Xclang -analyzer-opt-analyze-headers -Xclang -analyzer-
output=plist-multi-file -o /git/openldap/reports/utils.c_clangsa_93a8694d87e9cdbbace8f017458e4d2b.plist -Xclang -analyzer-config -Xclang
 expand-macros=true -Xclang -analyzer-checker=alpha.security.cert.env.InvalidPtr,alpha.security.cert.pos.34c,core.CallAndMessage,core.Di
videZero,core.NonNullParamChecker,core.NullDereference,core.StackAddressEscape,core.UndefinedBinaryOperatorResult,core.VLASize,core.unin
itialized.ArraySubscript,core.uninitialized.Assign,core.uninitialized.Branch,core.uninitialized.CapturedBlockVariable,core.uninitialized
.UndefReturn,cplusplus.InnerPointer,cplusplus.Move,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,cplusplus.PlacementNew,cpluspls.PureVirtualCall,cplusplus.StringChecker,deadcode.DeadStores,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,optin.cplusplus
.UninitializedObject,optin.cplusplus.VirtualCall,optin.portability.UnixAPI,security.FloatLoopCounter,security.insecureAPI.UncheckedRetur
n,security.insecureAPI.getpw,security.insecureAPI.gets,security.insecureAPI.mkstemp,security.insecureAPI.mktemp,security.insecureAPI.rand,security.insecureAPI.vfork,unix.API,unix.Malloc,unix.MallocSizeof,unix.MismatchedDeallocator,unix.Vfork,unix.cstring.BadSizeArg,unix.cstring.NullArg,valist.CopyToSelf,valist.Uninitialized,valist.Unterminated -Xclang -analyzer-config -Xclang aggressive-binary-operation-simplification=true -Xclang -analyzer-constraints=z3 -Xclang -analyzer-config -Xclang experimental-enable-naive-ctu-analysis=true -Xclang
 -analyzer-config -Xclang ctu-dir=/git/openldap/reports/ctu-dir/x86_64 -Xclang -analyzer-config -Xclang display-ctu-progress=true -x c -
std=gnu17 -I /git/openldap/include -I /git/openldap/include -mtune=generic -march=x86-64 -O2 -isystem /usr/local/include -isystem /usr/include /git/openldap/libraries/liblutil/utils.c
1.      <eof> parser at end of file
2.      While analyzing stack: 
        #0 Calling lutil_localtime 
3.      /git/openldap/libraries/liblutil/utils.c:148:40: Error evaluating statement
4.      /git/openldap/libraries/liblutil/utils.c:148:40: Error evaluating statement
 #0 0x00007fc5524ec7e4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x00007fc5524ea524 llvm::sys::CleanupOnSignal(unsigned long) (/usr/local/bin/../lib/libLLVMSupport.so.15+0x1e3524)
 #2 0x00007fc5523d04a8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007fc551e07290 __restore_rt libc_sigaction.c:0:0
 #4 0x00007fc54d97319b clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cf19b)
 #5 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
 #6 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
 #7 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
 #8 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
 #9 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#10 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#11 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#12 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#13 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#14 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#15 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#16 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#17 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#18 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#19 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#20 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#21 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#22 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#23 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#24 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#25 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#26 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#27 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#28 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#29 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#30 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#31 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#32 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#33 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#34 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#35 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#36 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#37 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#38 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#39 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, to::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)                               
#40 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#41 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#42 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#43 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#44 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#45 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#46 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#47 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#48 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#49 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#50 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#51 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#52 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#53 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#54 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#55 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#56 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#57 0x00007fc54d973ba6 clang::ento::SMTConstraintManager::getSymVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*) const (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x1cfba6)
#58 0x00007fc54d92061d clang::ento::ProgramState::getSVal(clang::ento::Loc, clang::QualType) const (/usr/local/bin/../lib/../lib/../lib/
libclangStaticAnalyzerCore.so.15+0x17c61d)
#59 0x00007fc54d8ac780 clang::ento::ExprEngine::evalLoad(clang::ento::ExplodedNodeSet&, clang::Expr const*, clang::Expr const*, clang::ento::ExplodedNode*, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal, clang::ProgramPointTag const*, clang::QualType) (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x108780)
#60 0x00007fc54d8c02c7 clang::ento::ExprEngine::VisitCast(clang::CastExpr const*, clang::Expr const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x11c2c7)
#61 0x00007fc54d8afaab clang::ento::ExprEngine::Visit(clang::Stmt const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x10baab)
#62 0x00007fc54d8b1986 clang::ento::ExprEngine::ProcessStmt(clang::Stmt const*, clang::ento::ExplodedNode*) (/usr/local/bin/../lib/../li
b/../lib/libclangStaticAnalyzerCore.so.15+0x10d986)
#63 0x00007fc54d8b1b92 clang::ento::ExprEngine::processCFGElement(clang::CFGElement, clang::ento::ExplodedNode*, unsigned int, clang::ento::NodeBuilderContext*) (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0x10db92)
#64 0x00007fc54d86f16f clang::ento::CoreEngine::dispatchWorkItem(clang::ento::ExplodedNode*, clang::ProgramPoint, clang::ento::WorkListUnit const&) (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0xcb16f)
#65 0x00007fc54d86f33e clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*, unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>) (/usr/local/bin/../lib/../lib/../lib/libclangStaticAnalyzerCore.so.15+0xcb33e)
#66 0x00007fc55118ea07 (anonymous namespace)::AnalysisConsumer::HandleCode(clang::Decl*, unsigned int, clang::ento::ExprEngine::Inlining
Modes, llvm::DenseSet<clang::Decl const*, llvm::DenseMapInfo<clang::Decl const*, void>>*) AnalysisConsumer.cpp:0:0
#67 0x00007fc5511a2025 (anonymous namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&) AnalysisConsumer.cpp:0:0
#68 0x00007fc54fe221e9 clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/bin/../lib/../lib/libclangParse.so.15+0x341e9)
#69 0x00007fc554560a49 clang::FrontendAction::Execute() (/usr/local/bin/../lib/libclangFrontend.so.15+0x103a49)
#70 0x00007fc5544e0bab clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/local/bin/../lib/libclangFrontend.so.15+0x83bab)
#71 0x00007fc55676ddb3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/local/bin/../lib/libclangFrontendTool.so.15+0x4db3)
#72 0x000000000041540d cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/local/bin/clang-15+0x41540d)
#73 0x000000000040efac ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#74 0x00007fc55424ab25 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<ll
vm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#75 0x00007fc5523d05a3 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/local/bin/../lib/libLLVMSupport.so.15+0xc95a3)
#76 0x00007fc55424aeb9 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#77 0x00007fc554214776 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/local/bin/../lib/libclangDriver.so.15+0x7e776)
#78 0x00007fc55421516d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/local/bin/../lib/libclangDriver.so.15+0x7f16d)
#79 0x00007fc554226f1c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/local/bin/../lib/libclangDriver.so.15+0x90f1c)
#80 0x000000000041334d clang_main(int, char**) (/usr/local/bin/clang-15+0x41334d)
#81 0x00007fc551df31a7 __libc_start_call_main /src/glibc-2.34/csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#82 0x00007fc551df3258 call_init /src/glibc-2.34/csu/../csu/libc-start.c:128:20
#83 0x00007fc551df3258 __libc_start_main@GLIBC_2.2.5 /src/glibc-2.34/csu/../csu/libc-start.c:379:5
#84 0x000000000040e4d1 _start /src/glibc-2.34/csu/../sysdeps/x86_64/start.S:118:0
clang-15: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 15.0.1
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-15: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-15: note: diagnostic msg: /tmp/utils-9f14c5.c
clang-15: note: diagnostic msg: /tmp/utils-9f14c5.sh
clang-15: note: diagnostic msg: 

********************

[utils-9f14c5.c.gz](https://github.com/llvm/llvm-project/files/9696684/utils-9f14c5.c.gz)
[utils-9f14c5.sh.txt](https://github.com/llvm/llvm-project/files/9696687/utils-9f14c5.sh.txt)
@EugeneZelenko EugeneZelenko added clang:static analyzer crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Oct 3, 2022
@llvmbot
Copy link
Member

llvmbot commented Oct 3, 2022

@llvm/issue-subscribers-clang-static-analyzer

@steakhal
Copy link
Contributor

The z3 constraint solver is not supported.
z3 refutation is supported though.

Ask CodeChecker about the --z3=on flag. I think they should simply drop it.

Can I close this?

@whisperity
Copy link
Member

Is it normal to have so many recursive stack frames, and also two entries of an overload set (getSymExpr(IntrusiveRefCntPtr<const ProgramState>, ento::SymExpr const*) and getSymExpr(IntrusiveRefCntPtr<const ProgramState>, ::to::SymExpr const*)) at the same ELF address ...+0x1cfba6?

@dilyanpalauzov
Copy link
Author

dilyanpalauzov commented Oct 13, 2022

I filled Ericsson/codechecker#3757 about removing Z3 constraint solver from code checker.

The problem report is, that clang crashes. It is not codechecker’s fault, that clang crashes. The solution would be to fix clang, so that it does not crash.

@balazs-benics-sonarsource

Is it normal to have so many recursive stack frames, and also two entries of an overload set (getSymExpr(IntrusiveRefCntPtr<const ProgramState>, ento::SymExpr const*) and getSymExpr(IntrusiveRefCntPtr<const ProgramState>, ::to::SymExpr const*)) at the same ELF address ...+0x1cfba6?

That's indeed weird. I would not expect so many frames for that part.

The problem report is, that clang crashes. It is not codechecker’s fault, that clang crashes. The solution would be to fix clang, so that it does not crash.

That's true. I think it would be valuable to have a reduced test case demonstraing the crash and add it to the test suite somewhere under clang/test/Analysis/z3 while marking it as // XFAIL: *.

My problem is that I don't know anyone who would be interested in fixing this issue or even just reducing the case.
I'd happily review patches of any of the two options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:static analyzer crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

6 participants