Running DaCapo with Chord

224 views
Skip to first unread message

Aritra Sengupta

unread,
Sep 24, 2013, 10:02:07 PM9/24/13
to chord-...@googlegroups.com
Hi,

  I am trying to generate a data-race report for the DaCapo benchmarks statically and later use it to modify the instrumentation in my current project which aims to enforce SC in software (using a combination of static and dynamic analysis), implemented in JikesRVM. To start with I am trying to feed the bytecode of avrora ( a DaCapo benchmark) to Chord. Please find attached the output of avrora through Chord , and the output of the toy example given in the Chord documentation. Avrora reports zero data-races and the build time suggests it's not processing the byte code extensively. From the log I am trying to figure out some of the details to understand what it is processing in each step so that I can figure out to what extent Chord is processing the byte code. Could you please provide some suggestions on the same  regarding the details in the log or in general running Chord with the benchmarks in DaCapo from an end-user's perspective? 


Thanks,
Aritra Sengupta.
PhD student.
Ohio State University.
seng...@cse.ohio-state.edu
avrora_log.txt
toyoutput.txt

Mayur Naik

unread,
Sep 24, 2013, 10:11:11 PM9/24/13
to chord-discuss
The most likely problem seems to be that Chord cannot figure that the Thread.start() method is reachable from the main() method of avrora.  This in turn causes Chord to conclude that avrora is single-threaded, and hence there are no dataraces.  Notice the size of domain A in your log:

[java] SAVING dom A size: 2

It should be greater than 2 if indeed Thread.start() is reachable from main(), as in the case of the toy example.  Are you certain that avrora calls Thread.start()?  If so, there is some unsoundness in Chord that is preventing it from detecting such calls as unreachable.  The most common reason for unsoundness is reflection.  You might want to run Chord with the option "-Dchord.reflect.kind=dynamic".  Read the tutorial, user guide, or source code for more information about this option.

-- Mayur

-- Mayur


--
You received this message because you are subscribed to the Google Groups "chord-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chord-discus...@googlegroups.com.
To post to this group, send email to chord-...@googlegroups.com.
Visit this group at http://groups.google.com/group/chord-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

Aritra Sengupta

unread,
Sep 30, 2013, 11:40:57 AM9/30/13
to chord-...@googlegroups.com
Hi Mayur,
               Thanks for the response. To resolve reflection I am trying the dynamic option for the chord.reflect.kind property. After setting the arguments for DaCapo correctly (chord.args.0=-s large -n 1 avrora) and the main class of the benchmark, I am getting the following chord.util.ReadException. Could you please provide some suggestions on the same ?


chord-src-2.0]$ ant  -Dchord.work.dir=/home/sengupta/RunChord/out/ -Dchord.props.file=/home/sengupta/staticrace/chord-src-2.0/chord.properties -Dchord.run.analyses=datarace-java run
Buildfile: build.xml

run:
     [java] Chord run initiated at: Sep 30, 2013 11:33:35 AM
     [java] ENTER: datarace-java at Mon Sep 30 11:33:35 EDT 2013
     [java] ENTER: P at Mon Sep 30 11:33:35 EDT 2013
     [java] ENTER: M at Mon Sep 30 11:33:35 EDT 2013
     [java] ENTER: RTA
     [java] INFO: BasicDynamicAnalysis: Starting Run ID 0 in traced regular-file online-instrumentation non-JVMTI mode.
     [java] Starting command: 'java -ea -Xmx1024m -Xverify:none -Dchord.classic=true -Dchord.use.jvmti=false -Dchord.run.analyses=datarace-java -Dchord.src.path=/home/sengupta/RunChord/dacapo-9.12-bach-src/benchmarks/bms/pmd/src/org/dacapo/harness -Dchord.main.dir=/home/sengupta/staticrace/chord-src-2.0 -Dchord.props.file=/home/sengupta/staticrace/chord-src-2.0/chord.properties -Dchord.max.heap=2g -Dchord.work.dir=/home/sengupta/RunChord/out -Dchord.args.0=-s large -n 1 avrora -Dchord.dlog.analysis.path=/home/sengupta/staticrace/chord-src-2.0/chord.jar -Dchord.ext.dlog.analysis.path= -Dchord.use.buddy=false -Dchord.std.java.analysis.path=/home/sengupta/staticrace/chord-src-2.0/chord.jar -Dchord.class.path=./dacapo-9.12-bach -Dchord.ext.java.analysis.path= -Dchord.main.class=Harness -Dchord.reflect.kind=dynamic -Dchord.jvmargs=-ea -Xmx2g -Xss32m -Dchord.java.analysis.path=/home/sengupta/staticrace/chord-src-2.0/chord.jar -Dchord.max.stack=32m -Dchord.std.dlog.analysis.path=/home/sengupta/staticrace/chord-src-2.0/chord.jar -cp ./dacapo-9.12-bach -javaagent:/home/sengupta/staticrace/chord-src-2.0/chord.jar=instrumentor_class=chord/program/reflect/ReflectInstrumentor=event_handler_args=trace_block_size@4096@trace_file@/home/sengupta/RunChord/out/chord_output/trace_full_ver0.txt=event_handler_class=chord.program.reflect.ReflectEventHandler=use_jvmti=false Harness -s large -n 1 avrora '
     [java] WARN: Instrumentor: Ignoring path element /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/sunrsasign.jar from boot classpath
     [java] WARN: Instrumentor: Ignoring path element /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/netx.jar from boot classpath
     [java] WARN: Instrumentor: Ignoring path element /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/plugin.jar from boot classpath
     [java] WARN: Instrumentor: Ignoring path element /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/modules/jdk.boot.jar from boot classpath
     [java] ===== DaCapo unknown avrora starting =====
     [java] ===== DaCapo unknown avrora PASSED in 22344 msec =====
     [java] Finished command: 'java -ea -Xmx1024m -Xverify:none -Dchord.classic=true -Dchord.use.jvmti=false -Dchord.run.analyses=datarace-java -Dchord.src.path=/home/sengupta/RunChord/dacapo-9.12-bach-src/benchmarks/bms/pmd/src/org/dacapo/harness -Dchord.main.dir=/home/sengupta/staticrace/chord-src-2.0 -Dchord.props.file=/home/sengupta/staticrace/chord-src-2.0/chord.properties -Dchord.max.heap=2g -Dchord.work.dir=/home/sengupta/RunChord/out -Dchord.args.0=-s large -n 1 avrora -Dchord.dlog.analysis.path=/home/sengupta/staticrace/chord-src-2.0/chord.jar -Dchord.ext.dlog.analysis.path= -Dchord.use.buddy=false -Dchord.std.java.analysis.path=/home/sengupta/staticrace/chord-src-2.0/chord.jar -Dchord.class.path=./dacapo-9.12-bach -Dchord.ext.java.analysis.path= -Dchord.main.class=Harness -Dchord.reflect.kind=dynamic -Dchord.jvmargs=-ea -Xmx2g -Xss32m -Dchord.java.analysis.path=/home/sengupta/staticrace/chord-src-2.0/chord.jar -Dchord.max.stack=32m -Dchord.std.dlog.analysis.path=/home/sengupta/staticrace/chord-src-2.0/chord.jar -cp ./dacapo-9.12-bach -javaagent:/home/sengupta/staticrace/chord-src-2.0/chord.jar=instrumentor_class=chord/program/reflect/ReflectInstrumentor=event_handler_args=trace_block_size@4096@trace_file@/home/sengupta/RunChord/out/chord_output/trace_full_ver0.txt=event_handler_class=chord.program.reflect.ReflectEventHandler=use_jvmti=false Harness -s large -n 1 avrora '
     [java] chord.util.ReadException
     [java] at chord.util.ByteBufferedFile.getByte(ByteBufferedFile.java:99)
     [java] at chord.util.ByteBufferedFile.getString(ByteBufferedFile.java:165)
     [java] at chord.program.reflect.DynamicReflectResolver.handleEvent(DynamicReflectResolver.java:91)
     [java] at chord.project.analyses.BasicDynamicAnalysis.processTrace(BasicDynamicAnalysis.java:524)
     [java] at chord.project.analyses.BasicDynamicAnalysis$1.run(BasicDynamicAnalysis.java:379)
     [java] at chord.util.Executor.execute(Executor.java:56)
     [java] at chord.project.analyses.BasicDynamicAnalysis.run(BasicDynamicAnalysis.java:400)
     [java] at chord.program.RTA.build(RTA.java:205)
     [java] at chord.program.RTA.getMethods(RTA.java:168)
     [java] at chord.program.Program.buildMethods(Program.java:179)
     [java] at chord.program.Program.getMethod(Program.java:449)
     [java] at chord.program.Program.getMethod(Program.java:440)
     [java] at chord.program.Program.getMainMethod(Program.java:458)
     [java] at chord.analyses.method.DomM.init(DomM.java:44)
     [java] at chord.project.analyses.ProgramDom.run(ProgramDom.java:49)
     [java] at chord.project.ClassicProject.runTask(ClassicProject.java:416)
     [java] at chord.project.ClassicProject.runTask(ClassicProject.java:413)
     [java] at chord.project.ClassicProject.runTask(ClassicProject.java:413)
     [java] at chord.project.ClassicProject.runTask(ClassicProject.java:437)
     [java] at chord.project.ClassicProject.run(ClassicProject.java:141)
     [java] at chord.project.Main.run(Main.java:88)
     [java] at chord.project.Main.main(Main.java:55)


Thanks,
Aritra.
Message has been deleted

Mayur Naik

unread,
Oct 4, 2013, 2:11:36 PM10/4/13
to chord-discuss

The dynamic analysis infrastructure in chord is quite intricate with many options to configure it. I suggest you read the documentation and code to figure and try different options. Even consider switching the jvm you are using.

On Oct 4, 2013 1:45 PM, "Aritra Sengupta" <aritra...@gmail.com> wrote:

I have added some sysouts (in method : chord.project.analyses.BasicDynamicAnalysis.processTrace) to check if the file trace_full_ver0.txt  has content which is getting processed. The file does not have any content after the dynamic option runs the benchmark to record reflection.

--

Aritra Sengupta

unread,
Oct 25, 2013, 2:14:03 PM10/25/13
to chord-...@googlegroups.com
Hi Mayur,
                I have modified Chord to resolve the ReadException with DaDapo, now DaCapo trace with the 'dynamic' option to resolve reflection runs without exceptions but still yields no data races. To investigate the same, I modified the microbenchmark under chord-src-2.0/examples/datarace_test/src/test to have getters which are reflective calls to the B class  to check if the dynamic option can resolve reflection and report races due to the read operation inside the getter. I modified the T class in this microbenchmark appropriately. The page dataraces_by_fld.html now does not show the race on test.A.af variable because of the get() and set() methods, it just shows races for the set methods (but the console shows that the getter: getReflect() in B has been called just like the get() in the unmodified microbenchmark ). This testcase is a scenario where reflection is not resolved properly using the dynamic option. I think for similar reasons the DaCapo reports no races.

Could you please provide some suggestions on the same. The test case can be replicated very easily using the following :

The tar file chord-dacapo.tar is here.: http://www.cse.ohio-state.edu/~sengupta/chord/
under the folder chord-src-2.0 running the comman :ant -Dchord.work.dir=examples/datarace_test/ -Dchord.props.file=examples/datarace_test/chord.properties -Dchord.run.analyses=datarace-java run > ReflectionChord.txt will give above mentioned test case.
The modified source is under: chord-dacapo/chord-src-2.0/examples/datarace_test/src/test.

Thanks,
Aritra Sengupta.
PhD Student,
Ohio State University.

Aritra Sengupta

unread,
Nov 26, 2013, 8:22:54 PM11/26/13
to chord-...@googlegroups.com
Hi,
     We noticed that the open source pjbench project : https://code.google.com/p/pjbench/ has the necessary changes to the harness for the DaCapo benchmarks. It creates a customized harness per benchmark for Chord, which removes the reflective call and directly calls the main method of the corresponding benchmark. Chord reports races on these modified DaCapo benchmarks. We are using the same.

Thanks,
Aritra Sengupta.

Mayur Naik

unread,
Nov 27, 2013, 7:39:27 PM11/27/13
to chord-discuss, aritra...@gmail.com
That is fine, but there is other reflection lurking in some dacapo benchmarks (e.g., hsqldb) that if unresolved, can cause large parts of the benchmark to be excluded.  One way to detect this is to look out for suspiciously small call graphs.  Chord has various options for resolving such reflection; we typically use the -Dchord.reflect.kind=dynamic option, which runs the benchmark on a test input to resolve reflection.

-- Mayur

Aritra Sengupta

unread,
Feb 8, 2014, 6:53:20 PM2/8/14
to chord-...@googlegroups.com, aritra...@gmail.com
We have been using the open source pjbench project : https://code.google.com/p/pjbench/ to run chord on DaCapo. While doing the same for jython, I could not find the changes to Harness or the ChordHarness.java file. Is there an issue with jython ? Otherwise could you please point me to the modified  harness for jython. While doing the change myself I ran into an issue.

Thanks,
Aritra Sengupta.
Ohio State University.

Aritra Sengupta

unread,
Feb 17, 2014, 12:49:54 PM2/17/14
to Mayur Naik, chord-discuss
Hi Mayur,
              We have fixed the jython issue. A line was commented out in Benchamark.java of the PJBench project and was there in the DaCapo original code: "loader = DacapoClassLoader.create(config, scratch)." This is required for Jython to work with the "dynamic" option to resolve reflective calls.


Thanks,
Aritra.


On Tue, Feb 11, 2014 at 6:21 PM, Mayur Naik <na...@cc.gatech.edu> wrote:
Hi Aritra,

We wrote the harness manually for 12 Dacapo benchmarks that were enough for our purposes.  Jython was not one of them but you could try doing it yourself for it.  The process of adding this harness is fairly straightforward.  For instance, there is a .cnf file that you need to look at to figure out the main class of the benchmark.

-- Mayur
Reply all
Reply to author
Forward
0 new messages