[Soot-list] unreachable code in jimple files?

Bodden, Eric eric.bodden at sit.fraunhofer.de
Mon Sep 1 08:59:45 EDT 2014


Hmmm, so are you actually running a transformation that evaluates the nullness information to turn checks like if(r4==null) into if(false)?

Cheers,
Eric


On 28.08.2014, at 18:49, Martin Schäf <martinschaef at gmail.com> wrote:

> Unfortunately not ... but I'm still using soot-2.5 (because of this line number issue I mentioned earlier). However, it looks like the result for the current version is the same.
> 
> Cheers,
> M
> 
> 
> On Thu, Aug 28, 2014 at 9:18 AM, Bodden, Eric <eric.bodden at sit.fraunhofer.de> wrote:
> Hi Martin.
> 
> Was this fixed with the patch you submitted today?
> 
> Cheers,
> Eric
> 
> On 28.08.2014, at 04:34, Martin Schäf <martinschaef at gmail.com> wrote:
> 
> > Hi,
> > I'm building this tool to detect contradictions in code and I'm trying to get rid of my false positives.
> > However, there seems to be some odd unreachable code in the jimple file generated for try-catch with resources.
> > Here is the Java program:
> >     public void ex06(String name) throws Exception {
> >       File config = new File(name);
> >         try (FileOutputStream fos = new FileOutputStream(config);
> >                 PrintWriter writer = new PrintWriter(new OutputStreamWriter(
> >                         fos , "rw"))) {
> >             bar();
> >         }
> >     }
> > The jimple output generated from the class file is attached. If you look at the lines starting from 109, you have:
> >      label21:
> >         $r24 := @caughtexception;
> >
> >      label22:
> >         r25 = $r24;
> >         r5 = r25;
> >         throw r25;
> >
> >      label23:
> >         $r26 := @caughtexception;
> >         r11 = $r26;
> >
> >      label24:
> >         if r4 == null goto label29;
> >
> >         if r5 == null goto label28;
> > Where r5 is clearly non-null and thus the "goto label28" is unreachable.
> >
> > Earlier in the code there is a chance to reach label23 with r5==null through an exception. Unfortunately, that is preceded by another trap, so the edge is ignored:
> >
> >         catch java.lang.Throwable from label0 to label16 with label21;
> >         catch java.lang.Throwable from label0 to label16 with label23;
> >
> > Is this something I have to live with or is there an easy way around? For some reason the NullnessAnalysis doesn't catch that either ... probably there is an infeasible edge in the exceptional unit graph.
> >
> > Cheers,
> > Martin
> >
> >
> >
> > <example.txt>_______________________________________________
> > Soot-list mailing list
> > Soot-list at CS.McGill.CA
> > https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
> 
> --
> Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
> Head of Secure Software Engineering  at Fraunhofer SIT, TU Darmstadt and EC SPRIDE
> Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
> 
> 

--
Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering  at Fraunhofer SIT, TU Darmstadt and EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140901/0950e6a1/attachment-0001.bin 


More information about the Soot-list mailing list