[Soot-list] ExceptionalUnitGraph and nested traps

Michael Faes rolve at trick17.ch
Wed Jan 2 11:28:51 EST 2013


Hi Patrick,

Thanks for you answer. I just read this blog post 
http://www.bodden.de/2012/07/26/soot-custom-entry-points/ where Eric 
Bodden points out that initialization code that loads classes should not 
be followed by Soot.main(). So I changed my main method to the 
following, which seems to work.

     Options.v().set_via_shimple(true);
     Options.v().set_omit_excepting_unit_edges(true);
     Options.v().set_dump_cfg(Arrays.asList("stp.deadlock"));
     Options.v().parse(args);

     final List<String> classes = Options.v().classes();
     for(final String name : classes)
         Scene.v().forceResolve(name, SootClass.BODIES);

     Scene.v().loadNecessaryClasses();
     Scene.v().setDefaultThrowAnalysis(new NoVmErrorsThrowAnalysis());

     PackManager.v().getPack("stp").add(
             new Transform("stp.deadlock", new MethodSummarizer()));

     PackManager.v().runPacks();

So thanks again for your help.

One last thing though: When I activated CFG dumping for my 
"stp.deadlock" pack, I got an exception indicating that a directory 
could not be created. After some investigation, I found that the 
PhaseDumper wanted to create a directory named "void <init>()" which is 
not a valid name (on Windows at least). So in case someone wants to fix 
this (or point out that I made another stupid mistake), here is the 
simple change I had to make:

In java.io.File makeDirectoryIfMissing(final Body b), change
     buf.append(b.getMethod().getSubSignature());
to
     buf.append(b.getMethod().getSubSignature()
             .replace('<', '[').replace('>', ']'));

Michael

-------- Original-Nachricht --------
Betreff: Re: [Soot-list] ExceptionalUnitGraph and nested traps
Von: Patrick Lam <plam at sable.mcgill.ca>
An: soot-list at sable.mcgill.ca
Datum: 02.01.2013 16:08

> Hi Michael,
>
> What you're experiencing here is that the ThrowAnalysis runs before the
> classes get resolved. Are you sure that you only removed code from the
> UnitThrowAnalysis? Any new code might be making references to types that
> don't exist yet at the point that you're referring to them. In
> particular, it looks like you're trying to refer to
> java.lang.RuntimeException. Did you try to manually resolve it?
>
> It looks like you should call
> Scene.v().loadClass("java.lang.RuntimeException", SootClass.SIGNATURES);
>
> Let me know if that works.
>
> pat


More information about the Soot-list mailing list