<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div class="gmail_default">Thanks for the suggestion, Dacong. So I rephrase it here :</div><div class="gmail_default"><br></div><div class="gmail_default"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px"><b>* Test input:</b></span></div><div class="gmail_default"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px">Android app: my_test.apk </span></div><div class="gmail_default"><br style="font-family:arial,sans-serif;font-size:12.8000001907349px"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px"><b>* Here&#39;s the command I executed (the soot configuration is the same with flowDroid):</b></span></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">java -cp $JAVA_CLASSPATH path_to_my_test_class</font><br></div><div class="gmail_default"><br style="font-family:arial,sans-serif;font-size:12.8000001907349px"><b><span style="font-family:arial,sans-serif;font-size:12.8000001907349px">* I expect the results of getUnits() to be:</span><br></b></div><div class="gmail_default"><span class="im"><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><font face="monospace, monospace">r0 := @this: edu.ucsd.mytest.BasicActivity;</font></div><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><font face="monospace, monospace">$r1 := @parameter0: android.os.Bundle;</font></div><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><font face="monospace, monospace">specialinvoke $r0.&lt;android.support.v7.app.ActionBarActivity: void onCreate(android.os.Bundle)&gt;($r1);</font></div><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><font face="monospace, monospace" color="#ff0000">$r2 = new com.turbomanage.httpclient.BasicHttpClient;<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">​ </div></font></div></span><span class="im"><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><font face="monospace, monospace">specialinvoke $r2.&lt;com.turbomanage.httpclient.BasicHttpClient: void &lt;init&gt;()&gt;();</font></div><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><font face="monospace, monospace">virtualinvoke $r2.&lt;com.turbomanage.httpclient.BasicHttpClient: com.turbomanage.httpclient.HttpResponse get(java.lang.String,com.turbomanage.httpclient.ParameterMap)&gt;(&quot;<a href="http://www.google.com/" target="_blank">http://www.google.com</a>&quot;, null);</font></div><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><font face="monospace, monospace">return;</font></div></span></div><div class="gmail_default"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px"><br></span></div><div class="gmail_default"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px"><b>* But the results of getUnits() is (lack the statement marked in red): </b></span></div><div class="gmail_default"><span class="im"><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><font face="monospace, monospace">r0 := @this: edu.ucsd.mytest.BasicActivity;</font></div><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><font face="monospace, monospace">$r1 := @parameter0: android.os.Bundle;</font></div><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><font face="monospace, monospace">specialinvoke $r0.&lt;android.support.v7.app.ActionBarActivity: void onCreate(android.os.Bundle)&gt;($r1);</font></div></span><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><span style="font-family:monospace,monospace;font-size:12.8000001907349px">specialinvoke $r2.&lt;com.turbomanage.</span><span style="font-family:monospace,monospace;font-size:12.8000001907349px">httpclient.BasicHttpClient: void &lt;init&gt;()&gt;();</span><br></div><span class="im"><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><font face="monospace, monospace">virtualinvoke $r2.&lt;com.turbomanage.httpclient.BasicHttpClient: com.turbomanage.httpclient.HttpResponse get(java.lang.String,com.turbomanage.httpclient.ParameterMap)&gt;(&quot;<a href="http://www.google.com/" target="_blank">http://www.google.com</a>&quot;, null);</font></div><div style="font-family:arial,sans-serif;font-size:12.8000001907349px"><font face="monospace, monospace">return;</font></div><div><font face="monospace, monospace"><br></font></div></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 8, 2015 at 10:26 AM, Dacong Yan <span dir="ltr">&lt;<a href="mailto:tonywinslow1986@gmail.com" target="_blank">tonywinslow1986@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">To help better diagnose the problem, could you rephrase the bug<br>
reproduction description into something like:<br>
  * Here&#39;s the input (maybe an apk file?)<br>
  * Here&#39;s the command I executed: java soot.Main -my -flags ...<br>
  * I expect the results of getUnits() to be &quot;...&quot;, but it actually is &quot;...&quot;<br>
<br>
With concrete input, output and command, everybody can look at the<br>
same thing and discuss.<br>
<div><div class="h5"><br>
On Wed, Apr 8, 2015 at 10:10 AM, Xinxin Jin &lt;<a href="mailto:xinxinjin89@gmail.com">xinxinjin89@gmail.com</a>&gt; wrote:<br>
&gt; Thank you for the explanation !  But the problem still remains ... To make<br>
&gt; it concrete, I put the whole analysis of the problematic method in the<br>
&gt; following:<br>
&gt;<br>
&gt; (a). Source code :<br>
&gt;  protected void onCreate(Bundle savedInstanceState) {<br>
&gt;         super.onCreate(savedInstanceState);<br>
&gt;        BasicHttpClient basicClient = new BasicHttpClient();<br>
&gt;         HttpResponse response = basicClient.get(&quot;<a href="http://www.google.com" target="_blank">http://www.google.com</a>&quot;,<br>
&gt; null);<br>
&gt; }<br>
&gt;<br>
&gt; (b). Jimple of method onCreate() :<br>
&gt;  protected void onCreate(android.os.Bundle)<br>
&gt;     {<br>
&gt;         edu.ucsd.mytest.BasicActivity $r0;<br>
&gt;         android.os.Bundle $r1;<br>
&gt;         com.turbomanage.httpclient.BasicHttpClient $r2;<br>
&gt;         $r0 := @this: edu.ucsd.mytest.BasicActivity;<br>
&gt;         $r1 := @parameter0: android.os.Bundle;<br>
&gt;<br>
&gt;         specialinvoke $r0.&lt;android.support.v7.app.ActionBarActivity: void<br>
&gt; onCreate(android.os.Bundle)&gt;($r1);<br>
&gt;         $r2 = new com.turbomanage.httpclient.BasicHttpClient;<br>
&gt; // Do not appear in getUnits()<br>
&gt;         specialinvoke $r2.&lt;com.turbomanage.httpclient.BasicHttpClient: void<br>
&gt; &lt;init&gt;()&gt;();<br>
&gt;         virtualinvoke $r2.&lt;com.turbomanage.httpclient.BasicHttpClient:<br>
&gt; com.turbomanage.httpclient.HttpResponse<br>
&gt; get(java.lang.String,com.turbomanage.httpclient.ParameterMap)&gt;(&quot;<a href="http://www.google.com" target="_blank">http://www.google.com</a>&quot;,<br>
&gt; null);<br>
&gt;         return;<br>
&gt;     }<br>
&gt;<br>
&gt; (c). Output of m.retrieveActiveBody().getUnits():<br>
&gt; $r0 := @this: edu.ucsd.mytest.BasicActivity<br>
&gt; $r1 := @parameter0: android.os.Bundle<br>
&gt; specialinvoke $r0.&lt;android.support.v7.app.ActionBarActivity: void<br>
&gt; onCreate(android.os.Bundle)&gt;($r1)<br>
&gt; specialinvoke $r2.&lt;com.turbomanage.httpclient.BasicHttpClient: void<br>
&gt; &lt;init&gt;()&gt;() //No def on $r2!<br>
&gt; virtualinvoke $r2.&lt;com.turbomanage.httpclient.BasicHttpClient:<br>
&gt; com.turbomanage.httpclient.HttpResponse<br>
&gt; get(java.lang.String,com.turbomanage.httpclient.ParameterMap)&gt;(&quot;<a href="http://www.google.com" target="_blank">http://www.google.com</a>&quot;,<br>
&gt; null)<br>
&gt; return<br>
&gt;<br>
&gt;<br>
&gt; So you can see the statement &quot;$r2 = new<br>
&gt; com.turbomanage.httpclient.BasicHttpClient&quot; does not appear in the output of<br>
&gt; getUnits().<br>
&gt; Particularly, the statement marked in blue refers to the local $r2, however,<br>
&gt; there is no def on $r2 in getUnits() !<br>
&gt;<br>
&gt; Any suggestion is appreciated !<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Apr 8, 2015 at 1:00 AM, Steven Arzt &lt;<a href="mailto:Steven.Arzt@cased.de">Steven.Arzt@cased.de</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi Xinxin,<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Then I have to agree with Eric that such a behavior is completely<br>
&gt;&gt; impossible: Soot reads in the APK file, and stores the unit in the units<br>
&gt;&gt; collections of the respective SootMethods. This is also the only source from<br>
&gt;&gt; which the units are then written out to Jimples files. If the Jimple files<br>
&gt;&gt; on disk are complete, the unit collections must have been as well. The<br>
&gt;&gt; output writer does not inference any new units.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Best regards,<br>
&gt;&gt;<br>
&gt;&gt;   Steven<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Von: Xinxin Jin [mailto:<a href="mailto:xinxinjin89@gmail.com">xinxinjin89@gmail.com</a>]<br>
&gt;&gt; Gesendet: Mittwoch, 8. April 2015 09:57<br>
&gt;&gt; An: Steven Arzt<br>
&gt;&gt; Cc: Bodden, Eric; <a href="mailto:soot-list@cs.mcgill.ca">soot-list@cs.mcgill.ca</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Betreff: Re: [Soot-list] Soot Body.getUnits() does not get ALL units<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hi Steven,<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; My code is from an Android app. I use Dexpler to transform the apk to<br>
&gt;&gt; jimple files.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Apr 8, 2015 at 12:54 AM, Steven Arzt &lt;<a href="mailto:Steven.Arzt@cased.de">Steven.Arzt@cased.de</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi Xinxin,<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Can you provide a complete test case? From where did you read in your<br>
&gt;&gt; Jimple code?  Did you parse jimple files on disk or Java class files, or an<br>
&gt;&gt; Android APK?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Best regards,<br>
&gt;&gt;<br>
&gt;&gt;   Steven<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Von: <a href="mailto:soot-list-bounces@CS.McGill.CA">soot-list-bounces@CS.McGill.CA</a><br>
&gt;&gt; [mailto:<a href="mailto:soot-list-bounces@CS.McGill.CA">soot-list-bounces@CS.McGill.CA</a>] Im Auftrag von Xinxin Jin<br>
&gt;&gt; Gesendet: Mittwoch, 8. April 2015 09:07<br>
&gt;&gt; An: Bodden, Eric<br>
&gt;&gt; Cc: <a href="mailto:soot-list@cs.mcgill.ca">soot-list@cs.mcgill.ca</a><br>
&gt;&gt; Betreff: Re: [Soot-list] Soot Body.getUnits() does not get ALL units<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; It sounds unreasonable to me too, but that is indeed the problem I<br>
&gt;&gt; encountered ... So I&#39;m just wondering if there are some corner cases not<br>
&gt;&gt; handled by Soot or not ?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Apr 7, 2015 at 11:40 PM, Bodden, Eric<br>
&gt;&gt; &lt;<a href="mailto:eric.bodden@sit.fraunhofer.de">eric.bodden@sit.fraunhofer.de</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi Xinxin.<br>
&gt;&gt;<br>
&gt;&gt; I am afraid that does not make much sense. By definition, the units of a<br>
&gt;&gt; body are the ones returned by getUnits(). This is a very strong invariant<br>
&gt;&gt; that should never be broken by Soot.<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; Eric<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; On 08.04.2015, at 08:02, Xinxin Jin &lt;<a href="mailto:xinxinjin89@gmail.com">xinxinjin89@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Hi there,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I got a weird problem: Sometimes Body.getUnits() does not list all the<br>
&gt;&gt; &gt; units of a method. The following is one example:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Simplified code snippet:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; void foo() {<br>
&gt;&gt; &gt;     ...<br>
&gt;&gt; &gt;     BasicHttpClient basicClient = new BasicHttpClient();<br>
&gt;&gt; &gt;     ...<br>
&gt;&gt; &gt; }<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; And in the Jimple file, there are two statements related with &quot;new<br>
&gt;&gt; &gt; BasicHttpClient()&quot; :<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; $r5 = new com.turbomanage.httpclient.BasicHttpClient;<br>
&gt;&gt; &gt; specialinvoke $r5.&lt;com.turbomanage.httpclient.BasicHttpClient: void<br>
&gt;&gt; &gt; &lt;init&gt;()&gt;();<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; However, when I use retriveActiveBody().getUnits() to print out all the<br>
&gt;&gt; &gt; units of foo(), I can only see one statement:<br>
&gt;&gt; &gt; specialinvoke $r5.&lt;com.turbomanage.httpclient.BasicHttpClient: void<br>
&gt;&gt; &gt; &lt;init&gt;()&gt;()<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I don&#39;t know why getUnits() cannot obtain &quot;$r5 = new<br>
&gt;&gt; &gt; com.turbomanage.httpclient.BasicHttpClient&quot; ?<br>
&gt;&gt; &gt; What kind of units are ignored by Soot ?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks a lot for any advices !<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; Xinxin<br>
&gt;&gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; Soot-list mailing list<br>
&gt;&gt; &gt; <a href="mailto:Soot-list@CS.McGill.CA">Soot-list@CS.McGill.CA</a><br>
&gt;&gt; &gt; <a href="https://mailman.CS.McGill.CA/mailman/listinfo/soot-list" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; 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>
&gt;&gt; Head of Secure Software Engineering at Fraunhofer SIT, TU Darmstadt and EC<br>
&gt;&gt; SPRIDE<br>
&gt;&gt; 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>
&gt;&gt; Room B5.11, Fraunhofer SIT, Rheinstraße 75, 64295 Darmstadt<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt;<br>
&gt;&gt; Xinxin<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt;<br>
&gt;&gt; Xinxin<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Xinxin<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Soot-list mailing list<br>
&gt; <a href="mailto:Soot-list@CS.McGill.CA">Soot-list@CS.McGill.CA</a><br>
&gt; <a href="https://mailman.CS.McGill.CA/mailman/listinfo/soot-list" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><br>
&gt;<br>
<br>
<br>
<br>
--<br>
</div></div>Dacong (Tony) Yan | Software Engineer | Google Inc.<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><font face="arial, helvetica, sans-serif">Xinxin</font></div>
</div>