[Soot-list] ExceptionalUnitGraph and nested traps

Patrick Lam plam at sable.mcgill.ca
Wed Jan 2 10:08:51 EST 2013


On 01/02/13 08:12, Michael Faes wrote:
> Hi John (and Patrick),
>
> Thank you so much for your detailed answer. It seems like this exception
> business is considerably more complicated than I thought.
>
> As you suggested, I copied the UnitThrowAnalysis and removed some of the
> exceptions that are not relevant for my analysis. And in case this
> proves to be not enough to resolve the issue, I'm just going to make the
> analysis assume that all objects are unlocked when a method returns.
>
> I encountered one more issue though. What is the correct way to set my
> custom analysis as the default throw analysis? I tried the following in
> my main method:
>
>       Options.v().set_via_shimple(true);
>       Options.v().set_omit_excepting_unit_edges(true);
>       Scene.v().setDefaultThrowAnalysis(new NoVmErrorsThrowAnalysis());
>       PackManager.v().getPack("stp").add(
>               new Transform("stp.deadlock", new MethodSummarizer()));
>       Main.main(args);
>
> but I get this exception:
>
> java.lang.IllegalStateException: RefType
> java.lang.RuntimeException not loaded. If you tried to get the RefType
> of a library class, did you call loadNecessaryClasses()? Otherwise
> please check Soot's classpath.
>     at soot.Scene.getRefType(Scene.java:467)
>     at soot.toolkits.exceptions.ThrowableSet$Manager.<init>
>     at soot.Singletons.soot_toolkits_exceptions_ThrowableSet_Manager
>     at soot.toolkits.exceptions.ThrowableSet$Manager.v
>     at soot.toolkits.exceptions.NoVmErrorsThrowAnalysis.<init>
>     at deadlockfinder.DeadlockFinder.main

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