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

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Mon Feb 8 06:43:36 EST 2010


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

P.S. 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.


More information about the Soot-list mailing list