[llvm-bugs] [Bug 39976] New: Assertion failure in clang::ento::PathDiagnosticLocation::create

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 12 06:26:31 PST 2018


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

            Bug ID: 39976
           Summary: Assertion failure in
                    clang::ento::PathDiagnosticLocation::create
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: dcoughlin at apple.com
          Reporter: hokein at google.com
                CC: dcoughlin at apple.com, llvm-bugs at lists.llvm.org

$ cat test-clang__ento__PathDiagnosticLocation.cc
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
class a;
class b {
public:
  a *c() { return d || 0 ? 0 : g; }
  int d;
  a *g;
};
# 2 "" 2
# 3 "" 2
# 2 "" 2
# 2 "" 2
# 2 "" 2
# 6 "" 2
# 2 "" 2
# 0 "" 2
# 2 "" 2
# 9 "" 2
class a {
public:
  ~a();
  void e(bool);
};
# 2 "" 2
# 2 "" 2
# 2 "" 2
# 8 "" 2
class f;
class D {
  f *h();
  void i();
};
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
# 1 "" 1
class j {
  b k;

public:
  a *operator->() { a l = *k.c(); }
  operator a *() {
    a *m = k.c();
    return m;
  }
}
# 2 "" 2
# 1 "" 2
# 9 "" 2
# 0 "" 2
# 2 "" 2
# 2 "" 2
;
# 2 "" 2
# 9 "" 2
class f {
public:
  j n;
};
# 9 "" 2
void D::i() {
  f d = *h();
  delete d.n;
  d.n->e(false);
}

$ ./clang-tidy -checks="-*,clang-analyzer*"
test-clang__ento__PathDiagnosticLocation.cc --                                  
Unexpected ProgramPoint
UNREACHABLE executed at
third_party/llvm/llvm/tools/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp:746!
#6 0x000055bb2c951b3d
clang::ento::PathDiagnosticLocation::create(clang::ProgramPoint const&,
clang::SourceManager const&) (./clang-tidy+0x367eb3d)
#7 0x000055bb2c8f84d2
clang::ento::TrackConstraintBRVisitor::VisitNode(clang::ento::ExplodedNode
const*, clang::ento::BugReporterContext&, clang::ento::BugReport&)
(./clang-tidy+0x36254d2)
#8 0x000055bb2c8e46e8 generateVisitorsDiagnostics(clang::ento::BugReport*,
clang::ento::ExplodedNode const*, clang::ento::BugReporterContext&)
(./clang-tidy+0x36116e8)
#9 0x000055bb2c8dfcb2
clang::ento::GRBugReporter::generatePathDiagnostics(llvm::ArrayRef<clang::ento::PathDiagnosticConsumer*>,
llvm::ArrayRef<clang::ento::BugReport*>&) (./clang-tidy+0x360ccb2)
#10 0x000055bb2c8e1adb
clang::ento::BugReporter::generateDiagnosticForConsumerMap(clang::ento::BugReport*,
llvm::ArrayRef<clang::ento::PathDiagnosticConsumer*>,
llvm::ArrayRef<clang::ento::BugReport*>) (./clang-tidy+0x360eadb)
#11 0x000055bb2c8dc6f9
clang::ento::BugReporter::FlushReport(clang::ento::BugReportEquivClass&)
(./clang-tidy+0x36096f9)
#12 0x000055bb2c8db9cb clang::ento::BugReporter::FlushReports()
(./clang-tidy+0x36089cb)
#13 0x000055bb2c6a67a8 (anonymous
namespace)::AnalysisConsumer::HandleCode(clang::Decl*, unsigned int,
clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*,
llvm::DenseMapInfo<clang::Decl const*> >*) (./clang-tidy+0x33d37a8)
#14 0x000055bb2c691d50 (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&)
(./clang-tidy+0x33bed50)
#15 0x000055bb2cc0520c
clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&)
(./clang-tidy+0x393220c)
#16 0x000055bb2cdc0414 clang::ParseAST(clang::Sema&, bool, bool)
(./clang-tidy+0x3aed414)
#17 0x000055bb2cbfed63 clang::FrontendAction::Execute()
(./clang-tidy+0x392bd63)
#18 0x000055bb2cab37e1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(./clang-tidy+0x37e07e1)
#19 0x000055bb2ca0c7d1
clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>,
clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>,
clang::DiagnosticConsumer*) (./clang-tidy+0x37397d1)
#20 0x000055bb2c30ec27
clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&,
clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::string>,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, bool,
llvm::StringRef)::ActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>,
clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>,
clang::DiagnosticConsumer*) (./clang-tidy+0x303bc27)
#21 0x000055bb2ca0c53a clang::tooling::ToolInvocation::runInvocation(char
const*, clang::driver::Compilation*,
std::shared_ptr<clang::CompilerInvocation>,
std::shared_ptr<clang::PCHContainerOperations>) (./clang-tidy+0x373953a)
#22 0x000055bb2ca0bf26 clang::tooling::ToolInvocation::run()
(./clang-tidy+0x3738f26)
#23 0x000055bb2ca0e625
clang::tooling::ClangTool::run(clang::tooling::ToolAction*)
(./clang-tidy+0x373b625)
#24 0x000055bb2c30a96f
clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&,
clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::string>,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, bool, llvm::StringRef)
(./clang-tidy+0x303796f)

-- 
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/20181212/3ea4adaa/attachment.html>


More information about the llvm-bugs mailing list