[Soot-list] spark problem with "keep-original-names" option

LIU Peng lpxz at ust.hk
Tue Jul 14 06:21:31 EDT 2009


Hello:
     I encounter a little problem while using spark to do point-to analysis
one method is sparkwork() to build PAG, another method is sparkquery() to
retrieve information about point-to relationship.
but while I enable PhaseOptions.v().setPhaseOption("jb",
"use-original-names:true") in sparkwork() (the code is in the last part),
the sparkquery() would returns me a coarse result:


the local variable i1 points to :
AllocNode 4975 new Item in method <Test1: void go()>   type: Item
AllocNode 4977 new Item in method <Test1: void go()>   type: Item
the local variable i2 points to :
AllocNode 4975 new Item in method <Test1: void go()>   type: Item
AllocNode 4977 new Item in method <Test1: void go()>   type: Item

For the subject method:
	public void go() {
		Container c1 = new Container();
		Item i1 = new Item();// i1, alloc 4975
		c1.setItem(i1);

		Container c2 = new Container();
		Item i2 = new Item();//i2, alloc 4977
		c2.setItem(i2);



		Container c3 = c2;
	}

while I comment out PhaseOptions.v().setPhaseOption("jb",
"use-original-names:true");

the running results are correct:

the local variable r3 points to :
AllocNode 4895 new Item in method <Test1: void go()>   type: Item
the local variable r5 points to :
AllocNode 4897 new Item in method <Test1: void go()>   type: Item
As we see, i1 ,i2 are renamed to be r3, r5 because the
"use-original-names" option is closed.

Can you give me some suggestion about what is wrong with the usage?
and how can I keep original names ?



	private static void sparkWork() {
		System.out.println("[spark] Starting analysis ...");

		HashMap opt = new HashMap();


		//
		opt.put("enabled","true");
		opt.put("verbose","false");
		opt.put("ignore-types","false");
		opt.put("force-gc","false");
		opt.put("pre-jimplify","true");
		opt.put("vta","false");
		opt.put("rta","false");
		opt.put("field-based","false");
		opt.put("types-for-sites","false");
		opt.put("merge-stringbuffer","true");
		opt.put("string-constants","false");
		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","true");
		opt.put("set-mass","false");

		PhaseOptions.v().setPhaseOption("jb", "use-original-names:true");
	        PhaseOptions.v().setPhaseOption("cg.spark", "enabled:true");
		SparkTransformer.v().transform("",opt);
	        System.out.println("[spark] Done!");

	}


Regards

Peng





More information about the Soot-list mailing list