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

Cheng Zhang cheng.zhang.stap at gmail.com
Tue Jan 26 22:35:29 EST 2010


Hi, Sai,

I once encountered a similar problem when I was using Soot to analyse a jar
file (perhaps jTidy...).
The problem seems to be that the classes in the jar file are considered as
library classes (e.g. those in rt.jar),
because some version of these classes have already been included in the
runtime library.

I am not so sure, but I guess the -i option may help.

Best,

Cheng

On Wed, Jan 27, 2010 at 11:07 AM, Sai Zhang <racezhang at gmail.com> wrote:

> Hi all:
>
> I am using Soot to do some data-flow analysis on several medium to large
> scale programs, *which all use third-party ja*r.
>
> 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 resul*t!
>
> 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/0136ee2b/attachment.html 


More information about the Soot-list mailing list