Assertion `op == BO_Add' failed
| Bugzilla Link | 15342 |
| Resolution | FIXED |
| Resolved on | Oct 05, 2017 02:35 |
| Version | trunk |
| OS | Linux |
| Attachments | clang_crash_1JmMJW.ii.gz, clang_crash_1JmMJW.ii.info.txt, clang_crash_1JmMJW.ii.stderr.txt |
| Reporter | LLVM Bugzilla Contributor |
| CC | @devincoughlin,@belkadan,@Xazax-hun,@xiangzhai |
Extended Description
When running on the attached preprocessed source, clang static analyzer crashed as follows:
clang++: /home/sliedes/projects/llvm/llvm.src/tools/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:270: clang::ento::SVal clang::ento::SValBuilder::evalBinOp(clang::ento::ProgramStateRef, clang::BinaryOperator::Opcode, clang::ento::SVal, clang::ento::SVal, clang::QualType): Assertion `op == BO_Add' failed. 0 clang++ 0x00000000013165f2 llvm::sys::PrintStackTrace(_IO_FILE*) + 34 1 clang++ 0x0000000001316311 2 libpthread.so.0 0x00002aeaeccf2030 3 libc.so.6 0x00002aeaed6d1475 gsignal + 53 4 libc.so.6 0x00002aeaed6d46f0 abort + 384 5 libc.so.6 0x00002aeaed6ca621 __assert_fail + 241 6 clang++ 0x0000000001dc7f68 7 clang++ 0x0000000001d74afc clang::ento::ExprEngine::VisitBinaryOperator(clang::BinaryOperator const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) + 3900 8 clang++ 0x0000000001d6aa44 clang::ento::ExprEngine::Visit(clang::Stmt const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) + 7188 9 clang++ 0x0000000001d6c04d clang::ento::ExprEngine::ProcessStmt(clang::CFGStmt, clang::ento::ExplodedNode*) + 749 10 clang++ 0x0000000001d6c31e clang::ento::ExprEngine::processCFGElement(clang::CFGElement, clang::ento::ExplodedNode*, unsigned int, clang::ento::NodeBuilderContext*) + 206 11 clang++ 0x0000000001d516f0 clang::ento::CoreEngine::HandlePostStmt(clang::CFGBlock const*, unsigned int, clang::ento::ExplodedNode*) + 128 12 clang++ 0x0000000001d52b97 clang::ento::CoreEngine::dispatchWorkItem(clang::ento::ExplodedNode*, clang::ProgramPoint, clang::ento::WorkListUnit const&) + 311 13 clang++ 0x0000000001d52e7a clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*, unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>) + 266 14 clang++ 0x0000000001be1500 15 clang++ 0x0000000001be2547 16 clang++ 0x0000000001beece5 17 clang++ 0x00000000015cbaea clang::ParseAST(clang::Sema&, bool, bool) + 538 18 clang++ 0x00000000015078c9 clang::FrontendAction::Execute() + 265 19 clang++ 0x00000000014ec13a clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 346 20 clang++ 0x0000000001319442 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1730 21 clang++ 0x0000000000677438 cc1_main(char const**, char const**, char const*, void*) + 1144 22 clang++ 0x00000000006761a0 main + 7728 23 libc.so.6 0x00002aeaed6bdead __libc_start_main + 253 24 clang++ 0x0000000000672f29 Stack dump: 0. Program arguments: /home/sliedes/scratch/llvm-trunk-rel/bin/clang++ -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -main-file-name coreconnection.cpp -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-eagerly-assume -analyzer-checker=core -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-output plist -w -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer -resource-dir /home/sliedes/scratch/llvm-trunk-rel/bin/../lib/clang/3.3 -D NDEBUG -D QT_NO_DEBUG -D HAVE_EXECINFO -D QT_CORE_LIB -D HAVE_SSL -D HAVE_DBUS -D HAVE_DBUSMENU -D HAVE_WEBKIT -D _BSD_SOURCE -D HAVE_KDE -D _XOPEN_SOURCE=500 -D _BSD_SOURCE -D QT_NO_STL -D QT_NO_CAST_TO_ASCII -D _REENTRANT -D KDE_DEPRECATED_WARNINGS -D KDE4_CMAKE_TOPLEVEL_DIR_LENGTH=25 -D HAVE_INDICATEQT -D HAVE_QCA2 -D HAVE_SYSLOG -D HAVE_UMASK -D QT_DBUS_LIB -D QT_NETWORK_LIB -D QT_CORE_LIB -D QT_NO_EXCEPTIONS -D _GNU_SOURCE -D _LARGEFILE64_SOURCE -D XDG_APPS_INSTALL_DIR=/usr/share/applications/kde4 -I /home/sliedes/scratch/rec/quassel-0.8.0/src/core -I /home/sliedes/scratch/rec/quassel-0.8.0/src/common -I /usr/include/qt4 -I /usr/include/qt4/QtCore -I /usr/include/qt4/phonon -I /usr/include/qt4/QtXmlPatterns -I /usr/include/qt4/QtXml -I /usr/include/qt4/QtWebKit -I /usr/include/qt4/QtUiTools -I /usr/include/qt4/QtTest -I /usr/include/qt4/QtSvg -I /usr/include/qt4/QtSql -I /usr/include/qt4/QtScriptTools -I /usr/include/qt4/QtScript -I /usr/include/qt4/QtNetwork -I /usr/include/qt4/QtHelp -I /usr/include/qt4/QtDesigner -I /usr/include/qt4/QtDeclarative -I /usr/include/qt4/QtDBus -I /usr/include/qt4/Qt3Support -I /usr/include/qt4/QtGui -I /usr/include/qt4/Qt -I /usr/share/qt4/mkspecs/default -I /usr/include/dbusmenu-qt -I /usr/include/KDE -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/x86_64-linux-gnu -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/backward -internal-isystem /usr/local/include -internal-isystem /home/sliedes/scratch/llvm-trunk-rel/bin/../lib/clang/3.3/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-long-long -fdeprecated-macro -fdebug-compilation-dir /home/sliedes/scratch/rec/quassel-0.8.0/obj--kde4/src/client -ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -backend-option -vectorize-loops -analyzer-output=html -o /tmp/scan-build-2013-02-24-2 -x c++ /home/sliedes/scratch/rec/quassel-0.8.0/src/client/coreconnection.cpp
parser at end of file - /usr/include/qt4/QtCore/qhash.h:225:72: Error evaluating statement
- /usr/include/qt4/QtCore/qhash.h:225:72: Error evaluating statement
I can no longer reproduce this with the attached preprocessed file and Jordan also said that this should be fixed, so I close this issue now.
I filed a new bug llvm/llvm-bugzilla-archive#34305 , which I'm sure to be triggered by new change in https://reviews.llvm.org/rL290143. Not sure if it is the same as any of the problems mentioned here.
Hi Devin,
Thanks for your reply!
Leslie, I suspect yours is a newer issue than Sami's (which is from 2013). Would you be willing to open a new bug? Can you attach a preprocessed file that triggers the assertion failure?
New bug llvm/llvm-bugzilla-archive#32454
Regards, Leslie Zhai
Leslie, I suspect yours is a newer issue than Sami's (which is from 2013). Would you be willing to open a new bug? Can you attach a preprocessed file that triggers the assertion failure?
Hi Sami,
The same story to me:
clang++: /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:955: virtual clang::ento::SVal (anonymous namespace)::SimpleSValBuilder::evalBinOpLN(clang::ento::ProgramStateRef, BinaryOperator::Opcode, clang::ento::Loc, clang::ento::NonLoc, clang::QualType): Assertion `op == BO_Add || op == BO_Sub' failed. #0 0x00007f0263e57b29 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /data/project/LLVM/llvm/lib/Support/Unix/Signals.inc:398:11 #1 0x00007f0263e57cd9 PrintStackTraceSignalHandler(void*) /data/project/LLVM/llvm/lib/Support/Unix/Signals.inc:462:1 #2 0x00007f0263e55c63 llvm::sys::RunSignalHandlers() /data/project/LLVM/llvm/lib/Support/Signals.cpp:0:5 #3 0x00007f0263e580a2 SignalHandler(int) /data/project/LLVM/llvm/lib/Support/Unix/Signals.inc:252:1 #4 0x00007f0269735e60 __restore_rt (/lib/libpthread.so.0+0x10e60) #5 0x00007f026231b5cf __GI_raise /builddir/build/BUILD/glibc-2.24/signal/../sysdeps/unix/sysv/linux/raise.c:58:0 #6 0x00007f026231d1ca __GI_abort /builddir/build/BUILD/glibc-2.24/stdlib/abort.c:91:0 #7 0x00007f0262313ae7 __assert_fail_base /builddir/build/BUILD/glibc-2.24/assert/assert.c:92:0 #8 0x00007f0262313b92 (/lib/libc.so.6+0x2cb92) #9 0x0000000003530906 (anonymous namespace)::SimpleSValBuilder::evalBinOpLN(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::BinaryOperatorKind, clang::ento::Loc, clang::ento::NonLoc, clang::QualType) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:956:19 #10 0x00000000035262f6 clang::ento::SValBuilder::evalBinOp(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::BinaryOperatorKind, clang::ento::SVal, clang::ento::SVal, clang::QualType) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:399:12 #11 0x0000000002fb838b (anonymous namespace)::MallocChecker::SValBinMulOp(clang::ento::CheckerContext&, clang::Expr const*, clang::Expr const*, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:795:32 #12 0x0000000002fb4794 (anonymous namespace)::MallocChecker::checkPostStmt(clang::CallExpr const*, clang::ento::CheckerContext&) const /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:920:28 #13 0x0000000002fb2335 void clang::ento::check::PostStmtclang::CallExpr::_checkStmt<(anonymous namespace)::MallocChecker>(void*, clang::Stmt const*, clang::ento::CheckerContext&) /data/project/LLVM/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h:105:3 #14 0x0000000003448532 clang::ento::CheckerFn<void (clang::Stmt const*, clang::ento::CheckerContext&)>::operator()(clang::Stmt const*, clang::ento::CheckerContext&) const /data/project/LLVM/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h:59:5 #15 0x0000000003442a0d (anonymous namespace)::CheckStmtContext::runChecker(clang::ento::CheckerFn<void (clang::Stmt const*, clang::ento::CheckerContext&)>, clang::ento::NodeBuilder&, clang::ento::ExplodedNode*) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp:161:5 #16 0x000000000343e7cd void expandGraphWithCheckers<(anonymous namespace)::CheckStmtContext>((anonymous namespace)::CheckStmtContext, clang::ento::ExplodedNodeSet&, clang::ento::ExplodedNodeSet const&) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp:123:16 #17 0x000000000343e2db clang::ento::CheckerManager::runCheckersForStmt(bool, clang::ento::ExplodedNodeSet&, clang::ento::ExplodedNodeSet const&, clang::Stmt const*, clang::ento::ExprEngine&, bool) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp:175:1 #18 0x0000000003487298 clang::ento::CheckerManager::runCheckersForPostStmt(clang::ento::ExplodedNodeSet&, clang::ento::ExplodedNodeSet const&, clang::Stmt const*, clang::ento::ExprEngine&, bool) /data/project/LLVM/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h:206:3 #19 0x00000000034b1f74 clang::ento::ExprEngine::VisitCallExpr(clang::CallExpr const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:494:23 #20 0x00000000034779c4 clang::ento::ExprEngine::Visit(clang::Stmt const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:1148:7 #21 0x000000000347350c clang::ento::ExprEngine::ProcessStmt(clang::CFGStmt, clang::ento::ExplodedNode*) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:464:5 #22 0x0000000003473076 clang::ento::ExprEngine::processCFGElement(clang::CFGElement, clang::ento::ExplodedNode*, unsigned int, clang::ento::NodeBuilderContext*) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:313:7 #23 0x000000000345cfe6 clang::ento::CoreEngine::HandlePostStmt(clang::CFGBlock const*, unsigned int, clang::ento::ExplodedNode*) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:532:1 #24 0x000000000345c6cc clang::ento::CoreEngine::dispatchWorkItem(clang::ento::ExplodedNode*, clang::ProgramPoint, clang::ento::WorkListUnit const&) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:279:7 #25 0x000000000345c18c clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*, unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:216:3 #26 0x0000000001dd3c18 clang::ento::ExprEngine::ExecuteWorkList(clang::LocationContext const*, unsigned int) /data/project/LLVM/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:109:19 #27 0x0000000001d7cb43 (anonymous namespace)::AnalysisConsumer::ActionExprEngine(clang::Decl*, bool, clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*, llvm::DenseMapInfo<clang::Decl const*> >) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:719:7 #28 0x0000000001d7c881 (anonymous namespace)::AnalysisConsumer::RunPathSensitiveChecks(clang::Decl, clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*, llvm::DenseMapInfo<clang::Decl const*> >) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:741:5 #29 0x0000000001d7c4cb (anonymous namespace)::AnalysisConsumer::HandleCode(clang::Decl, unsigned int, clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*, llvm::DenseMapInfo<clang::Decl const*> >) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:687:5 #30 0x0000000001d6f6ad (anonymous namespace)::AnalysisConsumer::HandleDeclsCallGraph(unsigned int) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:498:5 #31 0x0000000001d6d68b (anonymous namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&) /data/project/LLVM/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:550:7 #32 0x0000000001e05b4a clang::ParseAST(clang::Sema&, bool, bool) /data/project/LLVM/llvm/tools/clang/lib/Parse/ParseAST.cpp:159:13 #33 0x00000000011a96ac clang::ASTFrontendAction::ExecuteAction() /data/project/LLVM/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:613:1 #34 0x00000000011a903f clang::FrontendAction::Execute() /data/project/LLVM/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:516:7 #35 0x0000000001129d07 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /data/project/LLVM/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:960:7 #36 0x000000000132df58 clang::ExecuteCompilerInvocation(clang::CompilerInstance) /data/project/LLVM/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:249:25 #37 0x000000000086c7f5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /data/project/LLVM/llvm/tools/clang/tools/driver/cc1_main.cpp:221:13 #38 0x000000000085ed69 ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) /data/project/LLVM/llvm/tools/clang/tools/driver/driver.cpp:299:5 #39 0x000000000085d340 main /data/project/LLVM/llvm/tools/clang/tools/driver/driver.cpp:380:12 #40 0x00007f02623072f1 __libc_start_main /builddir/build/BUILD/glibc-2.24/csu/../csu/libc-start.c:323:0 #41 0x000000000085c19a _start (/data/project/LLVM/llvm/debug-build/bin/clang+++0x85c19a) Stack dump: 0. Program arguments: /data/project/LLVM/llvm/debug-build/bin/clang++ -cc1 -triple x86_64-isoft-linux -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name k3bdevice.cpp -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-eagerly-assume -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -resource-dir /usr/lib/clang/5.0.0 -isystem /usr/lib/qt5/include -isystem /usr/lib/qt5/include/QtCore -isystem /usr/lib/qt5/./mkspecs/linux-g++ -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KI18n -isystem /usr/include/KF5/KIOCore -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KService -isystem /usr/include/KF5/Solid -D HAVE_QT5WEBKITWIDGETS -D KCOREADDONS_LIB -D QT_CORE_LIB -D QT_NO_DEBUG -D QT_NO_URL_CAST_FROM_STRING -D _GNU_SOURCE -D _LARGEFILE64_SOURCE -D k3bdevice_EXPORTS -I /data/project/kde/k3b/scan-build/libk3bdevice -I /data/project/kde/k3b/libk3bdevice -I /data/project/kde/k3b/scan-build -I /data/project/kde/k3b/libk3bdevice/. -internal-isystem /usr/bin/../lib/gcc/x86_64-isoft-linux/6.3.0/../../../../include/c++/6.3.0 -internal-isystem /usr/bin/../lib/gcc/x86_64-isoft-linux/6.3.0/../../../../include/c++/6.3.0/x86_64-isoft-linux -internal-isystem /usr/bin/../lib/gcc/x86_64-isoft-linux/6.3.0/../../../../include/c++/6.3.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib/clang/5.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-long-long -std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir /data/project/kde/k3b/scan-build/libk3bdevice -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -fvisibility-inlines-hidden -fno-operator-names -fobjc-runtime=gcc -fdiagnostics-show-option -analyzer-output=html -o /tmp/scan-build-2017-03-27-114444-27046-1 -x c++ /data/project/kde/k3b/libk3bdevice/k3bdevice.cpp
-
<eof> parser at end of file -
While analyzing stack: #​0 K3b::Device::DiskInfo diskInfo() const -
/data/project/kde/k3b/libk3bdevice/k3bdevice.cpp:2166:43: Error evaluating statement -
/data/project/kde/k3b/libk3bdevice/k3bdevice.cpp:2166:43: Error evaluating statement
./clang-analyzer-k3b.sh: line 1: 3766 Aborted (coredump)/data/project/LLVM/llvm/debug-build/bin/clang++ -cc1 -triple x86_64-isoft-linux -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name k3bdevice.cpp -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-eagerly-assume -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -resource-dir /usr/lib/clang/5.0.0 -isystem /usr/lib/qt5/include -isystem /usr/lib/qt5/include/QtCore -isystem /usr/lib/qt5/./mkspecs/linux-g++ -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5 -isystem /usr/include/KF5/KI18n -isystem /usr/include/KF5/KIOCore -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5/KService -isystem /usr/include/KF5/Solid -D HAVE_QT5WEBKITWIDGETS -D KCOREADDONS_LIB -D QT_CORE_LIB -D QT_NO_DEBUG -D QT_NO_URL_CAST_FROM_STRING -D _GNU_SOURCE -D _LARGEFILE64_SOURCE -D k3bdevice_EXPORTS -I /data/project/kde/k3b/scan-build/libk3bdevice -I /data/project/kde/k3b/libk3bdevice -I /data/project/kde/k3b/scan-build -I /data/project/kde/k3b/libk3bdevice/. -internal-isystem /usr/bin/../lib/gcc/x86_64-isoft-linux/6.3.0/../../../../include/c++/6.3.0 -internal-isystem /usr/bin/../lib/gcc/x86_64-isoft-linux/6.3.0/../../../../include/c++/6.3.0/x86_64-isoft-linux -internal-isystem /usr/bin/../lib/gcc/x86_64-isoft-linux/6.3.0/../../../../include/c++/6.3.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib/clang/5.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-long-long -std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir /data/project/kde/k3b/scan-build/libk3bdevice -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -fvisibility-inlines-hidden -fno-operator-names -fobjc-runtime=gcc -fdiagnostics-show-option -analyzer-output=html -o /tmp/scan-build-2017-03-27-114444-27046-1 -x c++ /data/project/kde/k3b/libk3bdevice/k3bdevice.cpp
clang --version iSoft clang version 5.0.0 (trunk 298903) (based on LLVM 5.0.0svn) Target: x86_64-isoft-linux Thread model: posix InstalledDir: /bin
Regards, Leslie Zhai
I think that r176068-9 should fix this.
cloned to rdar://problem/13281951
This happens running the analyzer over LLVM as well (http://lbalbalba.x90x.net/clang-analyzer/llvm-clang/r175966/). I haven't fully isolated the problem yet, but somewhere the analyzer is doing an extra dereference of a struct and then trying to compare the resulting rvalue with an lvalue representing the address of another struct.
assigned to @tkremenek