<div dir="ltr">Hi Steven, <div><br></div><div>I run my own Transformer on hadoop, there is<span class="sew4h60jf41sofd"></span><span class="sew1trmw1md5oj"></span> indeed a body in a method, but I cannot get its body. </div><div><br></div><div>I have tried the retrieveActiveBody(), but there is a RuntimeException:</div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span style="text-decoration:underline;color:#0433ff">java.lang.RuntimeException</span>: No method source set for method <org.apache.hadoop.io.RawComparator: int compare(byte[],int,int,byte[],int,int)></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at soot.SootMethod.getBodyFromMethodSource(<span style="text-decoration:underline;color:#0433ff">SootMethod.java:123</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at soot.SootMethod.retrieveActiveBody(<span style="text-decoration:underline;color:#0433ff">SootMethod.java:385</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at com.sep.MyTransformer.analyzeSootMethod(<span style="text-decoration:underline;color:#0433ff">MyTransformer.java:120</span>)<span class="sew4h60jf41sofd"></span><span class="sew1trmw1md5oj"></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)">        at com.sep.MyTransformer.analyzeSootClass(<span style="text-decoration:underline;color:rgb(4,51,255)">MyTransformer.java:113</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at com.sep.MyTransformer.internalTransform(<span style="text-decoration:underline;color:#0433ff">MyTransformer.java:60</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at soot.SceneTransformer.transform(<span style="text-decoration:underline;color:#0433ff">SceneTransformer.java:39</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at soot.Transform.apply(<span style="text-decoration:underline;color:#0433ff">Transform.java:90</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at soot.ScenePack.internalApply(<span style="text-decoration:underline;color:#0433ff">ScenePack.java:40</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at soot.Pack.apply(<span style="text-decoration:underline;color:#0433ff">Pack.java:118</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at soot.PackManager.runWholeProgramPacks(<span style="text-decoration:underline;color:#0433ff">PackManager.java:565</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at soot.PackManager.runPacksNormally(<span style="text-decoration:underline;color:#0433ff">PackManager.java:455</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at soot.PackManager.runPacks(<span style="text-decoration:underline;color:#0433ff">PackManager.java:384</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at soot.Main.run(<span style="text-decoration:underline;color:#0433ff">Main.java:278</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at soot.Main.main(<span style="text-decoration:underline;color:#0433ff">Main.java:147</span>)</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><span class="Apple-tab-span" style="white-space:pre">  </span>at com.sep.Sample.main(<span style="text-decoration:underline;color:#0433ff">VarLocation.java:47</span>)<span class="sew4h60jf41sofd"></span><span class="sew1trmw1md5oj"></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)">        ...</p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><br></p>What should I do in such situation?<p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><br></p><div style="font-size:14px">Best regards,</div><div style="font-size:14px">Sep<span class="sew4h60jf41sofd"></span><span class="sew1trmw1md5oj"></span></div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Monaco;color:rgb(255,38,0)"><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-01-19 18:33 GMT+08:00 Arzt, Steven <span dir="ltr"><<a href="mailto:steven.arzt@sit.fraunhofer.de" target="_blank">steven.arzt@sit.fraunhofer.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_2290880468348580830WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Hi Sep,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">A body is a body. “ActiveBody” only means that there is a body which has been loaded and that is associated with that method. For a simplified understanding,
 just speak of bodies. If getActiveBody() doesn’t find a body, that may have multiple reasons:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="m_2290880468348580830MsoListParagraph"><u></u><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The method is a phantom, is abstract, or part of an interface<u></u><u></u></span></p>
<p class="m_2290880468348580830MsoListParagraph"><u></u><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The method should have a body, but it has not been loaded yet. Try retrieveActiveBody() instead<u></u><u></u></span></p>
<p class="m_2290880468348580830MsoListParagraph"><u></u><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><u></u><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The method was created in your code, and no body has been associated with it yet<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Best regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">  Steven<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
</span><span style="font-size:11.0pt;font-family:"MS Gothic"">周</span><span style="font-size:11.0pt;font-family:"Microsoft JhengHei",sans-serif">书林</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> [mailto:<a href="mailto:zhoushulin1992@gmail.com" target="_blank">zhoushulin1992@gmail.<wbr>com</a>]
<br>
<b>Sent:</b> Friday, January 19, 2018 11:21 AM<br>
<b>To:</b> Arzt, Steven <<a href="mailto:steven.arzt@sit.fraunhofer.de" target="_blank">steven.arzt@sit.fraunhofer.de</a><wbr>>; <a href="mailto:soot-list@cs.mcgill.ca" target="_blank">soot-list@cs.mcgill.ca</a><br>
<b>Subject:</b> Re: [Soot-list] What is the meaning of ActiveBody<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi Steven,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Thank you for your explanation. But I am still confused with the difference between the concept of body and ActiveBody. How could I always get the body of a SootMethod? Because when I use the SootMethod API "getActiveBody()", there are
 some SootMethods that have no ActiveBody.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">Best regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Sep<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">2018-01-19 18:03 GMT+08:00 Arzt, Steven <<a href="mailto:steven.arzt@sit.fraunhofer.de" target="_blank">steven.arzt@sit.fraunhofer.de</a><wbr>>:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Hi Sep,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The body of a method contains the statements inside that method as well as the local variable definitions
 and the exception handlers.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Best regards,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">  Steven</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Soot-list [mailto:<a href="mailto:soot-list-bounces@cs.mcgill.ca" target="_blank">soot-list-bounces@cs.<wbr>mcgill.ca</a>]
<b>On Behalf Of </b>???<br>
<b>Sent:</b> Friday, January 19, 2018 3:46 AM<br>
<b>To:</b> <a href="mailto:soot-list@cs.mcgill.ca" target="_blank">soot-list@cs.mcgill.ca</a><br>
<b>Subject:</b> [Soot-list] What is the meaning of ActiveBody</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">I am novice in Java analysis and Soot. I am not familiar with the concept of ActiveBody in SootMethod. (The relevant APIs are hasActiveBody() and getActiveBody() ). Could somebody
 explain the meaning of ActiveBody? When a SootMethod has ActiveBody? If not, how to get access to the Body of this kind of SootMethod?<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thank you very much!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Sincerely.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Sep.<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

</blockquote></div><br></div>