[Soot-list] SPARK on-fly-cg option

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Fri Dec 24 05:00:04 EST 2010


Hi Molnar.

Actually, JFrame and JButton are Swing classes and Swing uses
reflection heavily internally. I am reasonably sure that reflection
may be the source of your problems. But it's hard to say without
seeing the concrete code.

One thing you could try is to run your program with TamiFlex enabled
(similar to here
http://code.google.com/p/tamiflex/wiki/DaCapoAndSoot). This will
produce a log file of all the reflective calls the program makes. This
you can then feed to Spark.

Eric

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



On 23 December 2010 19:43, Molnar Arthur <arthur486 at yahoo.com> wrote:
> Hello,
> thank you for your quick reply. I did provide a correct main class and my
> program does not use reflection. It actually is a small sample (one JFrame
> with one JButton with one registered listener). The problem is that using
> on-fly-cg will not get the listener's actionPerformed(...) in the call graph
> (without the option it's fine but the call graph is ~2.5x larger).  I
> copy-pasted the program that generates my call graph below, if you see
> something not in order (I'm using Soot wrong somehow) please tell me.
> Thanks, Arthur
> Options.v().set_whole_program(true);
> //Scene.v().loadBasicClasses();
> Scene.v().setSootClassPath(SOOT_PATH);
> Scene.v().setMainClass(Scene.v().loadClassAndSupport("ranktest.MainFrame"));
> Scene.v().loadNecessaryClasses();
> HashMap<String, String> optionsMap = new HashMap<String, String>();
> optionsMap.put("enabled", "true");
> optionsMap.put("verbose", "true");
> optionsMap.put("propagator", "worklist");
> optionsMap.put("simple-edges-bidirectional", "false");
> optionsMap.put("on-fly-cg", "true");
> optionsMap.put("set-impl", "double");
> optionsMap.put("double-set-old", "hybrid");
> optionsMap.put("double-set-new", "hybrid");
> optionsMap.put("whole-program", "true");
> SparkTransformer.v().transform("", optionsMap);
> CallGraph cg = Scene.v().getCallGraph();
> System.out.println("Call graph size: " + cg.size());
> ________________________________
> From: Eric Bodden <bodden at st.informatik.tu-darmstadt.de>
> To: Molnar Arthur <arthur486 at yahoo.com>
> Cc: soot-list at sable.mcgill.ca
> Sent: Thu, 23 December, 2010 17:55:54
> Subject: Re: [Soot-list] SPARK on-fly-cg option
>
> Hi Molnar.
>
> Yes, you should get a sound over-approximation.
>
> Did you provide the correct main class? Does you program use reflection?
>
> Eric
>
> --
> Dr. 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
>
>
>
> On 23 December 2010 14:03, Molnar Arthur <arthur486 at yahoo.com> wrote:
>> Hello everyone,
>> A quick question regarding the on-fly-cg option in Soot's SPARK framework;
>> from what I read about call graph building, using this option should still
>> give an overapproximation of the call graph (all possibly executed methods
>> will be in it). However, I tried using this option to get a smaller call
>> graph, but I see at least one edge missing (I know it's there because the
>> method is executed).
>> I will investigate this further, please tell me whether I should upload
>> code&the sample application
>> Best regards, Arthur
>>
>> _______________________________________________
>> 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