[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Assumption in building MethodCallGraph



I'm reading the code of MethodCallGraph and I found that it assumes that
all the classes in the Scen are reachable, so a bounch of methodes like
clinit, run, finialize ... are added in to the call graph and considered
reachable.

But if I'm correct. a MethodCallGraph should be built from a InvokeGraph
which does not necessarily assume that all the classes are reachable, for
instance, the InvokeGraph built by 

ClassHierarchyAnalysis.newPreciseInvokeGraph();

So this leads to a place where some of the methods are considered
reachable by the MethodCallGraph but not reachable by the InvokeGraph 

The Spark analysis reads reachablility information from MethodCallGraph
but traverse the call edge according to the InvokeGraph. So an exception
will be thrown if the analysis is processing a method which MCG considers
it to be reachable while IG does not.

java.lang.RuntimeException: Site is not part of invoke graph!
        at
soot.jimple.toolkits.invoke.InvokeGraph.getTargetsOf(InvokeGraph.java:215)
        at
soot.jimple.spark.builder.StandardParms.handleStmt(StandardParms.java:135)
        at
soot.jimple.spark.builder.ContextInsensitiveBuilder.handleClass(ContextInsensitiveBuilder.java:106)
        at
soot.jimple.spark.builder.ContextInsensitiveBuilder.build(ContextInsensitiveBuilder.java:66)
        at
soot.jimple.spark.SparkTransformer.internalTransform(SparkTransformer.java:78)
        at soot.SceneTransformer.transform(SceneTransformer.java:46)
        at soot.SceneTransformer.transform(SceneTransformer.java:58)
        at
eflow.ExceptionSolver.internalTransform(ExceptionSolver.java:20)
        at soot.SceneTransformer.transform(SceneTransformer.java:46)
        at soot.Pack.apply(Pack.java:79)
        at soot.Main.run(Main.java:1649)
        at java.lang.Thread.run(Thread.java:484)


Should I write it here or put it in bug report somewhere?

Thanks!