<div dir="ltr"><div><div><div>Hi Steven,<br><br>The freemarker library actually does put all its classes in the top-level freemarker.* package so I believe that my -x usage is correct.<br></div><br></div><div>As for your first point, I have been including all of the libraries (including the JDK libraries) because my first attempts to use Soot without them failed with missing class errors; I inferred that Soot would not function properly unless I included all classes that could be potentially referenced by the program being analyzed. If I understand you correctly there is some combination of flags and classpaths that will instruct Soot to simply ignore library classes (including the JDK). If this is true, what is the behavior of, say, the IFDS solver in the presence of these ignored libraries? If an application class calls into library method foo() that has been excluded what does Soot do with that call?<br><br></div><div>With regards to the strange call resolution, that problematic call statement appears to be in a library class that I wish to exclude anyway so the problem may become moot if I can figure out the above problem. Although it may still be a bug :)<br></div><div><br></div><div>Thanks!<br></div><div>John<br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 11, 2015 at 2:04 AM, Steven Arzt <span dir="ltr">&lt;<a href="mailto:Steven.Arzt@cased.de" target="_blank">Steven.Arzt@cased.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="DE"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">Hi John,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">That’s strange, your command-line looks good to me in principle. Your exclusion is not correct, you have to provide package or class names which would probably be something like com.freemarker.*. Soot does not search for substrings here, but for packages. Another option would be not to explicitly exclude these classes, but simply not have them on the Soot classpath. In that case, they will automatically become phantom classes.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">The other question is whether you really want to prepend the JVM’s classpath to your Soot classpath using –pp if you are ok with ignoring libraries at some other place. Is there a specific reason for not excluding the JDK as well? As recommended above, I would just remove it from the Soot classpath.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">The strange call edge you are experiencing doesn’t sound right to me. Can you provide a minimal working example that provides the same kind of callgraph with similar wrong edges, but has a more manageable size for debugging?<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">Best regards,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US">  Steven<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">Von:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href="mailto:soot-list-bounces@CS.McGill.CA" target="_blank">soot-list-bounces@CS.McGill.CA</a> [mailto:<a href="mailto:soot-list-bounces@CS.McGill.CA" target="_blank">soot-list-bounces@CS.McGill.CA</a>] <b>Im Auftrag von </b>John A Toman<br><b>Gesendet:</b> Donnerstag, 11. Juni 2015 02:17<br><b>An:</b> <a href="mailto:soot-list@cs.mcgill.ca" target="_blank">soot-list@cs.mcgill.ca</a><br><b>Betreff:</b> [Soot-list] Call graphs and excluding libraries<u></u><u></u></span></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><div><div><div><div><div><div><p class="MsoNormal" style="margin-bottom:12.0pt">Hello!<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">I&#39;m trying to use Soot for an interprocedural analysis but I&#39;m having trouble getting a callgraph. I&#39;m analyzing a web application that depends on several libraries, each of which have their own dependencies. These dependencies aren&#39;t interesting to my analysis but without them I can&#39;t seem to get a reliable call-graph.<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">I&#39;m invoking Soot as follows:<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">java -cp ./soot-trunk.jar:./myanalysis -pp -soot-class-path /path/to/application/classes:/paths/to/app/library/jars -no-bodies-for-excluded -x &#39;freemarker&#39; -w -p cg.cha enabled:false -p cg.spark enabled:true,verbose:true -p wjtp.myanalysis on com.acme.DummyMain -allow-phantom-refs<u></u><u></u></p></div><div><p class="MsoNormal">where freemarker is the package name of the library I&#39;m not interested in (I exclude the freemarker.jar from the soot class path in the above invocation too)[<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">With these options Spark builds a callgraph, but the results are strange. For instance, the possible types analysis dies because (as far I as can tell) it thinks that a call to &lt;java.security.AccessController: java.lang.Object doPrivileged(java.security.PrivilegedAction)&gt;<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt">potentially resolves to &lt;org.apache.commons.logging.LogFactory$1: java.lang.Object run()&gt;.<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">Without the -no-bodies-for-excluded option Spark churns for a while until it reaches some part of the Freemarker library that relies on Jython. However, the Jython jar also has unmet dependencies which cause Spark to choke...<u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">In short: how do I configure Soot to ignore missing/uninteresting library calls with the least effort possible?<u></u><u></u></p></div><p class="MsoNormal">Thanks!<u></u><u></u></p></div></div></div></div></div></blockquote></div><br></div>