<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Danilo,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Please provide your full Soot command-line. We need to know which options you have used.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> Steven<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> soot-list-bounces@CS.McGill.CA [mailto:soot-list-bounces@CS.McGill.CA] <b>Im Auftrag von </b>Danilo Arcidiacono<br><b>Gesendet:</b> Montag, 4. Mai 2015 19:37<br><b>An:</b> soot-list@CS.McGill.CA<br><b>Betreff:</b> [Soot-list] Call graph building error when using averroes (soot.AbstractSootFieldRef$FieldResolutionFailedException: Class java.lang.System doesn't have field err)<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div id="yui_3_16_0_1_1430760840507_8384"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'>Hi,<br>I'm trying to compute the call graph of a simple application, with the aid of averroes and SPARK (I'm using the JDK 7 Update 79 on Windows 64-bit).<br>My input application consists of two jars:<br> - TracingTest.jar<br> - Annotations.jar, referred by TracingTest.jar<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8406"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8389"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'>I've managed to run averroes which generates the usual jars (organizedApplication / organizedLibrary / placeholderLibrary).<br>However, when I try to compute the call graph with SPARK, an exception is thrown:<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8429"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8390"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'> No main class given. Inferred 'Main' as main class.<br> [Call Graph] For information on where the call graph may be incomplete, use the verbose option to the cg phase.<br> Exception in thread "main" soot.AbstractSootFieldRef$FieldResolutionFailedException: Class java.lang.System doesn't have field err : java.io.PrintStream; failed to resolve in superclasses and interfacesLooking in java.lang.System which has fields [<java.lang.System: java.io.PrintStream out>]<br> Looking in java.lang.Object which has fields []<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8391"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'> at soot.AbstractSootFieldRef.resolve(AbstractSootFieldRef.java:116)<br> at soot.AbstractSootFieldRef.resolve(AbstractSootFieldRef.java:75)<br> <br> [... snip ...]<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8458"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8392"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'> at soot.jimple.spark.SparkTransformer.internalTransform(SparkTransformer.java:84)<br> at soot.SceneTransformer.transform(SceneTransformer.java:39)<br> at main.main(main.java:62)<br> Picked up _JAVA_OPTIONS: -Xmx1200m -Xms256m<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8420"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8393"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'>I use the following code to invoke SPARK:<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8421"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8394"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'> import java.io.File;<br> import java.io.FileNotFoundException;<br> import java.util.HashMap;<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8383"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'> import soot.G;<br> import soot.Scene;<br> import soot.SootClass;<br> import soot.jimple.spark.SparkTransformer;<br> import soot.jimple.toolkits.callgraph.CallGraph;<br> import soot.options.Options;<br> <br> public class main <br> {<br> public static void configure(String classpath) <br> {<br> Options.v().set_verbose(false);<br> Options.v().set_keep_line_number(true);<br> Options.v().set_src_prec(Options.src_prec_only_class);<br> Options.v().set_soot_classpath(classpath);<br> Options.v().set_prepend_classpath(true);<br> Options.v().set_allow_phantom_refs(true); <br> Options.v().set_whole_program(true);<br> }<br> <br> public static void main(String[] args) throws FileNotFoundException <br> {<br> G.reset();<br> <br> // code copied from Scene.getDefaultClasspath<br> StringBuffer sb = new StringBuffer(); <br> sb.append("D:\\averroes\\TracingTest\\output\\organizedApplication.jar");<br> sb.append(File.pathSeparator);<br> sb.append("D:\\averroes\\TracingTest\\output\\placeholderLibrary.jar");<o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'> configure(sb.toString());<br> <br> // Do not load standard JRE classes<br> // Scene.v().loadBasicClasses();<o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'> SootClass sootClass = Scene.v().forceResolve("Main", SootClass.BODIES);<br> sootClass.setApplicationClass();<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8407"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'> // Do not load standard JRE classes<br> // Scene.v().loadNecessaryClasses();<br> <br> // CHA<br> //CHATransformer.v().transform();<br> <br> // SPARK<br> HashMap<String, String> opt = new HashMap<String, String>(); <br> opt.put("enabled", "true");<br> opt.put("verbose", "true");<br> opt.put("propagator", "worklist");<br> opt.put("simple-edges-bidirectional", "false");<br> opt.put("on-fly-cg", "true");<br> opt.put("set-impl", "double");<br> opt.put("double-set-old", "hybrid");<br> opt.put("double-set-new", "hybrid");<br> opt.put("whole-program", "true");<br> <br> SparkTransformer.v().transform("", opt);<br> <br> CallGraph g = Scene.v().getCallGraph();<br> }<br> }<br>}<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8408"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8409"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'>The System.class file generated by averroes does not contain the System.err field indeed:<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8410"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8411"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'> /* compiled from Jasmin */<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8412"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'> public final static java.io.PrintStream out;<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8413"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'> public System() <br> {<br> 0 aload_0;<br> 1 invokespecial 19; /* java.lang.Object() */<br> 4 aload_0;<br> 5 putstatic 26; /* ca.uwaterloo.averroes.Library.libraryPointsTo */<br> 8 invokestatic 13; /* void ca.uwaterloo.averroes.Library.doItAll() */<br> 11 return;<br> }<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8414"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8419"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'>Is this a bug of averroes? If I don't use it and let SPARK analyze the real Java Runtime Library, I get no errors.<br>Here's a link to an archive containing all the relevant files:<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8457"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'><br> <a href="https://drive.google.com/file/d/0B1gS1nNBmRjaVTRhVWV4TE93NjQ" id="yui_3_16_0_1_1430760840507_8416">https://drive.google.com/file/d/0B1gS1nNBmRjaVTRhVWV4TE93NjQ</a><o:p></o:p></span></p></div><div id="yui_3_16_0_1_1430760840507_8452"><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:7.5pt;font-family:"Helvetica","sans-serif";color:black'>Thanks<o:p></o:p></span></p></div></div></div></body></html>