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

Exception when subject class extends a library class



Hi,

I run into problems trying to build a callgraph when the class I am analysing extends a library method. Soot throws the following exception:

...
[addStmtNodes] Producing naive Jimple...
java.lang.RuntimeException: Class jsdg.JSDG doesn't have method addNode([java.lang.Object]) : void; failed to resolve in superclasses and interfaces
at soot.SootClass.getMethod(SootClass.java:427)
at soot.coffi.CFG.generateJimple(CFG.java:4455)
at soot.coffi.CFG.jimplify(CFG.java:1463)
at soot.coffi.CFG.jimplify(CFG.java:1126)
at soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:98)
at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:79)
at soot.SootMethod.retrieveActiveBody(SootMethod.java:274)
at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processNewMethod(OnFlyCallGraphBuilder.java:191)


at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processReachables(OnFlyCallGraphBuilder.java:82)

at soot.jimple.toolkits.callgraph.CallGraphBuilder.build(CallGraphBuilder.java:94)

at badboi.CallGraphTraverserFrame.buildCallGraph(CallGraphTraverserFrame.java:182)

...

In this case, the class JSDG extends soot.toolkits.graph.HashMutableDirectedGraph. When I call the loadClassAndSupport method, it loads fine. When I check to see that its superclass has been loaded into the scene, it has. When trying with phantom classes switched to true, the following exception occurs instead:

...
java.lang.NullPointerException
at soot.coffi.Util.isValidJimpleName(Util.java:1132)
at soot.coffi.CFG.jimplify(CFG.java:1100)
at soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:98)
at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:79)
at soot.SootMethod.retrieveActiveBody(SootMethod.java:274)
at
soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processNewMethod(OnFlyCallGraphBuilder.java:191)


at
soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processReachables(OnFlyCallGraphBuilder.java:82)


at soot.jimple.toolkits.callgraph.CallGraphBuilder.build(CallGraphBuilder.java:94)

at badboi.CallGraphTraverserFrame.buildCallGraph(CallGraphTraverserFrame.java:182)

...

Is there any chance that this is a classpath problem (even though it gets loaded into the scene)?

Thanks and best regards,

Neil