[Soot-list] Exception Table
Silviu ANDRICA
silviu.andrica at gmail.com
Wed Jul 9 14:14:09 EDT 2008
Hello,
my problem is that "label3: store.r $r6;" is not caught by the
exception handler whose head it is.
Patrick Lam wrote:
> Silviu ANDRICA wrote:
>
>> The Baf translation adds, for the first trap, "label3: store.r $r6;".
>> The problem is that, now an exceptional edge from it to the second trap
>> handler: "label8: store.r $r6;" which does not guarantee that the second
>> acquired lock is released: if the first exitmonitor fails and then
>> "label 3" fails, then control reaches "label 8" and then only one, the
>> first, lock is released.
>>
>
> I'm having some trouble understanding your explanation of the problem.
>
> It's clear that the problem is not in the Java-to-Jimple translation,
> since the problem occurs in javac-produced code. It's also clear that
> it's not in the Jimple-to-baf translation, since the problem occurs in
> Jimple.
>
> Are you saying that the statement $r6 := @caughtexception (also known as
> store.r $r6) can throw an exception? Which exception could it throw?
>
>
There is an edge, in ExcepionalGraphUnit, from label 3 to label 8 which
should not be, if I understood correctly the Java bytecode exception
table representation.
I overrode the buildExceptionsDests in ExceptionalUnitGraph so that
it'll print the ThrowableSet for each unit and I got this:
Unit $r6 := @caughtexception might throw
soot.toolkits.exceptions.ThrowableSet at 4edc41c5:
+Any_subtype_of_java.lang.Throwable
The instructions that I modified in the buildExceptionalDests was the
check if thrownSet is null. I modified it in the following way:
if (thrownSet == null) {
thrownSet = throwAnalysis.mightThrow(unit);
System.out.println("Unit " + unit + " might throw "
+ thrownSet);
}
I also copied the addDestToMap and subclassed the ExceptionDest in order
to make it compile.
Silviu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20080709/b040eaa2/attachment-0001.htm
More information about the Soot-list
mailing list