[Soot-list] Soot bug?

Eric Bodden eric.bodden at mail.mcgill.ca
Sat Jun 2 14:44:21 EDT 2007


Hi. Thanks for reporting this. I looked into the problem but it seems
to be really subtle. Actually I think it is a problem with javac.

I have attached three files,all of which are outputs of javap.
"eclipse" shows the inner class file, as generated by eclipse. Nothing
extraordinary here. It looks fine and Soot can process it.

javac however generates, for no apparent reason an anonymous inner
class SootProblem$1. This is passed to the constructor of the inner
class as additional argument. I assume that it's meant to be a closure
to make values of the outer class available. However, this class is
never generated! In the constructor call, this parameter is simply set
to null. Still, I don't understand how the class loader can possibly
accept this as valid bytecode. The type SootProblem$1 definitely seems
to be missing from the bytecode. I find that really odd. Does anybody
have any idea?

Eric

On 01/06/07, Mark Friedman <mark.friedman at gmail.com> wrote:
> I think I've found a bug in Soot.  I've isolated it to the following Java
> program (the original class was much more complex):
>
> public class SootProblem {
>     public SootProblem()
>     {
>         if (false) {
>             Runnable myRunnable =
>                     new Runnable() {
>                         public void run() {}
>                     };
>         }
>         new SootProblemInner();
>     }
>
>     private class SootProblemInner {
>         int foo;
>     }
> }
>
> Here is the output of compiling the above file and then running Soot:
>
> $ javac SootProblem.java
> $ ls -l SootProblem*.*
> -rw-r----- 1 markf eng  483 Jun  1 16:30
> SootProblem$SootProblemInner.class
> -rw-r----- 1 markf eng  372 Jun  1 16:30 SootProblem.class
> -rw-r----- 1 markf eng  329 Jun  1 16:29 SootProblem.java
> $ java -classpath
> /home/markf/soot/soot-2708/classes:/home/markf/soot/polyglot-1.3.4/classes:/home/markf/soot/polyglot-1.3.4/cup-classes:/home/markf/soot/jasmin-2708/classes
> soot.Main -cp /usr/local/java-latest/jre/lib/rt.jar:.
> -src-prec only-class -O SootProblem
> Soot started on Fri Jun 01 16:31:14 PDT 2007
> Exception in thread "main" java.lang.RuntimeException: couldn't find class:
> SootProblem$1 (is your soot-class-path set properly?)
>     at soot.SootResolver.bringToHierarchy
> (SootResolver.java:139)
>     at
> soot.SootResolver.bringToSignatures(SootResolver.java:172)
>     at
> soot.SootResolver.processResolveWorklist(SootResolver.java:104)
>     at soot.SootResolver.resolveClass(SootResolver.java :89)
>     at soot.Scene.loadClass(Scene.java:336)
>     at soot.Scene.loadClassAndSupport(Scene.java:322)
>     at soot.Scene.loadNecessaryClass(Scene.java:868)
>     at soot.Scene.loadNecessaryClasses(Scene.java:887)
>     at soot.Main.run(Main.java:170)
>     at soot.Main.main(Main.java:146)
>
>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eclipse
Type: application/octet-stream
Size: 1844 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20070602/31710501/eclipse.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SootProblem-javac
Type: application/octet-stream
Size: 2029 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20070602/31710501/SootProblem-javac.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SootProblem$SootProblemInner-javac
Type: application/octet-stream
Size: 2058 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20070602/31710501/SootProblemSootProblemInner-javac.obj


More information about the Soot-list mailing list