[Soot-list] Get all fields and locals, java.lang.Exception: null typing passed to useChecker

Eric Bodden eric.bodden at ec-spride.de
Tue Mar 27 10:08:23 EDT 2012


Hi Florian.

For some reason the type assigner seems to fail on one of the methods
that Soot is loading. Are you using allow-phantom-refs by any chance?

As a workaround you could also try the "old" type assigner. (see
http://www.sable.mcgill.ca/soot/tutorial/phase/phase.html#SECTION00024000000000000000)

Eric

On 27 March 2012 14:58, Florian Strauß <f_straus at informatik.uni-kl.de> wrote:
> Hello,
>
>
>
> I want to collect all fields and locals (with the corresponding methods) in
> every application classes.
>
>
>
> My method:
>
>
>
>       public static List<FieldOrLocalVar> getAllVaribles() {
>
>             if(allApplicationVars == null){
>
>                   allApplicationVars = new LinkedList<FieldOrLocalVar>();
>
>                   for (SootClass applicationClass :
> soot.Scene.v().getApplicationClasses()){
>
>                         for (SootField field :
> applicationClass.getFields()){
>
>                              allApplicationVars.add(new
> FieldOrLocalVar(field));
>
>                         }
>
>
>
>                         for (SootMethod method:
> applicationClass.getMethods()){
>
>                              if(method.isConcrete()){
>
>                                    for (Local local :
> method.retrieveActiveBody().getLocals()){
>
>                                          allApplicationVars.add(new
> FieldOrLocalVar(local, method));
>
>                                    }
>
>                              }
>
>                         }
>
>                   }
>
>             }
>
>
>
>             return allApplicationVars;
>
>       }
>
>
>
>
>
> After lots of ..
>
> [..]
>
> found type: Ljava/util/Iterator<Ljava/lang/Object;>;
>
> found type: Ljava/util/List<Ljava/lang/Object;>;
>
> found type: Ljava/util/Iterator<Ljava/lang/Object;>;
>
> found type: Ljava/util/Iterator<Ljava/lang/Object;>;
>
> found type: Ljava/util/Map<Ljava/lang/Object;Ljava/lang/Object;>;
>
> [..]
>
> .. messages on the console, I get the following exception:
>
>
>
> java.lang.Exception: null typing passed to useChecker
>
>       at
> soot.jimple.toolkits.typing.fast.UseChecker.check(UseChecker.java:50)
>
>       at
> soot.jimple.toolkits.typing.fast.TypeResolver.insertCasts(TypeResolver.java:345)
>
>       at
> soot.jimple.toolkits.typing.fast.TypeResolver.inferTypes(TypeResolver.java:124)
>
>       at
> soot.jimple.toolkits.typing.TypeAssigner.internalTransform(TypeAssigner.java:102)
>
>       at soot.BodyTransformer.transform(BodyTransformer.java:51)
>
>       at soot.Transform.apply(Transform.java:104)
>
>       at soot.JimpleBodyPack.applyPhaseOptions(JimpleBodyPack.java:66)
>
>       at soot.JimpleBodyPack.internalApply(JimpleBodyPack.java:89)
>
>       at soot.Pack.apply(Pack.java:124)
>
>       at soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:117)
>
>       at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:89)
>
>       at soot.SootMethod.retrieveActiveBody(SootMethod.java:322)
>
>       at [myPackageName].getAllVaribles(Line: “for (Local local :
> method.retrieveActiveBody().getLocals()) “)
>
>
>
> What can I do to avoid this exception?
>
>
>
> And maybe it would be a good idea to throw a RuntimeException instead of
> terminating the program:
>
>
>
> soot.jimple.toolkits.typing.fast.UseChecker.check:
>
> [..]
>
>             try {
>
>                   this.tg = tg;
>
>                   this.uv = uv;
>
>                   if (this.tg == null) throw new Exception("null typing
> passed to useChecker");
>
>             } catch (Exception e) {
>
>                   e.printStackTrace();
>
>                   System.exit(1);
>
>             }
>
> [..]
>
>
>
> Could you help me, please?
>
>
>
> Best regards,
>
> Florian
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>



-- 
Eric Bodden, Ph.D., http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Principal Investigator in Secure Services at CASED
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list