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

Cheng Zhang cheng.zhang.stap at gmail.com
Mon Feb 8 21:28:07 EST 2010


Luckily my problem with fop seems to be solved when I've tried to use
-dynamic-class to mark all the classes observed by tracing the execution
(e.g., org.apache.xerces.jaxp.SAXParserFactoryImpl).

The missing edges now can be found in the call graph, though the caller type
is identified as org.apache.xerces.parsers.AbstractSAXParser instead of
org.apache.xerces.jaxp.
SAXParserImpl.JAXPSAXParser. Maybe I should check the classpath and xerces
packages both in rt.jar and fop-deps.jar.

Thanks a lot for your help.

Cheng

On Tue, Feb 9, 2010 at 1:06 AM, <saswat78 at gmail.com> wrote:

> 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
> >
> >
> >
> > 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.
> >
> > _______________________________________________
> >
> > 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/20100209/015f0788/attachment.html 


More information about the Soot-list mailing list