<div dir="ltr">Hi Steven,<div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>myCustomAnalysis.java - has the custom analysis defined</div><div>myTest/Test.Java - test file</div><div>runCustomAnalysis.py - compiles the test and the custom analysis and executes the custom analysis on the test file</div><div><br></div><div>I am using the flag &quot;<span style="color:rgb(209,47,27);font-family:Menlo;font-size:11px">-p jb.uce enabled:false&quot;</span> to make sure none of the unreachable catch blocks are eliminated as an optimization.</div><div><br></div><div>If we comment out the line 15 in Test.java which is a throw statement, the analysis works fine, and crashes otherwise.</div><div>Any input on why this might be happening will be very helpful.</div><div><br></div><div>Thank you,</div><div>Samanwita.</div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 4, 2016 at 7:51 AM, Steven Arzt <span dir="ltr">&lt;<a href="mailto:Steven.Arzt@cased.de" target="_blank">Steven.Arzt@cased.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="DE" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Hi Samanwita,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">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.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Best regards,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">  Steven<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">Von:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href="mailto:soot-list-bounces@CS.McGill.CA" target="_blank">soot-list-bounces@CS.McGill.CA</a> [mailto:<a href="mailto:soot-list-bounces@CS.McGill.CA" target="_blank">soot-list-bounces@CS.McGill.CA</a>] <b>Im Auftrag von </b></span><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">Samanwita Pal<br><b>Gesendet:</b> Donnerstag, 31. März 2016 00:00<br><b>An:</b> <a href="mailto:Soot-list@CS.McGill.CA" target="_blank">Soot-list@CS.McGill.CA</a><br><b>Betreff:</b> [Soot-list] Crash on creating an ExceptionalBlockGraph<u></u><u></u></span></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Hi,<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">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.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Whenever my test file has an explicit throw statement, the following line in my CustomSceneAnalysis fails :<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">BlockGraph bg = new ExceptionalBlockGraph(b); <u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">where Body b = m.getActiveBody(); is executed somewhere before that. <u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The stack trace is :<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">java.lang.IllegalStateException: UnitThrowAnalysis StmtSwitch: type of throw argument is not a RefType!<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.toolkits.exceptions.AbstractThrowAnalysis.mightThrowExplicitly(AbstractThrowAnalysis.java:65)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.toolkits.exceptions.UnitThrowAnalysis$UnitSwitch.caseThrowStmt(UnitThrowAnalysis.java:706)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.jimple.internal.JThrowStmt.apply(JThrowStmt.java:70)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:241)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.toolkits.graph.ExceptionalUnitGraph$1.getThrowables(ExceptionalUnitGraph.java:807)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.toolkits.graph.ExceptionalBlockGraph.collectDests(ExceptionalBlockGraph.java:259)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.toolkits.graph.ExceptionalBlockGraph.buildExceptionDests(ExceptionalBlockGraph.java:217)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.toolkits.graph.ExceptionalBlockGraph.buildBlocks(ExceptionalBlockGraph.java:183)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.toolkits.graph.BlockGraph.&lt;init&gt;(BlockGraph.java:69)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.toolkits.graph.ExceptionalBlockGraph.&lt;init&gt;(ExceptionalBlockGraph.java:106)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.toolkits.graph.ExceptionalBlockGraph.&lt;init&gt;(ExceptionalBlockGraph.java:93)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at myCustomAnalysis$mySceneTransformer.internalTransform(myCustomAnalysis.java:65)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.SceneTransformer.transform(SceneTransformer.java:39)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.Transform.apply(Transform.java:90)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.ScenePack.internalApply(ScenePack.java:40)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.Pack.apply(Pack.java:121)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.PackManager.runWholeProgramPacks(PackManager.java:565)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.PackManager.runPacksNormally(PackManager.java:457)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.PackManager.runPacks(PackManager.java:392)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.Main.run(Main.java:271)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at soot.Main.main(Main.java:147)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;">                at myCustomAnalysis.main(myCustomAnalysis.java:23)<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt;min-height:13px"><span style="font-size:8.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Any pointers to why this is happening or how to avoid it will be helpful.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Thanks,<u></u><u></u></p></div><div><p class="MsoNormal">Samanwita<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></div></blockquote></div><br></div>