This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Dump stable identifiers for exploded nodes
ClosedPublic

Authored by george.karpenkov on Sep 4 2018, 5:10 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ added inline comments.Sep 5 2018, 2:11 PM
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
243 ↗(On Diff #163953)

Type needs to be updated.

NoQ accepted this revision.Sep 6 2018, 4:04 PM

The interesting part here is that you immediately see in which order nodes were created, which is great for debugging exploration order.

clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
3150 ↗(On Diff #163953)

Formatting.

This revision is now accepted and ready to land.Sep 6 2018, 4:04 PM
This revision was automatically updated to reflect the committed changes.

Hey guys, the assertion is being triggered for me (I'm using clang r342322):

$ cat ~/main.c
void foo(unsigned width)
{
  int base;
  int i = 0;

  if (i % width == 0)
    base = 1;

  assert(base == 1);
}

$ clang -cc1 -analyze -analyzer-checker=core ~/main.c -analyzer-viz-egraph-graphviz -trim-egraph
/home/mramalho/main.c:9:3: warning: implicit declaration of function 'assert' is invalid in C99
  assert(base == 1);
  ^
Writing '/tmp/TrimmedExprEngine-5b12da.dot'... clang: ../tools/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp:288: int64_t clang::ento::ExplodedNode::getID(clang::ento::ExplodedGraph*) const: Assertion `Out && "Wrong allocator used"' failed.
Aborted (core dumped)
NoQ added a comment.Sep 15 2018, 9:52 AM

So trimmed graphs are in a different allocator?

Hey, sorry, I’ll take a look