[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Soot NPE



I'm copying this reply to the soot-list mailing list, which is
our de facto bug reporting facility.

The NullPointerException you report may indicate that I missed a
case when I tried to fix Soot's handling of exception ranges in
inlined subroutines.  It would be a lot easier to find the bug,
though, if we had the class file that triggers it.

Since you are performing a whole program analysis, the triggering
class could be in any of the libraries you are using, as well as
among the classes comprising your APEnterprise application.  You
can use soot's --verbose flag to find out which method soot is
analyzing at the time of the exception, but the output of
--verbose can be intimidatingly obscure.  If you're running on a
unix variant, try this to cut down on the text:

    java -Xmx400m soot.Main --app -W -cp \
    $CLASSPATH:/usr/local/jdk/jre/lib/rt.jar:. APEnterprise \
    | egrep 'Applying phase jb|Constructing JimpleBody'

I'm hoping that the last match on "Applying phase jb" before the
exception gives us the class name being analyzed, while the
last match on 'Constructing JimpleBody' will definitely provide
the name of the troublesome method.  

Other soot-hands may have better ideas for determining which
class is triggering the problem.

>>>>> "djarvis" == Dave Jarvis <djarvis@invoqsystems.com> writes:

    djarvis> Hi,
    djarvis> Exception in thread "main" java.lang.NullPointerException
    djarvis>          at java.util.Hashtable.get(Hashtable.java:315)
    djarvis>          at soot.coffi.CFG.adjustExceptionTable(CFG.java:953)
    djarvis>          at soot.coffi.CFG.eliminateJsrRets(CFG.java:461)
    djarvis>          at soot.coffi.CFG.<init>(CFG.java:89)
    djarvis>          at soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:87)
    djarvis>          at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:79)
    djarvis>          at soot.SootMethod.retrieveActiveBody(SootMethod.java:274)
    djarvis>          at 
    djarvis> soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processNewMethod(OnFlyCallGraphBuilder.java:191)
    djarvis>          at 
    djarvis> soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processReachables(OnFlyCallGraphBuilder.java:82)
    djarvis>          at 
    djarvis> soot.jimple.toolkits.callgraph.CallGraphBuilder.build(CallGraphBuilder.java:94)
    djarvis>          at 
    djarvis> soot.jimple.toolkits.callgraph.CHATransformer.internalTransform(CHATransformer.java:43)
    djarvis>          at soot.SceneTransformer.transform(SceneTransformer.java:39)
    djarvis>          at soot.Transform.apply(Transform.java:79)
    djarvis>          at soot.RadioScenePack.internalApply(RadioScenePack.java:60)
    djarvis>          at 
    djarvis> soot.jimple.toolkits.callgraph.CallGraphPack.internalApply(CallGraphPack.java:36)
    djarvis>          at soot.Pack.apply(Pack.java:107)
    djarvis>          at soot.PackManager.runWholeProgramPacks(PackManager.java:292)
    djarvis>          at soot.PackManager.runPacks(PackManager.java:275)
    djarvis>          at soot.Main.run(Main.java:180)
    djarvis>          at soot.Main.main(Main.java:154)

    djarvis> Called using:

    djarvis> java -Xmx400m soot.Main --app -W -cp \
    djarvis> 	$CLASSPATH:/usr/local/jdk/jre/lib/rt.jar:. APEnterprise

    djarvis> CLASSPATH:
    djarvis> org.mortbay.jetty.jar:org.jdom.jar:org.apache.jasper.jar:org.apache.crimson.jar:mersenne-twister.jar:mail.jar:javax.xml.jaxp.jar:javax.servlet.jar:edu.oswego.cs.dl.util.concurrent.jar:com.sun.net.ssl.jar:bmsi.util.zoneinfo.jar:activation.jar::ocrs12.zip:nls_charset12.zip:classes12.zip

    djarvis> Sincerely,
    djarvis> Dave Jarvis
    djarvis> -- 
    djarvis> Invoq Systems Inc.
    djarvis> t. 250.380.0304
    djarvis> e. djarvis@invoqsystems.com
    djarvis> w. http://www.invoqsystems.com