[Soot-list] Trouble building CallGraph

Armand Navabi anavabi at purdue.edu
Thu May 3 20:52:32 EDT 2007


My previous problem had too much going on.  The code below demonstrates 
the problem I am having:

  public static void main(String[] args) {
    String cp = ".:/opt/sun-jdk-1.4.2.10/jre/lib/rt.jar";
    Scene.v().setSootClassPath(cp);

    SootClass sClass = Scene.v().loadClassAndSupport(args[0]);
    sClass.setApplicationClass();
    Scene.v().setMainClass(sClass);

    CallGraphBuilder cgb = new CallGraphBuilder(DumbPointerAnalysis.v());
    cgb.build(); // <-- EXCEPTION

    CallGraph cg = Scene.v().getCallGraph();
 }

On the line with that says EXCEPTION, I get the following exception only 
when the code I am analyzing has a call to a library class 
(System.out.println).

Exception in thread "main" java.lang.RuntimeException:
Aborting: can't find classfile sun.misc.Version
        at soot.Scene.getSootClass(Scene.java:374)
        at soot.coffi.CFG.generateJimple(CFG.java:4647)
        at soot.coffi.CFG.jimplify(CFG.java:1464)
        at soot.coffi.CFG.jimplify(CFG.java:1127)
        at soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:98)
        at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:80)
        at soot.SootMethod.retrieveActiveBody(SootMethod.java:304)
        at 
soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processNewMethod(OnFlyCallGraphBuilder.java:182)
        at 
soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processReachables(OnFlyCallGraphBuilder.java:81)
        at 
soot.jimple.toolkits.callgraph.CallGraphBuilder.build(CallGraphBuilder.java:87)
        at analysis.test.Test.main(Test.java:21)

It seems to me that rt.jar should be in my Soot classpath (first two 
lines of method).

Thanks,
Armand


More information about the Soot-list mailing list