[llvm-bugs] [Bug 43102] New: Loop widening test crashes with control dependency analysis

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 23 09:46:04 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=43102

            Bug ID: 43102
           Summary: Loop widening test crashes with control dependency
                    analysis
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: dcoughlin at apple.com
          Reporter: chackz0x12 at gmail.com
                CC: dcoughlin at apple.com, llvm-bugs at lists.llvm.org

Created attachment 22419
  --> https://bugs.llvm.org/attachment.cgi?id=22419&action=edit
Reproducible

Hello LLVM community,

The attached repro crashes my TOT clang, r369746, on my ubuntu machine with the
following stack trace:

root at clangbox-VirtualBox:~/dev/upstream_llvm_git/temp# ./clang -cc1
-internal-isystem -nostdsysteminc ./test.cpp -analyze -analyzer-checker=core
-analyzer-config widen-loops=true -analyzer-max-loop 2 -analyzer-output=text
-verify
clang:
/home/clangbox/dev/upstream_llvm_git/llvm-project/llvm/include/llvm/Support/Casting.h:105:
static bool llvm::isa_impl_cl<clang::CXXForRangeStmt, const clang::Stmt
*>::doit(const From *) [To = clang::CXXForRangeStmt, From = const clang::Stmt
*]: Assertion `Val && "isa<> used on a null pointer"' failed.
Stack dump:
0.      Program arguments: ./clang -cc1 -internal-isystem -nostdsysteminc
./test.cpp -analyze -analyzer-checker=core -analyzer-config widen-loops=true
-analyzer-max-loop 2 -analyzer-output=text -verify 
1.      <eof> parser at end of file
 #0 0x0000000007c3bf09 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/clangbox/dev/upstream_llvm_git/llvm-project/llvm/lib/Support/Unix/Signals.inc:532:11
 #1 0x0000000007c3c0b9 PrintStackTraceSignalHandler(void*)
/home/clangbox/dev/upstream_llvm_git/llvm-project/llvm/lib/Support/Unix/Signals.inc:593:1
 #2 0x0000000007c3a8f6 llvm::sys::RunSignalHandlers()
/home/clangbox/dev/upstream_llvm_git/llvm-project/llvm/lib/Support/Signals.cpp:67:5
 #3 0x0000000007c3c82b SignalHandler(int)
/home/clangbox/dev/upstream_llvm_git/llvm-project/llvm/lib/Support/Unix/Signals.inc:384:1
 #4 0x00007f8aeaf02890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #5 0x00007f8ae99abe97 gsignal
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #6 0x00007f8ae99ad801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #7 0x00007f8ae999d39a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #8 0x00007f8ae999d412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #9 0x00000000080d55cc llvm::isa_impl_cl<clang::CXXForRangeStmt, clang::Stmt
const*>::doit(clang::Stmt const*)
/home/clangbox/dev/upstream_llvm_git/llvm-project/llvm/include/llvm/Support/Casting.h:106:38
#10 0x00000000080d5558 llvm::isa_impl_wrap<clang::CXXForRangeStmt, clang::Stmt
const*, clang::Stmt const*>::doit(clang::Stmt const* const&)
/home/clangbox/dev/upstream_llvm_git/llvm-project/llvm/include/llvm/Support/Casting.h:132:5
#11 0x000000000a95f662 llvm::isa_impl_wrap<clang::CXXForRangeStmt,
clang::CFGTerminator const, clang::Stmt const*>::doit(clang::CFGTerminator
const&)
/home/clangbox/dev/upstream_llvm_git/llvm-project/llvm/include/llvm/Support/Casting.h:122:5
#12 0x000000000a95f1b5 bool llvm::isa<clang::CXXForRangeStmt,
clang::CFGTerminator>(clang::CFGTerminator const&)
/home/clangbox/dev/upstream_llvm_git/llvm-project/llvm/include/llvm/Support/Casting.h:142:3
#13 0x000000000a954991 (anonymous
namespace)::TrackControlDependencyCondBRVisitor::VisitNode(clang::ento::ExplodedNode
const*, clang::ento::BugReporterContext&, clang::ento::BugReport&)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1805:9
#14 0x000000000a917b29 generateVisitorsDiagnostics(clang::ento::BugReport*,
clang::ento::ExplodedNode const*, clang::ento::BugReporterContext&)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/StaticAnalyzer/Core/BugReporter.cpp:2634:19
#15 0x000000000a914c0c (anonymous
namespace)::PathDiagnosticBuilder::findValidReport(llvm::ArrayRef<clang::ento::BugReport*>&,
clang::ento::PathSensitiveBugReporter&)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/StaticAnalyzer/Core/BugReporter.cpp:2676:9
#16 0x000000000a91480a
clang::ento::PathSensitiveBugReporter::generatePathDiagnostics(llvm::ArrayRef<clang::ento::PathDiagnosticConsumer*>,
llvm::ArrayRef<clang::ento::BugReport*>&)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/StaticAnalyzer/Core/BugReporter.cpp:0:7
#17 0x000000000a916292
clang::ento::BugReporter::generateDiagnosticForConsumerMap(clang::ento::BugReport*,
llvm::ArrayRef<clang::ento::PathDiagnosticConsumer*>,
llvm::ArrayRef<clang::ento::BugReport*>)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/StaticAnalyzer/Core/BugReporter.cpp:0:5
#18 0x000000000a914188
clang::ento::BugReporter::FlushReport(clang::ento::BugReportEquivClass&)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/StaticAnalyzer/Core/BugReporter.cpp:2893:7
#19 0x000000000a914073 clang::ento::BugReporter::FlushReports()
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/StaticAnalyzer/Core/BugReporter.cpp:0:5
#20 0x000000000a3313ad (anonymous
namespace)::AnalysisConsumer::RunPathSensitiveChecks(clang::Decl*,
clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*,
llvm::DenseMapInfo<clang::Decl const*> >*)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:817:7
#21 0x000000000a330d34 (anonymous
namespace)::AnalysisConsumer::HandleCode(clang::Decl*, unsigned int,
clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*,
llvm::DenseMapInfo<clang::Decl const*> >*)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:775:15
#22 0x000000000a2cede1 (anonymous
namespace)::AnalysisConsumer::HandleDeclsCallGraph(unsigned int)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:556:5
#23 0x000000000a2cd9b2 (anonymous
namespace)::AnalysisConsumer::runAnalysisOnTranslationUnit(clang::ASTContext&)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:610:3
#24 0x000000000a2ccca2 (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:0:5
#25 0x000000000ab4b072 clang::ParseAST(clang::Sema&, bool, bool)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/Parse/ParseAST.cpp:178:12
#26 0x00000000088ff01c clang::ASTFrontendAction::ExecuteAction()
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1044:1
#27 0x00000000088fe9e1 clang::FrontendAction::Execute()
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/Frontend/FrontendAction.cpp:939:7
#28 0x000000000882da79
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:0:33
#29 0x0000000008a8fe2c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:289:8
#30 0x0000000004e55993 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/tools/driver/cc1_main.cpp:250:15
#31 0x0000000004e494b7 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/tools/driver/driver.cpp:309:5
#32 0x0000000004e4884c main
/home/clangbox/dev/upstream_llvm_git/llvm-project/clang/tools/driver/driver.cpp:381:5
#33 0x00007f8ae998eb97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#34 0x0000000004e4802a _start (./clang+0x4e4802a)
Aborted (core dumped)


thanks for your time
Tom W

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190823/0713532a/attachment.html>


More information about the llvm-bugs mailing list