[Soot-list] Crash on creating an ExceptionalBlockGraph

Samanwita Pal spal at ucdavis.edu
Wed Apr 6 17:38:41 EDT 2016


Hi Steven,

My goal was to get all the basic blocks (focussing on the catch blocks)
from every method body. I am creating an ExceptionalBlockGraph for each
method.

I have attached my test files in the soot-mailing-list.zip. The assumption
is that the CLASSPATH is set to include soot.jar and rt.jar, and the
JAVA_HOME is set correctly.

myCustomAnalysis.java - has the custom analysis defined
myTest/Test.Java - test file
runCustomAnalysis.py - compiles the test and the custom analysis and
executes the custom analysis on the test file

I am using the flag "-p jb.uce enabled:false" to make sure none of the
unreachable catch blocks are eliminated as an optimization.

If we comment out the line 15 in Test.java which is a throw statement, the
analysis works fine, and crashes otherwise.
Any input on why this might be happening will be very helpful.

Thank you,
Samanwita.


On Mon, Apr 4, 2016 at 7:51 AM, Steven Arzt <Steven.Arzt at cased.de> wrote:

> Hi Samanwita,
>
>
>
> This looks as if either the code you are analyzing is broken or Soot
> front-end has issues. Can you be a bit more precise on what you are trying
> to analyze (APK file, Java bytecode, etc.)? What does your analysis code
> look like? What are your Soot command-line options? To debug the issue, I
> would also need the respective input files.
>
>
>
> Best regards,
>
>   Steven
>
>
>
> *Von:* soot-list-bounces at CS.McGill.CA [mailto:
> soot-list-bounces at CS.McGill.CA] *Im Auftrag von *Samanwita Pal
> *Gesendet:* Donnerstag, 31. März 2016 00:00
> *An:* Soot-list at CS.McGill.CA
> *Betreff:* [Soot-list] Crash on creating an ExceptionalBlockGraph
>
>
>
> Hi,
>
>
>
> I am trying to get hold of all the basic blocks in the body of the
> function and identifying if they correspond to a cat block or not.
>
>
>
> Whenever my test file has an explicit throw statement, the following line
> in my CustomSceneAnalysis fails :
>
>
>
> BlockGraph bg = new ExceptionalBlockGraph(b);
>
>
>
> where Body b = m.getActiveBody(); is executed somewhere before that.
>
>
>
> The stack trace is :
>
>
>
> java.lang.IllegalStateException: UnitThrowAnalysis StmtSwitch: type of
> throw argument is not a RefType!
>
>                 at
> soot.toolkits.exceptions.AbstractThrowAnalysis.mightThrowExplicitly(AbstractThrowAnalysis.java:65)
>
>                 at
> soot.toolkits.exceptions.UnitThrowAnalysis$UnitSwitch.caseThrowStmt(UnitThrowAnalysis.java:706)
>
>                 at
> soot.jimple.internal.JThrowStmt.apply(JThrowStmt.java:70)
>
>                 at
> soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:241)
>
>                 at
> soot.toolkits.graph.ExceptionalUnitGraph$1.getThrowables(ExceptionalUnitGraph.java:807)
>
>                 at
> soot.toolkits.graph.ExceptionalBlockGraph.collectDests(ExceptionalBlockGraph.java:259)
>
>                 at
> soot.toolkits.graph.ExceptionalBlockGraph.buildExceptionDests(ExceptionalBlockGraph.java:217)
>
>                 at
> soot.toolkits.graph.ExceptionalBlockGraph.buildBlocks(ExceptionalBlockGraph.java:183)
>
>                 at
> soot.toolkits.graph.BlockGraph.<init>(BlockGraph.java:69)
>
>                 at
> soot.toolkits.graph.ExceptionalBlockGraph.<init>(ExceptionalBlockGraph.java:106)
>
>                 at
> soot.toolkits.graph.ExceptionalBlockGraph.<init>(ExceptionalBlockGraph.java:93)
>
>                 at
> myCustomAnalysis$mySceneTransformer.internalTransform(myCustomAnalysis.java:65)
>
>                 at
> soot.SceneTransformer.transform(SceneTransformer.java:39)
>
>                 at soot.Transform.apply(Transform.java:90)
>
>                 at soot.ScenePack.internalApply(ScenePack.java:40)
>
>                 at soot.Pack.apply(Pack.java:121)
>
>                 at
> soot.PackManager.runWholeProgramPacks(PackManager.java:565)
>
>                 at soot.PackManager.runPacksNormally(PackManager.java:457)
>
>                 at soot.PackManager.runPacks(PackManager.java:392)
>
>                 at soot.Main.run(Main.java:271)
>
>                 at soot.Main.main(Main.java:147)
>
>                 at myCustomAnalysis.main(myCustomAnalysis.java:23)
>
>
>
>
>
> Any pointers to why this is happening or how to avoid it will be helpful.
>
>
>
> Thanks,
>
> Samanwita
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20160406/dbad84dd/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: soot-mailing-list.zip
Type: application/zip
Size: 4838 bytes
Desc: not available
Url : https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20160406/dbad84dd/attachment-0001.zip 


More information about the Soot-list mailing list