[Soot-list] Missing edges in call graph generated by Spark

saswat78 at gmail.com saswat78 at gmail.com
Mon Feb 8 12:06:49 EST 2010


I guess even with -dynamic-class option, edges related to reflection will  
be missing
if a more recent version of Sun's standard library than 1.3 is used for  
analysis. The
reason, I think is, that the models for native methods in soot are not up  
to date with the
native methods of these newer libraries.

In this case, soot assumes newInstance0 method in java.lang.Class is  
native, which
is the case for 1.3. However, in newer versions that method is not native.  
As a result,
the model method, which takes care of reflection, is not invoked. I think,  
this can be
fixed by adding a model for newInstance0 method of  
sun.reflect.NativeConstructorAccessorImpl
class, which is a native method and creates objects through reflection.

Saswat

On Feb 8, 2010 6:43am, Eric Bodden <bodden at st.informatik.tu-darmstadt.de>  
wrote:
> Hello Cheng.



> I agree that it is very likely that Soot fails to infer the correct

> points-to sets and call-graph edges due to reflection in this case.



> > "Warning: Class sun.nio.cs.ext.ExtendedCharsets is a dynamic class, and  
> you

> > did not specify it as such; graph will be incomplete!",



> In some cases in which a program uses a String constant to load a

> class, such as Class.forName("sun.nio.cs.ext.ExtendedCharsets"), Soot

> is able to infer that the program in trying to load the class

> "sun.nio.cs.ext.ExtendedCharsets" at this point. However, apparently

> you did not specify sun.nio.cs.ext.ExtendedCharsets to be a dynamic

> class and therefore Soot will ignore this class at this allocation

> site, which is unsound.



> The solution is to use the -dynamic-class option, such as

> -dynamic-class sun.nio.cs.ext.ExtendedCharsets.



> In general, you should include for any class C that may be

> instantiated via reflection, an option "-dynamic-class C" to Soot's

> command line. In principle, this should make the missing edges appear

> when the correct classes are added.



> Eric



> PS I am currently working on a version of Soot that will automate

> this treatment of reflection to some extend but it won't be made

> available before the next major release of Soot, which we plan for the

> end of March.

> _______________________________________________

> Soot-list mailing list

> Soot-list at sable.mcgill.ca

> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20100208/b6bf988d/attachment.html 


More information about the Soot-list mailing list