<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Loop widening test crashes with control dependency analysis"
   href="https://bugs.llvm.org/show_bug.cgi?id=43102">43102</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Loop widening test crashes with control dependency analysis
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dcoughlin@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>chackz0x12@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dcoughlin@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22419" name="attach_22419" title="Reproducible">attachment 22419</a> <a href="attachment.cgi?id=22419&action=edit" title="Reproducible">[details]</a></span>
Reproducible

Hello LLVM community,

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

root@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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>