[Soot-list] Points-to Analysis for a multi-threaded program.

Moulik moulik_psg at yahoo.com
Wed Jun 8 12:27:18 EDT 2011


Hi,

I have been trying to run a points-to analysis on a simple multi-threaded Java program. The problem I am seeing is that after the Spark analysis is performed, the run() method remains un-analyzed (i.e. the points-to set of the variables inside the run() method are empty).

I tried to look into the Spark code and it seems like, when a call to the start() is encountered, an edge is created to the Thread.run() and not the run() method of the class that the user has implemented.


Below is the sample program I am trying to analyze;

class AliasClass{
    public int [][]twoDArray;
    public AliasClass() {}
}


class MyThread implements Runnable{
    public AliasClass sharedObj;

    public MyThread(AliasClass paramObj) {
    sharedObj = paramObj;
    }


     // This run() method remains un-analyzed.
    public void run() {
    int [][]auxArr = sharedObj.twoDArray;
    int []arr;
    int j=0;

    for(j=0; j<10; ++j) {
        arr = new int[10];
        auxArr[j] = arr;
    }
    }
}

public class TestAlias {

    public static void main(String[] args) {

    AliasClass obj = new AliasClass();
    obj.twoDArray = new int[10][10]; // Allocate shared memory
    Runnable myThread_obj1 = new MyThread(obj);
    Runnable myThread_obj2 = new MyThread(obj);

    // Both threads will access the same shared object of the AliasClass.
    Thread t_1 = new Thread(myThread_obj1);
    Thread t_2 = new Thread(myThread_obj2);
    t_1.start();
    t_2.start();
    }
}

I am new to Soot and am not sure if I am missing something ?

Thanks and Regards,
Moulik S.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20110608/a7ccd61e/attachment.html 


More information about the Soot-list mailing list