[Soot-list] A Strange problem about library-dependent program analysis in Soot.

Sai Zhang racezhang at gmail.com
Wed Jan 27 12:08:22 EST 2010


Hi Eric:

Thanks for your reply.

I change all temp print statement to G.v().out.println(), but it seems still
does not work.

What confused me most is that Soot* did not process the correct class
files*as described in the argument, in my case:

public static String ANALYSIS_DIR = "usr\sai\apache-common-collections";
 String[] sootArgs = new String[] {"--app", "-cp", ".;" + ANALYSIS_DIR,
"-pp",
                "-process-dir", ANALYSIS_DIR, "-f", "jimple",


Soot should process all class files under package org.apache.collections....
(which is located in the ANALYSIS_DIR folder)...
However, it seems that soot outputs the following strange things (*I even
did not ask it to process JUnit files*):

Transforming org.junit.internal.ArrayComparisonFailure...
Transforming junit.framework.Assert...
Transforming org.hamcrest.SelfDescribing...
Transforming junit.framework.AssertionFailedError...
Transforming org.junit.Before...
Transforming junit.framework.TestResult...
Transforming org.junit.Test...
Transforming org.junit.Assert...


So, i really doubt I used the wrong soot arguments...


Is there any other possible reasons? I am really confused.

thanks


-Sai







On Wed, Jan 27, 2010 at 1:16 AM, Eric Bodden <
bodden at st.informatik.tu-darmstadt.de> wrote:

> Sai,
>
> you need to use G.v().out.println(..) instead of
> System.out.println(..). Otherwise, your output may not show up in the
> Eclipse console.
>
> Also I recommend not printing anything after calling
> soot.Main.main(..) but instead printing from within a transformer. The
> annotation packs are usually good for printing. Soot may exit using
> System.exit(..) which will cause Soot to never reach any code that
> comes after it's main method.
>
> Hope that helps,
> Eric
>
> --
> Eric Bodden
> Software Technology Group, Technische Universität Darmstadt, Germany
> Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
> Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt
>
>
>
> 2010/1/27 Sai Zhang <racezhang at gmail.com>:
> > Hi all:
> >
> > I am using Soot to do some data-flow analysis on several medium to large
> > scale programs, which all use third-party jar.
> >
> > I am confused about Soot's output, I guess it should be a common problem
> for
> > newible. My code skeleton is shown as
> > follows (which  is enough to show  the problem):
> >
> > PS. I use Java 1.6 with the latest Soot release (not eclipse plugin). I
> set
> > up the environment in eclipse galileo release.
> >
> > //ANALYSIS_DIR is the directory where all class files reside
> > String[] sootArgs = {"-cp", ".;" + ANALYSIS_DIR, "-pp",  "-process-dir",
> > ANALYSIS_DIR, "-f", "jimple",
> >
> > PackManager.v().getPack("jtp").add(
> >                 new Transform("jtp.myanalysis",
> >                         new BodyTransformer() {
> >                             protected void internalTransform(Body body,
> > String phase, Map options) {
> >                                //implement my own analysis here
> >                             }
> >                         }));
> >
> > //run soot
> > soot.Main.main(sootArgs);
> >
> > //print the analysis result, I omit the following code
> > System.out.print .....
> >
> >
> > The evaluated program depends on a set of  third-party jars,  so I add
> all
> > jars  needed to the eclipse project references, and use -pp in Soot's arg
> to
> > configure it.
> > That should be fine, right?
> >
> > However, when I run my program, Soot neither issues a warning, nor throw
> an
> > exception, nor print any result!
> >
> > The output looks like follows (Even the progress info: like Soot is
> > processing file XXX is missing):
> >
> > Soot started on Tue Jan 26 18:43:53 PST 2010
> > Soot finished on Tue Jan 26 18:43:56 PST 2010
> > Soot has run for 0 min. 2 sec.     //this processing time seems to be too
> > short
> >
> > Some known facts:
> >
> > 1. I feel really strange about this behavior (it definitely should have
> some
> > result, even if I change BodyTransformer() implementation to print every
> > method name it encounters).
> > 2. It is also unlikely that any dependent jars are missing (in that case,
> > soot will issue exceptions, right?)
> > 3. I doube-check that all classes are placed in the right dir, which
> > strictly follows the package name (if not, soot will throw exception)
> > 4. I also increase the analysis memory to -Xmx1024, so
> OutOfMemoryException
> > should not be the case
> > 5. I check there is no java file or other format files in the target
> > directory
> > 6. what I feel most strange is that, it works for some lib-dependent
> > program, but does not for other fews. In my case, it works on the whole
> > Daikon source tree (160KLOC), but fails on apache-common-collection
> > (80KLOC),
> >    so I guess that should be nothing to do with the program size.
> >
> >
> > I am wondering is that a common problem of daikon?  do I forget to
> configure
> > sth? or i use the wrong command/parameter? or could any one give some
> hints?
> > Any comments are highly appreciated!
> >
> > Thanks
> >
> >
> > --
> > Sai
> >
> > _______________________________________________
> > 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/20100127/7ed1cf2d/attachment.html 


More information about the Soot-list mailing list