[Soot-list] How to obtain the topological graph in the transactional transformation phase (wjtp.tn)?

Eric Bodden eric.bodden at mail.mcgill.ca
Wed Dec 3 16:02:07 EST 2008


I am unable to reproduce the behavior you are describing.

I do see an exception but not the kind of exception you reported when
I run the current version of Soot on your LockGraphTest class.

Soot started on Wed Dec 03 15:52:16 GMT-05:00 2008
No main class given. Inferred 'LockGraphTest' as main class.
[Call Graph] For information on where the call graph may be
incomplete, use the verbose option to the cg phase.
[Spark] Pointer Assignment Graph in 6.0 seconds.
[Spark] Type masks in 0.7 seconds.
[Spark] Pointer Graph simplified in 0.0 seconds.
[Spark] Propagation in 88.9 seconds.
[Spark] Solution found in 89.0 seconds.
[wjtp.tn] *** Build May-Happen-in-Parallel Info *** Wed Dec 03
15:54:01 GMT-05:00 2008
[mhp]
[mhp] Main Thread (Single, ---,---):
[mhp] [<LockGraphTest: void main(java.lang.String[])>
[mhp]   <LockGraphTest: void setI(int)>
[mhp]   <LockGraphTest: void <init>()>
[mhp]   <LockGraphTest: void setF(LockGraphTest)>
[mhp]   <LockGraphTest: float getF()>]
[mhp]
[wjtp.tn] *** Find and Name Transactions *** Wed Dec 03 15:54:01 GMT-05:00 2008
Warning: using default implementation of addAll. You should implement
a faster specialized implementation.
this is of type soot.jimple.spark.sets.HashPointsToSet
other is of type soot.jimple.spark.sets.HybridPointsToSet
exclude is null
Exception in thread "main" java.lang.RuntimeException: Unknown
bytecode pattern: exitmonitor not followed by return, exitmonitor,
goto, or throw
	at soot.jimple.toolkits.thread.synchronization.SynchronizedRegionFinder.flowThrough(SynchronizedRegionFinder.java:270)
	at soot.jimple.toolkits.thread.synchronization.SynchronizedRegionFinder.flowThrough(SynchronizedRegionFinder.java:18)
	at soot.toolkits.scalar.ForwardFlowAnalysis.doAnalysis(ForwardFlowAnalysis.java:162)
	at soot.jimple.toolkits.thread.synchronization.SynchronizedRegionFinder.<init>(SynchronizedRegionFinder.java:75)
	at soot.jimple.toolkits.thread.synchronization.LockAllocator.internalTransform(LockAllocator.java:168)
	at soot.SceneTransformer.transform(SceneTransformer.java:39)
	at soot.Transform.apply(Transform.java:89)
	at soot.ScenePack.internalApply(ScenePack.java:43)
	at soot.Pack.apply(Pack.java:114)
	at soot.PackManager.runWholeProgramPacks(PackManager.java:407)
	at soot.PackManager.runPacks(PackManager.java:327)
	at soot.Main.run(Main.java:202)
	at soot.Main.main(Main.java:145)
	at MyMain.main(MyMain.java:45)


This exception only points to an apparent shortcoming of the current
implementation of SynchronizedRegionFinder.

Eric

2008/12/1 Marco Bakera <marco.bakera at tu-dortmund.de>:
> You are right, Eric. The problem does not occur in any case. The following
> piece of code provides such an example that runs into problems.
>
> public class LockGraphTest {
>        private final Object lockI = new Object();
>        private final Object lockF = new Object();
>        private int iVal;
>        private float fVal;
>
>        public LockGraphTest() {
>        }
>
>        public void setI(int newValue) {
>                synchronized(lockI) {
>                        iVal = newValue;
>                }
>        }
>
>        public void setF(LockGraphTest lgt) {
>                synchronized(lockF) {
>                        fVal = (int) lgt.getF();
>                }
>        }
>
>        public float getF() {
>                synchronized(lockF) {
>                        return fVal;
>                }
>        }
>
>
>        public static void main(String[] args) {
>                LockGraphTest lgtF = new LockGraphTest();
>                lgtF.setI(7);
>
>                LockGraphTest lgtI = new LockGraphTest();
>                lgtI.setI(5);
>                lgtI.setI(6);
>                lgtI.setF(lgtF);
>        }
> }
>
> On Thursday 27 November 2008 15:39:35 Eric Bodden wrote:
>> Marco does this happen when you apply Soot to any application or only
>> if you apply it to one special program? In the latter case it would
>> help to know what program that would be.
>>
>> Cheers,
>> Eric
>>
>> 2008/11/27 Marco Bakera <marco.bakera at tu-dortmund.de>:
>> > On Monday 10 November 2008 19:42:52 Richard L. Halpert wrote:
>> >> 1) The LockAllocator uses a may-alias relationship to group locks
>> >> together - so if lock1 in *may* be the same as lock2, they would be
>> >> treated as a single lock (and the two critical sections would be put in
>> >> the same CriticalSectionGroup).  The Lock allocator constructs this
>> >> graph for the sake of deadlock detection.  You can use the deadlock
>> >> detection graph by calling
>> >> soot.jimple.toolkits.thread.synchronization.LockAllocation.getDeadlockGr
>> >>aph (). The nodes are CriticalSectionGroups, and the edges represent
>> >> calls from a critical section in one group to a critical section in
>> >> another group.  Be sure to call Soot with "-p wjtp.tn
>> >> avoid-deadlock:false", or else the deadlock detector may stop
>> >> constructing the graph early if it finds potential deadlock.
>> >
>> > That sounds great and I will use this. :) Thanks for that hint. However
>> > when trying the following lines of code.
>> >
>> >                String args =
>> >                        "-w --app " +
>> >                        // options for call graph creation
>> >                        "-p cg.cha enabled:false " +
>> >                        "-p cg.spark enabled:true " +
>> >                        // options for whole jimple transformation pack
>> >                        "-p wjtp.tn enabled:true " +
>> >                        "-p wjtp.tn avoid-deadlock:false " +
>> >                        "-p wjtp.tn do-tlo:false " +
>> >                        "-p wjtp.tn do-mhp:true " +
>> >                        // the main application class
>> >                        mainClass.getName();
>> >
>> >                // start soot
>> >                LOG.debug("Starting Soot with command line: "+args);
>> >                Main.main(args.split(" "));
>> >
>> > I get the following exception from the main method:
>> >
>> > java.lang.RuntimeException: trying to hash null value.
>> >        at soot.util.HashChain.getPredOf(HashChain.java:338)
>> >        at soot.PatchingChain.getPredOf(PatchingChain.java:225)
>> >        at
>> > soot.toolkits.graph.ExceptionalUnitGraph.buildExceptionDests(ExceptionalU
>> >nitGraph.java:337) at
>> > soot.toolkits.graph.ExceptionalUnitGraph.initialize(ExceptionalUnitGraph.
>> >java:263) at
>> > soot.toolkits.graph.ExceptionalUnitGraph.<init>(ExceptionalUnitGraph.java
>> >:149) at
>> > soot.toolkits.graph.ExceptionalUnitGraph.<init>(ExceptionalUnitGraph.java
>> >:182) at
>> > soot.toolkits.scalar.LocalSplitter.internalTransform(LocalSplitter.java:7
>> >7) at soot.BodyTransformer.transform(BodyTransformer.java:51) at
>> > soot.Transform.apply(Transform.java:104)
>> >        at soot.JimpleBodyPack.applyPhaseOptions(JimpleBodyPack.java:57)
>> >        at soot.JimpleBodyPack.internalApply(JimpleBodyPack.java:89)
>> >        at soot.Pack.apply(Pack.java:124)
>> >        at
>> > soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:117) at
>> > soot.SootMethod.getBodyFromMethodSource(SootMethod.java:82) at
>> > soot.SootMethod.retrieveActiveBody(SootMethod.java:329) at
>> > soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processNewMethod(OnF
>> >lyCallGraphBuilder.java:181) at
>> > soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processReachables(On
>> >FlyCallGraphBuilder.java:81) at
>> > soot.jimple.spark.solver.OnFlyCallGraph.build(OnFlyCallGraph.java:55) at
>> > soot.jimple.spark.solver.PropWorklist.handleVarNode(PropWorklist.java:123
>> >) at soot.jimple.spark.solver.PropWorklist.propagate(PropWorklist.java:53)
>> > at
>> > soot.jimple.spark.SparkTransformer.internalTransform(SparkTransformer.jav
>> >a:151) at soot.SceneTransformer.transform(SceneTransformer.java:39) at
>> > soot.Transform.apply(Transform.java:89)
>> >        at soot.RadioScenePack.internalApply(RadioScenePack.java:57)
>> >        at
>> > soot.jimple.toolkits.callgraph.CallGraphPack.internalApply(CallGraphPack.
>> >java:47) at soot.Pack.apply(Pack.java:114)
>> >        at soot.PackManager.runWholeProgramPacks(PackManager.java:406)
>> >        at soot.PackManager.runPacks(PackManager.java:327)
>> >        at soot.Main.run(Main.java:202)
>> >        at soot.Main.main(Main.java:145)
>> >
>> > The problem is only present when using the development version of Soot
>> > from the SVN repository. Release 2.3.0 has no problems. However, the
>> > method to obtain the Deadlock Graph is not present there. :)
>> >
>> > Thanks for your help.
>> >
>> >
>> >
>> > Greetings,
>> > Marco.
>



-- 
Eric Bodden
Sable Research Group, McGill University, Montréal, Canada
Got an interesting job offer? http://www.bodden.de/hire-me/


More information about the Soot-list mailing list