[Soot-list] (GeomPointsTo) Spark PTA Re-analysis

Richard Xiao richardxx at cse.ust.hk
Wed Apr 3 04:41:58 EDT 2013


Hi, Michael:

Now I found the root cause.
The problem is because SPARK caches the analyzed methods in a global field
"G.v().MethodPAG_methodToPag". Therefore, if you don't clean the cache, the
methods are analyzed again in your second PTA. Since geomPTA obtains
program information from SPARK and SPARK contains no program information in
the second run (because SPARK skips all analyzed methods in the cache),
geomPTA crashes due to uninitialized variables. Just add a line:

G.v().MethodPAG_methodToPag = new HashMap<SootMethod, MethodPAG>();

before your "SparkTransformer.v().transform("",opt);", your problem is
solved. Please try it out.


Cheers,
Xiao



On Tue, Apr 2, 2013 at 11:49 PM, Michael Gordon <mgordon at mit.edu> wrote:

> Hello Xiao,
>
> I initially tried just to release the CG and the PTA, but it did not work.
>  Here is the error I am receiving:
>
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
> at java.util.ArrayList.get(ArrayList.java:324)
> at
> soot.jimple.spark.geom.geomPA.OfflineProcessor.add_graph_edge(OfflineProcessor.java:541)
> at
> soot.jimple.spark.geom.geomPA.OfflineProcessor.buildInstanceAssignmentGraph(OfflineProcessor.java:147)
> at
> soot.jimple.spark.geom.geomPA.OfflineProcessor.runOptimizations(OfflineProcessor.java:85)
> at soot.jimple.spark.geom.geomPA.GeomPointsTo.solve(GeomPointsTo.java:995)
> at
> soot.jimple.spark.SparkTransformer.internalTransform(SparkTransformer.java:188)
> at soot.SceneTransformer.transform(SceneTransformer.java:39)
>
>
> At this point, my main method is quite large, and has a lot
> transformation.  I do not have a simple version to demonstrate this bug.
>  However, my consecutive calls to PTA look like this:
>
> ...
> runPTA();
> Scene.v().releaseCallGraph();
> Scene.v().releasePointsToAnalysis();
> runPTA();
> ...
>
> public static void runPTA() {
>
> HashMap opt = new HashMap();
>
> opt.put("geom-pta","true");
>
> opt.put("geom-encoding", "geom");
>
> opt.put("geom-worklist", "PQ");
>
> opt.put("geom-eval", "0");
>
> opt.put("geom-trans", "false");
>
> opt.put("geom-frac-base", "40");
>
> opt.put("geom-blocking", "true");
>
> opt.put("geom-runs", "1");
>
> opt.put("enabled","true");
>
> opt.put("verbose","false");
>
> opt.put("ignore-types","true");
>
> opt.put("force-gc","false");
>
> opt.put("pre-jimplify","false");
>
> opt.put("vta","false");
>
> opt.put("rta","false");
>
> opt.put("field-based","false");
>
> opt.put("types-for-sites","false");
>
> opt.put("merge-stringbuffer","false");
>
> opt.put("string-constants","true");
>
> opt.put("simulate-natives","true");
>
> opt.put("simple-edges-bidirectional","false");
>
> opt.put("on-fly-cg","true");
>
> opt.put("simplify-offline","false");
>
> opt.put("simplify-sccs","false");
>
> opt.put("ignore-types-for-sccs","false");
>
> opt.put("propagator","worklist");
>
> opt.put("set-impl","double");
>
> opt.put("double-set-old","hybrid");
>
> opt.put("double-set-new","hybrid");
>
> opt.put("dump-html","false");
>
> opt.put("dump-pag","false");
>
> opt.put("dump-solution","false");
>
> opt.put("topo-sort","false");
>
> opt.put("dump-types","true");
>
> opt.put("class-method-var","true");
>
> opt.put("dump-answer","false");
>
> opt.put("add-tags","false");
>
> opt.put("set-mass","false");
>
> SparkTransformer.v().transform("",opt);
>
> }
>
> Any thoughts on the above error?  I can work on creating a smaller main
> driver that recreates the problem if no one has suggestions.
>
> Cheers!
> Michael
>
> ---
>
>
> Hi, Michael:
>
> The problem is you release important information that is needed by
> points-to analysis. For example, "releaseFastHierarchy" destroys the type
> inheritance graph, which is used by either SPARK or Geom.
>
> Please just try releasing only the CallGraph and the PointsToAnalysis after
> your transformation. If it doesn't work neither, please show us your full
> main function that we can reproduce your failure.
>
> Cheers,
> Xiao
>
> --
> Michael Gordon, PhD
> Research Scientist, MIT CSAIL
> http://people.csail.mit.edu/mgordon
> Program Head, MIT AITI
> http://aiti.mit.edu
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>


-- 
Richard Xiao Xiao
PhD Student @ CSE @ Hong Kong University of Science and Technology
www.cse.ust.hk/~richardxx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130403/59be1b90/attachment.html 


More information about the Soot-list mailing list