[Soot-list] Bug (and fix?) in FastHierarchy

Eric Bodden eric.bodden at ec-spride.de
Fri Feb 8 02:12:07 EST 2013


Hi Michael.

Thanks for the detailed information. I am not sure, though, if
removing the conditional would be the correct fix. In your example,
shouldn't the algorithm resolve the call to A.m()? If I just remove
the check I think it would resolve to B.m() instead, which indeed
would be wrong. So I guess instead one would have to cause it walk
further up the hierarchy, no?

Cheers,
Eric

On 8 February 2013 07:38, Michael Pradel <michael at binaervarianz.de> wrote:
> Hi,
>
> I get a RuntimeException thrown by FastHierarchy, which (I think) should
> not be thrown. The problem occurs when you have 3 classes such as
> follows (note that the packages and visibilities matter):
>
> package a;
> public class A {
>   void m() {}
> }
>
> package b;
> abstract public class B extends A {
>   abstract protected void m();
> }
>
> package c;
> public class C extends B {
>   protected void m() {}
> }
>
> When you now call FastHierarchy.resolveAbstractDispatch() for a call to
> A.m(), then the exception is thrown. The problem is that FastHierarchy
> goes down in the hierarchy to C, realizes that m() is not visible here,
> goes up to B again, where it throws the exception because it assumes
> that the method cannot be abstract.
> (See below for code triggering the exception.)
>
> Isn't the check in lines 453-454 of FastHierarchy too strict and should
> be removed?
>
> Best regards,
> Michael
>
>
> Code to trigger the exception (Scala, but you'll get the idea):
>
> val cls = Scene.v.getSootClass("a.A")
> val m = cls.getMethodByName("m")
> val hierarchy = Scene.v.getOrMakeFastHierarchy
> hierarchy.resolveAbstractDispatch(m.getDeclaringClass, m)
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>



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


More information about the Soot-list mailing list