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

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Wed Jan 27 04:16:13 EST 2010


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
>
>


More information about the Soot-list mailing list