[Soot-list] Basic usage of Paddle with Soot
Denis Bogdanas
denis.bogdanas at gmail.com
Mon Mar 21 21:57:13 EDT 2016
Hi,
I tried to run paddle example from soot survivor's guide. Paddle definitely
seems out of sync with soot.
After properly setting up everything, I get the error:
Exception in thread "main" java.lang.NoClassDefFoundError:
soot/util/Heap$Keys
at soot.jimple.paddle.OFCGScene.<init>(OFCGScene.java:88)
at soot.jimple.paddle.OFCGConfig.setup(OFCGConfig.java:29)
at soot.jimple.paddle.PaddleScene.setup(PaddleScene.java:1321)
at soot.jimple.paddle.PaddleTransformer.setup(PaddleTransformer.java:84)
at
dk.brics.paddle.PointsToAnalysis.setPaddlePointsToAnalysis(PointsToAnalysis.java:120)
at dk.brics.paddle.PointsToAnalysis.main(PointsToAnalysis.java:44)
There's no such class "soot.util.Heap" in the latest soot codebase.
By the way, soot-trunk.jar doesn't include paddle distribution.
On Friday, August 14, 2015 at 12:31:13 AM UTC-7, Steven Arzt wrote:
>
> Hi Ben,
>
>
>
> You are using a fairly outdated version of Soot. The plugin is not really
> regularly updated with the current version of Soot. Thus, if you are just
> interested in obtaining Soot, I would either take the source code from
> Github and compile it or take our nightly builds:
> https://ssebuild.cased.de/nightly/soot/lib/soot-trunk.jar. This build
> should directly include Paddle and should at least not throw any funny
> errors due to mismatching method signatures.
>
>
>
> Best regards,
>
> Steven
>
>
>
>
>
> M.Sc. M.Sc. Steven Arzt
>
> Secure Software Engineering Group (SSE)
>
> European Center for Security and Privacy by Design (EC SPRIDE)
>
> Rheinstraße 75
>
> D-64293 Darmstadt
>
> Phone: +49 61 51 869-336
>
> Fax: +49 61 51 16-72118
>
> eMail: steven.arzt at ec-spride.de <javascript:>
>
> Web: http://sse.ec-spride.de
>
>
>
>
>
>
>
> *Von:* soot-lis... at CS.McGill.CA <javascript:> [mailto:
> soot-lis... at CS.McGill.CA <javascript:>] *Im Auftrag von *Ben Holland
> *Gesendet:* Freitag, 14. August 2015 00:17
> *An:* soot... at cs.mcgill.ca <javascript:>
> *Betreff:* [Soot-list] Basic usage of Paddle with Soot
>
>
>
> Hi,
>
>
>
> I've been trying to run Paddle with Soot, but I'm having some issues. I
> just want to get access to the PointsTo results and the callgraph. My
> question is does Paddle actually work with Soot or is it out of synch with
> the current Soot? It looks like work on Paddle more or less stopped in
> 2008.
>
>
>
> I've read up on my literature for Soot and several of the Lhotak
> papers/thesis. I've also read the Soot Survivors guide in it's entirety.
>
>
>
> I'm using the nightly build of Paddle from
> http://plg.uwaterloo.ca/~olhotak/build/, and I'm using the version of
> Soot available through the Eclipse update site at
> https://github.com/Sable/soot/wiki/Running-Soot-as-Eclipse-Plugin.
>
>
>
> Running the following program gives me some errors. Occasionally the
> error is different breaking on a Field instead of an array first.
>
>
>
> java.lang.NoSuchMethodError:
> soot.Scene.getFieldNumberer()Lsoot/util/ArrayNumberer;
>
> at
> soot.jimple.paddle.ArrayElement.<init>(ArrayElement.java:28)
>
> at
> soot.PaddleSingletons.soot_jimple_paddle_ArrayElement(PaddleSingletons.java:33)
>
> at soot.jimple.paddle.ArrayElement.v(ArrayElement.java:30)
>
> at
> soot.jimple.paddle.NodeFactory.caseArgv(NodeFactory.java:127)
>
> at
> soot.jimple.paddle.MethodNodeFactory.addMiscEdges(MethodNodeFactory.java:228)
>
> at
> soot.jimple.paddle.TradMethodPAGBuilder.build(TradMethodPAGBuilder.java:63)
>
> at
> soot.jimple.paddle.TradMethodPAGBuilder.update(TradMethodPAGBuilder.java:48)
>
> at
> soot.jimple.paddle.DependencyManager.update(DependencyManager.java:76)
>
> at soot.jimple.paddle.OFCGScene.solve(OFCGScene.java:168)
>
> at soot.jimple.paddle.OFCGConfig.solve(OFCGConfig.java:35)
>
> at soot.jimple.paddle.PaddleScene.solve(PaddleScene.java:1390)
>
> at
> soot.jimple.paddle.PaddleTransformer.solve(PaddleTransformer.java:99)
>
> at
> soot.jimple.paddle.PaddleTransformer.internalTransform(PaddleTransformer.java:46)
>
> at soot.SceneTransformer.transform(SceneTransformer.java:39)
>
> at
> soot.jimple.paddle.PaddleHook.internalTransform(PaddleHook.java:43)
>
> at soot.SceneTransformer.transform(SceneTransformer.java:39)
>
> at soot.Transform.apply(Transform.java:90)
>
> at soot.RadioScenePack.internalApply(RadioScenePack.java:57)
>
> at
> soot.jimple.toolkits.callgraph.CallGraphPack.internalApply(CallGraphPack.java:49)
>
> at soot.Pack.apply(Pack.java:116)
>
> at soot.PackManager.runWholeProgramPacks(PackManager.java:564)
>
> at soot.PackManager.runPacksNormally(PackManager.java:457)
>
> at soot.PackManager.runPacks(PackManager.java:392)
>
> at soot.Main.run(Main.java:271)
>
> at soot.Main.main(Main.java:147)
>
> at PaddleTest.main(PaddleTest.java:43)
>
>
>
> public class PaddleTest {
>
>
>
> public final static String projectDir = "<my workspace
> path>/TestProject/bin";
>
>
>
> public static void main(String[] args) {
>
>
>
> // reset soot
>
> Scene.v().releaseActiveHierarchy();
>
> Scene.v().releaseCallGraph();
>
> Scene.v().releaseFastHierarchy();
>
> Scene.v().releasePointsToAnalysis();
>
> Scene.v().releaseReachableMethods();
>
> Scene.v().releaseSideEffectAnalysis();
>
> G.reset();
>
>
>
> // setup soot args
>
> List<String> sootArgs = new LinkedList<String>();
>
>
>
> // analyze entire directory
>
> sootArgs.add("-process-dir");
>
> sootArgs.add(projectDir);
>
>
>
> sootArgs.add("-w"); // enable whole program mode
>
>
>
> // setup spark options
>
> sootArgs.add("-p");
>
> sootArgs.add("cg.paddle");
>
> sootArgs.add("enabled:true,verbose:true");
>
>
>
> // run soot
>
> try {
>
> String[] argsArray =
> sootArgs.toArray(new String[0]);
>
> soot.Main.main(argsArray);
>
>
>
> // iterate over call graph results
>
> CallGraph callGraph =
> Scene.v().getCallGraph();
>
> System.out.println("Number of edges in
> callgraph: " + callGraph.size());
>
>
>
> // PointsToAnalysis p =
> Scene.v().getPointsToAnalysis();
>
> } catch (Throwable t){
>
> System.out.println("Soot class path "
> + Scene.v().getSootClassPath());
>
> t.printStackTrace();
>
> }
>
>
>
> }
>
>
>
> }
>
>
>
> The Soot Survivors Guide shows a slightly example, but I have had
> difficulty setting the classpath and standard soot options using that
> method. Do you have a simple example of running Paddle somewhere you could
> share?
>
>
>
> PaddleTransformer pt = new PaddleTransformer();
>
> PaddleOptions paddle_opt = new PaddleOptions(myPaddleOptions);
>
> pt.setup(paddle_opt);
>
> pt.solve(paddle_opt);
>
> soot.jimple.paddle.Results.v().makeStandardSootResults();
>
>
>
> ~Ben
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20160321/d585aefd/attachment-0003.html
More information about the Soot-list
mailing list