[Soot-list] Parsing Soot class files fails with NullPointerException

Heejong Lee heejong at gmail.com
Tue Jun 1 01:05:04 EDT 2010


Thanks for the reply.
I ran the debugger and figured out resolveNonSpecial (at
57:23:VirtualCalls.java) returned Null. The execution paths are marked as
asterisks after line numbers:

57     public SootMethod resolveNonSpecial( RefType t, NumberedString subSig
) {
58 *       SmallNumberedMap vtbl = (SmallNumberedMap) typeToVtbl.get( t );
59 *       if( vtbl == null ) {
60             typeToVtbl.put( t, vtbl =
61                     new SmallNumberedMap( Scene.v().getMethodNumberer() )
);
62         }
63 *       SootMethod ret = (SootMethod) vtbl.get( subSig );
64 *       if( ret != null ) return ret;
65 *       SootClass cls = (t).getSootClass();
66 *       if( cls.declaresMethod( subSig ) ) {
67 *           SootMethod m = cls.getMethod( subSig );
68 *           if( m.isConcrete() || m.isNative() ) {
69                 ret = cls.getMethod( subSig );
70             }
71 *       } else {
72             if( cls.hasSuperclass() ) {
73                 ret = resolveNonSpecial( cls.getSuperclass().getType(),
subSig );
74             }
75         }
76 *       vtbl.put( subSig, ret );
77 *       return ret;
78     }

And from the line 64, variable ret was assigned as Null. What is the role of
vtbl? In this case, field "array" of vtbl contained NumberedStrings but
field "values" of that had Null. So vtbl.get() returns Null. Is this
possible situation? Maybe this problem is related to "-allow-phantom-refs"
option since the two arguments are {t = java.lang.Object: soot.RefType,
subSig = java.lang.String toString(): soot.util.NumberedString}. The same
problem happens when parsing sbt 0.7.4(
http://code.google.com/p/simple-build-tool/) with the same options.

> Why do you have soot.Main in the end? Are you trying to analyze Soot
itself?
I just need a mid-size Java program to examine how Soot works :-)

Regards,

On Mon, May 31, 2010 at 6:40 PM, Eric Bodden <
bodden at st.informatik.tu-darmstadt.de> wrote:

> Hi Heejong.
>
> > $ java -jar soot-2.4.0.jar -cp soot-2.4.0.jar -allow-phantom-refs -w -v
> > soot.Main
>
> Why do you have soot.Main in the end? Are you trying to analyze Soot
> itself?
>
> But that should not actually be the cause of this error. It would be
> nice to have a smaller test case that triggers this Exception.
>
> Eric
>



-- 
Heejong Lee

Associate Research Engineer
Program Analysis Division
Fasoo.com, Inc. (www.spa-arrow.com)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20100601/865ac22b/attachment.html 


More information about the Soot-list mailing list