[Soot-list] resolve From ClassFile

Ondrej Lhotak olhotak at sable.mcgill.ca
Wed Jun 22 12:00:20 EDT 2005


On Tue, Jun 21, 2005 at 08:33:05AM -0500, Saswat Anand wrote:
> 
> Hello,
> 
> I am having some problem with soot.coffi.Util.resolveFromClassFile 
> function. I dont know if it is a bug or some misunderstanding on my part 
> about the usage of loadClassAndSupport.
> 
> I have a SceneTransformer that loads a class using loadClassAndSupport 
> and I get the following exception. I see that soot.sootClass.addField() 
> requires the class to be in SIGNATURES level. Whereas the 
> resolveFromClassFile method is (transitively) called from 
> soot.sootResolver.bringToHierarchy() where the level is set to HIERARCHY.
> 
> Btw I am using -w -f jimple options. Would appreciate a quick response 
> very much!

The key issue is that as soon as you jimplify the first method, you
can no longer load any additional classes, because the jimple typing
algorithm relies on having the complete hierarchy, and on having all
methods and fields.

The checkLevel stuff is an assertion that attempts to enforce this.
When Soot is first resolving classes, doneResolving in the Scene is
false, disabling the checkLevel checking. All operations on classes
are allowed (the resolver needs to perform them). After resolving and
before the first jimplification, doneResolving gets set to true, so the
checkLevel assertions are enabled. At this point, all operations that
would invalidate assmptions made by jimplification (such as loading a
class or adding fields to it) cause checkLevel to throw an exception.

Ondrej

> 
> Saswat
> 
> 
> Exception in thread "main" java.lang.RuntimeException: This operation 
> requires resolving level SIGNATURES but 
> gov.nasa.jpf.symbolic.integer.SymbolicInteger is at resolving level 
> HIERARCHY
>          at soot.SootClass.checkLevel(SootClass.java:123)
>          at soot.SootClass.addField(SootClass.java:185)
>          at soot.coffi.Util.resolveFromClassFile(Util.java:150)
>          at soot.CoffiClassSource.resolve(CoffiClassSource.java:37)
>          at soot.SootResolver.bringToHierarchy(SootResolver.java:148)
>          at soot.SootResolver.bringToSignatures(SootResolver.java:172)
>          at soot.SootResolver.bringToBodies(SootResolver.java:214)
>          at soot.SootResolver.processResolveWorklist(SootResolver.java:100)
>          at soot.SootResolver.resolveClass(SootResolver.java:89)
>          at soot.Scene.loadClass(Scene.java:329)
>          at soot.Scene.loadClassAndSupport(Scene.java:314)
>          at 
> instrumenter.JPFInterface.loadSymbolicClasses(JPFInterface.java:40)
>          at 
> instrumenter.Instrumenter.internalTransform(Instrumenter.java:24)
>          at soot.SceneTransformer.transform(SceneTransformer.java:39)
>          at soot.Transform.apply(Transform.java:89)
>          at soot.ScenePack.internalApply(ScenePack.java:44)
>          at soot.Pack.apply(Pack.java:110)
>          at soot.PackManager.runWholeProgramPacks(PackManager.java:350)
>          at soot.PackManager.runPacks(PackManager.java:300)
>          at soot.Main.run(Main.java:179)
>          at soot.Main.main(Main.java:153)
>          at instrumenter.Main.main(Main.java:13)
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> 


More information about the Soot-list mailing list