[Soot-list] CFG and exception analysis

Eric Bodden eric.bodden at mail.mcgill.ca
Fri Apr 18 09:18:19 EDT 2008


Hello.

>  My problem is the following: Scheduler.schedule is a static method
> invocation. Reading the JVM specification I see that invokestatic may throw
> errors like |IncompatibleClassChangeError|, |UnsatisfiedLinkError| etc. Yet,
> in my flow graph it looks like invokestatic may throw a Throwable.

This is because any thread can throw an InterruptedException (or
something similar) at any time, too.

> And I get
> an edge as if the exception thrown by invokestatic (and not the called
> method) is handled by the handler above. Yet SimulationException is an
> application defined exception.

I don't understand. Does an exception not go from one statement to the
other? So how would you distinguish an edge starting at the
invokestatic statement form an edge starting at the called method?
It's both the same statement isn't it?

>  My first question is a little off limits... I am just wondering... Take an
> instruction (not a method call of course) that may throw for instance
> NullPointerException. And assume that there is an application defined
> exception class that inherits from this exception type. Shouldn't the
> control flow graph have an exceptional destination for
> (NullPointerException)-(UserDefinedException)? This kind of
> analysis I can guess would take time. But I am asking nonetheless.

If your code is known to throw a NullPointerException then why should
the edge be labeled with anything else? Possible subtypes shouldtypes
should not play any role there.

>  If it is not, then I will safely(?) assume that invokestatic does not raise
> any exceptions of type  Exception or its subclasses, making my flow graph a
> little finer.

That may or may not be a valid assumption, depending on what you are
actually analyzing for.

Eric

-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list