[Soot-list] What is the meaning of ActiveBody

周书林 zhoushulin1992 at gmail.com
Fri Jan 19 06:00:42 EST 2018


Hi Steven,

I run my own Transformer on hadoop, there is indeed a body in a method, but
I cannot get its body.

I have tried the retrieveActiveBody(), but there is a RuntimeException:

java.lang.RuntimeException: No method source set for method
<org.apache.hadoop.io.RawComparator: int
compare(byte[],int,int,byte[],int,int)>

at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:123)

at soot.SootMethod.retrieveActiveBody(SootMethod.java:385)

at com.sep.MyTransformer.analyzeSootMethod(MyTransformer.java:120)

        at com.sep.MyTransformer.analyzeSootClass(MyTransformer.java:113)

at com.sep.MyTransformer.internalTransform(MyTransformer.java:60)

at soot.SceneTransformer.transform(SceneTransformer.java:39)

at soot.Transform.apply(Transform.java:90)

at soot.ScenePack.internalApply(ScenePack.java:40)

at soot.Pack.apply(Pack.java:118)

at soot.PackManager.runWholeProgramPacks(PackManager.java:565)

at soot.PackManager.runPacksNormally(PackManager.java:455)

at soot.PackManager.runPacks(PackManager.java:384)

at soot.Main.run(Main.java:278)

at soot.Main.main(Main.java:147)

at com.sep.Sample.main(VarLocation.java:47)

        ...


What should I do in such situation?


Best regards,
Sep



2018-01-19 18:33 GMT+08:00 Arzt, Steven <steven.arzt at sit.fraunhofer.de>:

> Hi Sep,
>
>
>
> 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:
>
>
>
> -          The method is a phantom, is abstract, or part of an interface
>
> -          The method should have a body, but it has not been loaded yet.
> Try retrieveActiveBody() instead
>
> -          The method was created in your code, and no body has been
> associated with it yet
>
>
>
> Best regards,
>
>   Steven
>
>
>
> *From:* 周书林 [mailto:zhoushulin1992 at gmail.com]
> *Sent:* Friday, January 19, 2018 11:21 AM
> *To:* Arzt, Steven <steven.arzt at sit.fraunhofer.de>; soot-list at cs.mcgill.ca
> *Subject:* Re: [Soot-list] What is the meaning of ActiveBody
>
>
>
> Hi Steven,
>
>
>
> 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.
>
>
>
> Best regards,
>
> Sep
>
>
>
> 2018-01-19 18:03 GMT+08:00 Arzt, Steven <steven.arzt at sit.fraunhofer.de>:
>
> Hi Sep,
>
>
>
> The body of a method contains the statements inside that method as well as
> the local variable definitions and the exception handlers.
>
>
>
> Best regards,
>
>   Steven
>
>
>
> *From:* Soot-list [mailto:soot-list-bounces at cs.mcgill.ca] *On Behalf Of *
> ???
> *Sent:* Friday, January 19, 2018 3:46 AM
> *To:* soot-list at cs.mcgill.ca
> *Subject:* [Soot-list] What is the meaning of ActiveBody
>
>
>
> 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?
>
>
>
> Thank you very much!
>
>
>
> Sincerely.
>
>
>
> Sep.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20180119/127537d9/attachment.html>


More information about the Soot-list mailing list