[Soot-list] class resolving problem

Jochen Huck jochen.huck at student.kit.edu
Fri Nov 12 10:02:54 EST 2010


Hi,

I use the following soot arguments:
-app -w -annot-side-effect -xml-attributes -f J -p cg.spark enabled -p 
jb use-original-names:true -p jp preserve-source-annotations:true 
-keep-line-number -src-prec java -cp <myClassPath> -main-class <MyMainClass>

I tried -p cg all-reachable:true as well. But it didn't help.

And I am analyzing source code from the javaDesktopSearch 
(http://sourceforge.net/projects/jdesktopsearch/) project where the 
lucene-core-1.9.jar library is replaced through the source code.


Thanks again,

Jochen

Am 12.11.2010 13:54, schrieb Eric Bodden:
> Hi Jochen.
>
> Using addBasicClass seems not to be the right way in your case.
> Actually I am wondering why you are seeing the message at all.
> Usually, Soot should load all classes to BODIES in whole-program mode.
> Can you let us know your command line and the code you are analyzing?
>
> Eric
>
> --
> Dr. Eric Bodden
> Software Technology Group, Technische Universität Darmstadt, Germany
> Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
> Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt
>
>
>
> On 12 November 2010 09:34, Jochen Huck<jochen.huck at student.kit.edu>  wrote:
>> Hi,
>>
>> I've got a problem with soots class resolver. Runnig my analysis I get
>> following Exception:
>>
>> Exception in thread "main" java.lang.RuntimeException: This operation
>> requires resolving level BODIES but org.apache.lucene.store.FSIndexInput is
>> at resolving level SIGNATURES
>> If you are extending Soot, try to add the following call before calling
>> soot.Main.main(..):
>> Scene.v().addBasicClass(org.apache.lucene.store.FSIndexInput,BODIES);
>>
>> I can solve the problem for this class adding (1)
>> Scene.v().addBasicClass("org.apache.lucene.store.FSIndexInput",
>> SootClass.BODIES); before calling soot.Main.main(...) (I run soot in
>> whole-program mode already)
>>
>> The thing is that after inserting the code line above soot will complain
>> about another RuntimeException for another class. If I add code to solve the
>> problem for this class it will find another one and so on.
>> I want to write a script that runs the analysis for many projects and
>> therefore it is very annoying to insert code by hand waiting for the next
>> error and again doing the same thing for the next error and so on. I already
>> read https://svn.sable.mcgill.ca/wiki/index.cgi/ClassResolver and so i
>> decided to write a loop that adds all the classes (with statements like (1))
>> found in the projects bin directory. Then no RuntimeException occurs but I
>> get another Exception:
>>
>>          Exception in thread "main" java.lang.NullPointerException
>>          at
>> soot.JastAddInitialResolver.resolveFromJavaFile(JastAddInitialResolver.java:103)
>>          at soot.JavaClassSource.resolve(JavaClassSource.java:57)
>>          at soot.SootResolver.bringToHierarchy(SootResolver.java:194)
>>          at soot.SootResolver.bringToSignatures(SootResolver.java:219)
>>          at soot.SootResolver.bringToBodies(SootResolver.java:260)
>>          at soot.SootResolver.processResolveWorklist(SootResolver.java:135)
>>          at soot.SootResolver.resolveClass(SootResolver.java:124)
>>          at soot.Scene.tryLoadClass(Scene.java:394)
>>          at soot.Scene.loadBasicClasses(Scene.java:959)
>>          at soot.Scene.loadNecessaryClasses(Scene.java:1018)
>>          at soot.Main.run(Main.java:167)
>>          at soot.Main.main(Main.java:141)
>>          at analysis.MainAnalysis.main(MainAnalysis.java:35)
>>          at test.ToolChain.main(ToolChain.java:118)
>>          at test.ToolChainExample.main(ToolChainExample.java:36)
>>
>> Any advice how to solve this?
>>
>> Thanks,
>>
>> Jochen
>>
>>
>> _______________________________________________
>> 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