[Soot-list] Trouble Implementing Interprocedural Analysis

Eric Bodden eric.bodden at mail.mcgill.ca
Thu May 3 18:07:55 EDT 2007


No it has to be on *Soot's* classpath.

Eric

On 03/05/07, Armand Navabi <anavabi at purdue.edu> wrote:
> Eric,
>
> Thanks for the response.  It seems I already have rt.jar in my
> classpath.  See below where I print my classpath environment variable.
>
> anavabi at gator /scratch/anavabi/soot/trunk $ java -Xmx512m
> analysis.globalaccesses.GlobalAccesses analysis.examples.Foo
> Analysis for analysis.examples.Foo
> first class loaded: analysis.examples.Foo
> [Call Graph] For information on where the call graph may be incomplete,
> use the verbose option to the cg phase.
> 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
> soot.jimple.toolkits.callgraph.CHATransformer.internalTransform(CHATransformer.java:43)
>         at soot.SceneTransformer.transform(SceneTransformer.java:39)
>         at soot.SceneTransformer.transform(SceneTransformer.java:45)
>         at soot.SceneTransformer.transform(SceneTransformer.java:50)
>         at
> analysis.globalaccesses.GlobalAccesses.main(GlobalAccesses.java:77)
> anavabi at gator /scratch/anavabi/soot/trunk $ echo $CLASSPATH
> .:/scratch/anavabi/soot/jasmin-2.2.2/classes:/scratch/anavabi/soot/polyglot-1.3.2/classes:/scratch/anavabi/soot/polyglot-1.3.2/cup-classes:/scratch/anavabi/soot/soot-2.2.2/classes:/opt/sun-jdk-1.4.2.10/jre/lib/rt.jar
>
> After your suggestion, I also put the following lines in my code:
>
>     String cp = ".:/scratch/anavabi/soot/soot-2.2.2/classes:" +
>       "/scratch/anavabi/soot/jasmin-2.2.2/classes:" +
>       "/scratch/anavabi/soot/polyglot-1.3.2/classes:" +
>       "/scratch/anavabi/soot/polyglot-1.3.2/cup-classes:" +
>       "/opt/sun-jdk-1.4.2.10/jre/lib/rt.jar:" +
>       "/opt/sun-jdk-1.4.2.10/jre/lib/jce.jar:" +
>       "/opt/sun-jdk-1.4.2.10/jre/lib/jsse.jar";
>     Scene.v().setSootClassPath(cp);
>
>     SootClass c = Scene.v().loadClassAndSupport(args[0]);
>     ... <same code as before>
>
> I am still getting the can't find Version exception.
>
> Armand
>
> Eric Bodden wrote:
> > On 03/05/07, Armand Navabi <anavabi at purdue.edu> wrote:
> >> The analysis works fine as long as the argument class does not call a
> >> library class.  As soon as I put a System.out.println in the class, I
> >> get the following error:
> >>
> >> 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)
> >
> > Well, that's no surprise... if you inspect library code the library
> > has to be on your classpath. So you need something like:
> >
> > java -cp soot.jar soot.Main -cp .:/path/to/jre/lib/rt.jar <otherArgs>
> >
> > Eric
> >
> > --
> > Eric Bodden
> > Sable Research Group
> > McGill University, Montréal, Canada
> >
>
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list