[llvm-bugs] [Bug 25392] New: Assertion `ThisRegion && "ThisValue was not a memory region"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 3 11:28:52 PST 2015


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

            Bug ID: 25392
           Summary: Assertion `ThisRegion && "ThisValue was not a memory
                    region"' failed
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: alexfh at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

We've started seeing assertion failures in all static analyzer checks on a
large number of translation units in our code base. This started happening
somewhere after r246545. 

Here's a repro:

$ cat sa1.cc
struct x0;
template <typename> struct x1 { typedef x0 x2; };
template <typename x3, typename x4 = x3> struct x5 {
public:
  typename x1<x4>::x2 operator[](int) {}
};
struct x0 {
public:
  template <typename> void x6() const;
  x5<int> x7;
} x8;
void x9() { x8.x7[0].x6<x5<int>>(); }


$ clang-tidy -checks=-*,clang-analyzer-unix.API sa1.cc  -- -std=c++11
llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp:441: virtual void
clang::ento::CXXInstanceCall::getExtraInvalidatedValues(ValueList &,
clang::ento::RegionAndSymbolInvalidationTraits *) const: Assertion `ThisRegion
&& "ThisValue was not a memory region"' failed.
Aborted (core dumped)

Here's the relevant stack trace:
*** SIGSEGV (@0x10), see go/cppdebug received by PID 23704 (TID 23704); stack
trace: ***
PC: @          0x135f0f4  (unknown)  clang::ento::MemRegion::getBaseRegion()
    @          0x19f120d        928  FailureSignalHandler()
    @     0x7fa928aa9390       1488  __restore_rt
    @          0x1380c7f        448 
clang::ento::CallEvent::invalidateRegions()
    @          0x13ab23e        144 
clang::ento::ExprEngine::conservativeEvalCall()
    @          0x13abde8        144  clang::ento::ExprEngine::defaultEvalCall()
    @          0x139d49d        352 
clang::ento::CheckerManager::runCheckersForEvalCall()
    @          0x13aaf8a        368  clang::ento::ExprEngine::evalCall()
    @          0x13aac77        384  clang::ento::ExprEngine::VisitCallExpr()
    @          0x1389b18       1248  clang::ento::ExprEngine::Visit()
    @          0x1386257        400  clang::ento::ExprEngine::ProcessStmt()
    @          0x1385eec         96 
clang::ento::ExprEngine::processCFGElement()
    @          0x139727e        160 
clang::ento::CoreEngine::dispatchWorkItem()
    @          0x1396e7a        192  clang::ento::CoreEngine::ExecuteWorkList()
    @           0xb41d82       1120  (anonymous
namespace)::AnalysisConsumer::ActionExprEngine()
    @           0xb41891        288  (anonymous
namespace)::AnalysisConsumer::HandleCode()
    @           0xb34c54        480  (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit()
    @           0xd31a9c         48 
clang::MultiplexConsumer::HandleTranslationUnit()
    @           0xe3d832        144  clang::ParseAST()
    @           0xd4988f         48  clang::FrontendAction::Execute()
    @           0xc7a542         96  clang::CompilerInstance::ExecuteAction()
    @           0xc332b5        352 
clang::tooling::FrontendActionFactory::runInvocation()
    @           0xc330fe         64 
clang::tooling::ToolInvocation::runInvocation()
    @           0xc32c0a       1440  clang::tooling::ToolInvocation::run()
    @           0xc341aa       1040  clang::tooling::ClangTool::run()
    @           0xa17f65       1952  clang::tidy::runClangTidy()
    @           0x435b20       1344  main
    @     0x7fa9284fcce8        208  __libc_start_main
    @           0x434af9  (unknown)  _start

-- 
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/20151103/62e940bd/attachment.html>


More information about the llvm-bugs mailing list