[Soot-list] Spark call graph: Missing edges out of method

Bodden, Eric eric.bodden at sit.fraunhofer.de
Tue Nov 5 11:09:20 EST 2013


Hello.

> I am looking for some help to interpret the following. The dacapo 
> benchmar pmd defines a method:
> 
> <net.sourceforge.pmd.symboltable.ClassScope: java.lang.String toString()>
> 
> I build the call graph on the fly, using reflection. The above method 
> makes a number of invokes, some of them to java.util (for example, to 
> <java.util.HashMap: java.lang.Object get(java.lang.Object)>). However, 
> having all-reachable=false in the cg, only some of the outgoing edges 
> appear in the call graph, with <java.util.HashMap: java.lang.Object 
> get(java.lang.Object)> (and others to java.util) missing. If I turn 
> all-reachable=true, the missing invokes appear.
> 
> A call to ReachableMethods() shows that both 
> <net.sourceforge.pmd.symboltable.ClassScope: java.lang.String 
> toString()> and <java.util.HashMap: java.lang.Object 
> get(java.lang.Object)> are reachable in both settings of the 
> all-reachable flag.

Hmm, interesting...

> I would expect that all invokes out of a reachable method are also 
> reachable.

That is certainly not the case, namely if a receiver in the reachable method will always be null. In this case the points-to set is empty and some methods might be unreachable. I suppose that for some reason we are seeing this situation here.

> Could someone explain why this happens, and how I can have 
> this consistency (that all invokes of reachable methods appear in the 
> cg) without having to set all-reachable=true?

My guess is that foe some reason the call-graph is simply incomplete. Did you try "-p cg:verbose true"?

> Note: I have observed similar behavior with other methods that overload 
> from java.lang.Object, but I could not understand it or overcome it so far.

I know these things are hard to debug :-(

Cheers,
Eric


More information about the Soot-list mailing list