[Soot-list] Fwd: Support for Thread.start()

salim bansal salim.bansal at gmail.com
Mon Feb 11 16:14:15 EST 2013


Thanks a lot for reply Eric.
Yes I don't have these edges in my call graph.
My understanding is(please correct me if I am wrong)
edges are getting added in "private void findReceivers(SootMethod m, Body
b)" method of
OnFlyCallGraphBuilder.java. There is an "if" statement which checks if
method signature is "void start()" and
if it is then add a call to run() method of the receiver class. I think
which is perfectly fine for threads that are
created by extending the thread class and overriding the run() method but
would not work(wrong?) if the thread is created by passing a Runnable to
Thread constructor as the run() method is inside the argument class that
implements Runnable.
The code that I am trying to analyze looks like this

Thread p_thread ; //Class variable

...
...
...

void method1(){

p_thread = new Thread(new Worker());

}

void method2(){

p_thread.start()

}

...
...

Worker implements Runnable{

public void run(){

...
...

}

}

now I need the call "p_thread.start()" to get "directed" to Worker.run()
method but with the above mentioned settings this is not working.


Thanks
Salim

On Mon, Feb 11, 2013 at 3:53 AM, Eric Bodden <eric.bodden at ec-spride.de>wrote:

> Hi Salim.
>
> Are you saying your call graph is missing those edges? Normally they
> should just be there....
>
> Eric
>
> On 10 February 2013 23:34, salim bansal <salim.bansal at gmail.com> wrote:
> > Hi,
> >
> > I am trying to build call graph with spark and cs-demand set to true.
> > When a statement such as following:
> >          Thread t = new Thread (new Worker());
> >
> > ...
> > ...
> > t.start()
> >
> > is encountered.
> > I need  the call graph to have edge from t.start() to run method of
> Worker
> > class, assuming Worker class implements Runnable.
> > How can I get this working I am using Soot 2.3.0.
> > My soot options  are
> >         opt.put("enabled","true");
> >         opt.put("verbose","true");
> >         opt.put("propagator","worklist");
> >         opt.put("set-impl","double");
> >         opt.put("double-set-old","hybrid");
> >         opt.put("double-set-new","hybrid");
> >         opt.put("cs-demand","true");
> >         opt.put("on-fly-cg","true");
> >         opt.put("ignore-types","false");
> >         opt.put("passes","10");
> >
> > Thanks
> > Salim
> >
> >
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130211/c60cfccd/attachment.html 


More information about the Soot-list mailing list