[Soot-list] Analyzing rt.jar

Manas Thakur manasthakur17 at gmail.com
Fri Feb 12 06:06:55 EST 2016


Hi Steven,

Even if I don’t analyze the library separately (using asm), and try to analyze in whole program mode, I am observing the following:

Object.equals can be analyzed successfully.
PrintStream.print throws active body not found error, saying that PrintStream is a phantom class.

Could you please suggest me how to rectify this?

Regards,
Manas

> On 11-Feb-2016, at 9:21 AM, Manas Thakur <manasthakur17 at gmail.com> wrote:
> 
> To add: I get the same errors even when I remove “-coffi” from my configuration options.
> 
> Regards,
> Manas
> 
>> On 10-Feb-2016, at 6:22 PM, Manas Thakur <manasthakur17 at gmail.com <mailto:manasthakur17 at gmail.com>> wrote:
>> 
>> Hi Steven,
>> 
>> The problem with asm is that it does not support Bytecodeoffset tag, which I need for my analysis. I remember raising this point a few months back, and was told it’s difficult.
>> Is their some workaround/feature concerning Bytecode offsets available now?
>> 
>> Regards,
>> Manas
>> 
>>> On 10-Feb-2016, at 6:18 PM, Steven Arzt <Steven.Arzt at cased.de <mailto:Steven.Arzt at cased.de>> wrote:
>>> 
>>> Hi Manas,
>>>  
>>> As Karim already wrote, please try to use the new default ASM frontend and not Coffi. There is no support for newer language constructs in Coffi as Coffi has been deprecated.
>>>  
>>> Best regards,
>>>   Steven
>>>  
>>> Von: Manas Thakur [mailto:manasthakur17 at gmail.com <mailto:manasthakur17 at gmail.com>] 
>>> Gesendet: Mittwoch, 10. Februar 2016 13:43
>>> An: Steven Arzt
>>> Cc: soot-list at CS.McGill.CA <mailto:soot-list at cs.mcgill.ca>
>>> Betreff: Re: [Soot-list] Analyzing rt.jar
>>>  
>>> Hi Steven,
>>>  
>>> The arguments being passed to Soot are as follows:
>>> “-cp . -pp -w -coffi -f J -keep-line-number -no-bodies-for-excluded -keep-bytecode-offset -keep-offset -p jb use-original-names -allow-phantom-refs -print-tags -process-dir rt.jar”
>>>  
>>> Then I am adding a phase to wjtp, followed by calling the analysis for a custom entry point:
>>> Options.v().parse(sootArgs);
>>> SootClass c = Scene.v().forceResolve(className, SootClass.BODIES);
>>> c.setApplicationClass();
>>> Scene.v().loadNecessaryClasses();
>>>  
>>> SootMethod m = c.getMethod(methodName, paramTypeList);
>>> List<SootMethod> entryPoints = new ArrayList<SootMethod>();
>>> entryPoints.add(m);
>>> Scene.v().setEntryPoints(entryPoints);
>>> PackManager.v().runPacks();
>>>  
>>> I am constructing the paramTypeList by including the corresponding type from soot.*Type.v() to paramTypeList (above). Further, I am using soot.RefType.v(“java.lang.Object”) for the parameter. It works for Object.equals, but not for PrintStream.print (even though both methods are similar in the sense that they are not overriding any methods, etc.).
>>>  
>>> Regards,
>>> Manas
>>>  
>>>> On 10-Feb-2016, at 6:01 PM, Steven Arzt <Steven.Arzt at cased.de <mailto:Steven.Arzt at cased.de>> wrote:
>>>>  
>>>> Hi Manas,
>>>>  
>>>> Can you please give your complete Soot command line or configuration options?
>>>>  
>>>> Best regards,
>>>>   Steven
>>>>  
>>>> Von: soot-list-bounces at CS.McGill.CA <mailto:soot-list-bounces at cs.mcgill.ca> [mailto:soot-list-bounces at CS.McGill.CA <mailto:soot-list-bounces at CS.McGill.CA>] Im Auftrag von Manas Thakur
>>>> Gesendet: Mittwoch, 10. Februar 2016 13:29
>>>> An: Karim Ali
>>>> Cc: soot-list at CS.McGill.CA <mailto:soot-list at cs.mcgill.ca>
>>>> Betreff: Re: [Soot-list] Analyzing rt.jar
>>>>  
>>>> Hello all
>>>>  
>>>> While analyzing rt.jar with custom entry points (as given in the soot wiki), I am getting different errors. For some methods, the analysis is successful (e.g., Object.equals); for some of them, I am getting “active body not found error (e.g., PrintStream.print) on using “getActiveBody” on those methods. Using “retrieveActiveBody” doesn’t help either; it throws errors like “This operation requires resolving level BODIES but java.io.PrintStream is at resolving level SIGNATURES”.
>>>>  
>>>> Any suggestions? The jdk version is 7.
>>>>  
>>>> Regards,
>>>> Manas
>>>>  
>>>>> On 08-Feb-2016, at 2:26 PM, Karim Ali <karim.ali at cased.de <mailto:karim.ali at cased.de>> wrote:
>>>>>  
>>>>> The Coffi frontend is not able to process the recent JDKs. You should use the default ASM one.
>>>>> 
>>>>> - Karim
>>>>>  
>>>>>> On Feb 8, 2016, at 09:49, Manas Thakur <manasthakur17 at gmail.com <mailto:manasthakur17 at gmail.com>> wrote:
>>>>>>  
>>>>>> Hi Karim,
>>>>>>  
>>>>>> I am trying to analyze jdk8 (u45) on OS X. I am using the older “-coffi” frontend from soot-nightly-build. Further, I am keeping rt.jar in a separate directory and giving its address in the “-process-dir” option.
>>>>>>  
>>>>>> Regards,
>>>>>> Manas
>>>>>>  
>>>>>>> On 08-Feb-2016, at 1:13 PM, Karim Ali <karim.ali at cased.de <mailto:karim.ali at cased.de>> wrote:
>>>>>>>  
>>>>>>> Hello Manas,
>>>>>>>  
>>>>>>> Which JDK (version, OS, etc) are you analyzing? It seems it’s an OS X one as well. For some older version of Java on OS X, there are some additional jars you need to add on the soot classpath to be able to properly analyze rt.jar.
>>>>>>> 
>>>>>>> - Karim
>>>>>>>  
>>>>>>>> On Feb 8, 2016, at 06:53, Manas Thakur <manasthakur17 at gmail.com <mailto:manasthakur17 at gmail.com>> wrote:
>>>>>>>>  
>>>>>>>> Hello all,
>>>>>>>>  
>>>>>>>> While analyzing rt.jar (with the -process-dir) option, I am getting the following error:
>>>>>>>>  
>>>>>>>> java.lang.RuntimeException: no superclass for java.lang.CharSequence                                                   │apple/laf/JRSUIConstants$Property.class
>>>>>>>>         at soot.SootClass.getSuperclass(SootClass.java:767)                                                            
>>>>>>>>>>>>>>>>  
>>>>>>>> If I use the released version of soot (soot-2.5.0), I get the following error:
>>>>>>>>  
>>>>>>>> java.lang.RuntimeException: Trying to create interface invoke expression for non-interface type: java.util.Map$Entry Us│apple/laf/JRSUIConstants$SegmentPosition.class
>>>>>>>> e JVirtualInvokeExpr or JSpecialInvokeExpr instead!                                                                    │apple/laf/JRSUIConstants$ScrollBarPart.class
>>>>>>>>         at soot.jimple.internal.JInterfaceInvokeExpr.<init>(JInterfaceInvokeExpr.java:46)                              │apple/laf/JRSUIConstants$PropertyEncoding.class
>>>>>>>>         at soot.jimple.Jimple.newInterfaceInvokeExpr(Jimple.java:433)
>>>>>>>> ...
>>>>>>>>  
>>>>>>>> Can anyone suggest what may be wrong?
>>>>>>>>  
>>>>>>>> Regards,
>>>>>>>> Manas
>>>>>>>> _______________________________________________
>>>>>>>> Soot-list mailing list
>>>>>>>> Soot-list at CS.McGill.CA <mailto:Soot-list at cs.mcgill.ca>
>>>>>>>> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list <https://mailman.cs.mcgill.ca/mailman/listinfo/soot-list>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20160212/b47af0ea/attachment-0001.html 


More information about the Soot-list mailing list