[Soot-list] Re: A possible bug of Jimple generation in Soot

Ondrej Lhotak olhotak at sable.mcgill.ca
Tue Nov 16 10:16:58 EST 2004


Hi Bin,

Thanks for the detailed report.

It is a known limitation of the use-original-names option that it
generates code that is not exactly like Jimple. In particular, it
does not always have the property that values have been split along
DU-UD webs, as in Jimple. Therefore, this option may make analyses,
including alias analysis, less precise. This is the main reason why
this option is not on by default.

In some cases, it is not possible to split along DU-UD webs and keep the
original names, because the original assignment of names to values is
not along DU-UD webs. However, in this case, the relevant local is
a stack local, so it seems it shouldn't have a name, so I don't see why
Soot does not split it.

I've cc'ed this message to the Soot mailing list. Perhaps someone there
knows more about the use-original-names option and can explain this.

The place to report problems such as this is the
Soot mailing list. Note that you must be subscribed to the list in order
to post to it. You can subscribe to the list at:
http://www.sable.mcgill.ca/mailman/listinfo/soot-list

In general, we are no longer using the bug tracker because of system
administration issues. To the Soot people reading this: we do now
have a Bugzilla set up at https://svn.sable.mcgill.ca/bugzilla, which
should solve the issues with the old system. Should we start using and
advertising it?

Ondrej

On Mon, Nov 15, 2004 at 10:23:05PM -0500, Bin Zhao wrote:
>    Hi Ondrej,
>    
>        I am Bin Zhao, a first-year graduate student in Computer Science
>    Department in University of Maryland. Currently I am using Soot 2.1.0 to
>    perform alias analysis for my course project. However, I found there could
>    be possibly a bug in the generated Jimple and caused an incorrect analysis
>    of alias. I tried to report the bug via the "Soot Bug Tracking" link on
>    the Soot Homepage. However the link didn't work any longer. I have read
>    your master thesis and know you are the author of Spark. Therefore I am
>    sending this email to you and you can forward to the appropriate person.
>    
>        The simple Java program is as the following:
>    
>    import java.util.*;
>    
>    public class ExampleA{
>    
>      public static void main(String[] args){
>        List l1 = new ArrayList();
>        List l2 = new LinkedList();
>        l2 = new ArrayList();
>      }
>    }
>    
>        We set the use-original-names to true and the generated jimple file is
>    as the following;
>    
>    public class ExampleA extends java.lang.Object
>    {
>    
>        public void <init>()
>        {
>            ExampleA l0;
>    
>            l0 := @this: ExampleA;
>            specialinvoke l0.<java.lang.Object: void <init>()>();
>            return;
>        }
>    
>        public static void main(java.lang.String[])
>        {
>            java.lang.String[] l0;
>            java.util.ArrayList $r0, l1, l2;
>            java.util.LinkedList l2, $r2;
>    
>            l0 := @parameter0: java.lang.String[];
>            $r0 = new java.util.ArrayList;
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>            specialinvoke $r0.<java.util.ArrayList: void <init>()>();
>            l1 = $r0;
>            ^^^^^^^^^
>            $r2 = new java.util.LinkedList;
>            specialinvoke $r2.<java.util.LinkedList: void <init>()>();
>            l2 = $r2;
>            $r0 = new java.util.ArrayList;
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>            specialinvoke $r0.<java.util.ArrayList: void <init>()>();
>            l2 = $r0;
>            ^^^^^^^^^^
>            return;
>        }
>    }
>        You can notice that the generated jimple file uses the same stack
>    variable $r0 for both the ArrayList allocations for l1 and l2. And $r0 is
>    assigned to both l1 and l2. When we perform alias analysis, it says that
>    after "l2 = new ArrayList()", l1 and l2 has non-empty intersection of
>    points-to set.
>    
>    thanks,
>    Bin






More information about the Soot-list mailing list