<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thank you very much, Eric. I will check paddle. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 12, 2015 at 2:37 AM, Bodden, Eric <span dir="ltr"><<a href="mailto:eric.bodden@sit.fraunhofer.de" target="_blank">eric.bodden@sit.fraunhofer.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Xinxin.<br>
<br>
The problem is that InterproceduralCFG, by default, is based on a context-insensitive call graph. Thus call edges get merged by callee, and different calling contexts are not distinguished.<br>
<br>
To handle the problem you explained, one would need a call graph, that is 1-context-sensitive at least for the call to Thread.start.<br>
<br>
The way I see it, currently Soot does not support an easy workaround for this. One possibility is to create a general 1-context-sensitive or 1-object-sensitive call graph using paddle, and subclass InterproceduralCFG to use that kind of call graph. (<a href="http://www.sable.mcgill.ca/paddle/" target="_blank">http://www.sable.mcgill.ca/paddle/</a>)<br>
<br>
Ideally, I guess, we would like to have some special treatment of calls for Thread.start(). If anyone would volunteer to contribute such a patch then I would be happy to incorporate it.<br>
<br>
Cheers,<br>
Eric<br>
<div><div class="h5"><br>
> On 12.02.2015, at 05:40, Xinxin Jin <<a href="mailto:xinxin@cs.ucsd.edu">xinxin@cs.ucsd.edu</a>> wrote:<br>
><br>
> Hi all,<br>
><br>
> I have a problem in tracing a runnable object's caller method. To make it clear, I simplified my code as follows:<br>
><br>
> public class A {<br>
> public void Foo () {<br>
> Thread t = new Thread(new MyFirstHandler());<br>
> }<br>
><br>
> private class MyFirstHandler implements Runnable {<br>
> @Override<br>
> public void run() {<br>
> CreateFile();<br>
> }<br>
> }<br>
> }<br>
><br>
> public class B {<br>
> public void Bar () {<br>
> Thread t = new Thread(new MySecondHandler());<br>
> }<br>
> ....<br>
> }<br>
><br>
> My problem is : Given method CreateFile(), I want to trace back to get its caller method. Ideally I should get "A.Foo()".<br>
><br>
> My algorithm is to use InterproceduralCFG.getCallersOf() provided by heros, starting from createFile() and tracing backwards level by level:<br>
> (1) Get <java.lang.Thread: void run()> as the only caller of CreateFile()<br>
> (2) Continue to get the callers of <java.lang.Thread: void run()>.<br>
> Now you may guess what happens: Because both A.Foo() and B.Bar() call <java.lang.Thread: void run()>, I get A.Foo() and B.Bar() as createFile()'s caller methods.<br>
><br>
> So my question is how to remove B.Bar() from my results ?<br>
><br>
> Thanks a lot !<br>
><br>
><br>
> --<br>
> Xinxin Jin<br>
> Ph.D. student, Computer Science<br>
> University of California, San Diego<br>
> <a href="http://cseweb.ucsd.edu/~x7jin/" target="_blank">http://cseweb.ucsd.edu/~x7jin/</a><br>
><br>
</div></div>> _______________________________________________<br>
> Soot-list mailing list<br>
> <a href="mailto:Soot-list@CS.McGill.CA">Soot-list@CS.McGill.CA</a><br>
> <a href="https://mailman.CS.McGill.CA/mailman/listinfo/soot-list" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><br>
<br>
--<br>
Prof. Eric Bodden, Ph.D., <a href="http://sse.ec-spride.de/" target="_blank">http://sse.ec-spride.de/</a> <a href="http://bodden.de/" target="_blank">http://bodden.de/</a><br>
Head of Secure Software Engineering at Fraunhofer SIT, TU Darmstadt and EC SPRIDE<br>
Tel: <a href="tel:%2B49%206151%2016-75422" value="+4961511675422">+49 6151 16-75422</a> Fax: <a href="tel:%2B49%206151%20869-127" value="+496151869127">+49 6151 869-127</a><br>
Room B5.11, Fraunhofer SIT, Rheinstraße 75, 64295 Darmstadt<br>
<br>
<br>_______________________________________________<br>
Soot-list mailing list<br>
<a href="mailto:Soot-list@CS.McGill.CA">Soot-list@CS.McGill.CA</a><br>
<a href="https://mailman.CS.McGill.CA/mailman/listinfo/soot-list" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><font face="georgia, serif">Xinxin Jin </font><div><div><font face="georgia, serif">Ph.D. student, Computer Science<br></font><div><font face="georgia, serif">University of California, San Diego</font></div><div><font face="georgia, serif"><a href="http://cseweb.ucsd.edu/~x7jin/" target="_blank">http://cseweb.ucsd.edu/~x7jin/</a></font><br></div><div><br></div></div></div></div></div>
</div>