-
Notifications
You must be signed in to change notification settings - Fork 9
/
patomicity.xml
289 lines (269 loc) · 12.3 KB
/
patomicity.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<?xml version="1.0" encoding="UTF-8"?>
<project name="javato" default="usage">
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="lib/ant-contrib.jar"/>
</classpath>
</taskdef>
<property name="javato.home.dir" location="."/>
<property name="benchdir" location="src/benchmarks"/>
<property name="javabenchdir" location="../java_bench"/>
<property name="tmpdir" location="./tmp"/>
<target name="clean">
<!--
Required poperties:
javato.work.dir
-->
<fail unless="javato.work.dir"/>
<delete dir="${tmpdir}"/>
<delete dir="${javato.work.dir}/tmpclasses"/>
<delete dir="${javato.work.dir}/tmpbootclasses"/>
<delete file="${javato.work.dir}/javato.usedids"/>
<delete file="${javato.work.dir}/iidToLine.map"/>
<delete file="${javato.work.dir}/iidToLine.map.html"/>
<delete file="${javato.work.dir}/error.log"/>
<delete file="${javato.work.dir}/error.list"/>
<delete file="${javato.work.dir}/error.stat"/>
<delete file="${javato.work.dir}/error.stall"/>
<delete file="${javato.work.dir}/error.time"/>
<delete file="${javato.work.dir}/atomicity_data.out"/>
</target>
<target name="instr" description="run instrumentor" depends="clean">
<!--
Required poperties:
javato.work.dir
javato.app.main.class
Optional properties:
javato.app.instr.dir
javato.app.class.path
javato.app.boot.list
javato.instops
-->
<mkdir dir="${tmpdir}"/>
<fail unless="javato.work.dir"/>
<fail unless="javato.app.main.class"/>
<property name="javato.app.instr.dir" value=""/>
<property name="javato.app.class.path" value=""/>
<property name="javato.app.boot.list" value=""/>
<property name="javato.instops" value="-p jb use-original-names -validate"/>
<if>
<equals arg1="${javato.app.instr.dir}" arg2=""/>
<then>
<property name="javato_instops" value="${javato.instops}"/>
<path id="javato_app_class_path">
<pathelement path="${javato.app.class.path}"/>
</path>
</then>
<else>
<property name="javato_instops"
value="${javato.instops} -process-dir ${javato.app.instr.dir}"/>
<path id="javato_app_class_path">
<pathelement location="${javato.app.instr.dir}"/>
<pathelement path="${javato.app.class.path}"/>
</path>
</else>
</if>
<java classname="javato.activetesting.instrumentor.InstrumentorForActiveTesting"
fork="true" dir="${javato.work.dir}" maxmemory="2048m">
<arg value="-keep-line-number"/>
<arg line="${javato_instops}"/>
<arg value="-no-output-inner-classes-attribute"/>
<arg value="-d"/>
<arg file="${javato.work.dir}/tmpclasses"/>
<arg value="-x"/>
<arg value="javato"/>
<arg value="--app"/>
<arg line="${javato.app.main.class}"/>
<syspropertyset>
<propertyref builtin="all"/>
</syspropertyset>
<classpath>
<pathelement location="${javato.home.dir}/classes"/>
<pathelement location="${javato.home.dir}/lib/sootall-2.3.0.jar"/>
<path refid="javato_app_class_path"/>
</classpath>
</java>
<if>
<not>
<equals arg1="${javato.app.boot.list}" arg2=""/>
</not>
<then>
<mkdir dir="${javato.work.dir}/tmpbootclasses"/>
<for param="bootitem" list="${javato.app.boot.list}">
<sequential>
<var name="srcdir"
value="${javato.work.dir}/tmpclasses/@{bootitem}"/>
<var name="dstdir"
value="${javato.work.dir}/tmpbootclasses/@{bootitem}"/>
<mkdir dir="${dstdir}"/>
<move todir="${dstdir}">
<fileset dir="${srcdir}"/>
</move>
</sequential>
</for>
</then>
</if>
</target>
<target name="analysis-once" description="run analysis once">
<fail unless="javato.work.dir"/>
<fail unless="javato.app.main.class"/>
<fail unless="javato.activetesting.analysis.class"/>
<property name="javato.app.args" value=""/>
<property name="javato.app.class.path" value=""/>
<if>
<available file="${javato.work.dir}/tmpbootclasses"/>
<then>
<property name="jvm_args"
value="-ea -Xbootclasspath/p:tmpbootclasses:${javato.home.dir}/classes"/>
</then>
<else>
<property name="jvm_args" value="-ea"/>
</else>
</if>
<stopwatch name="timer" action="start"/>
<java classname="${javato.app.main.class}"
fork="true" dir="${javato.work.dir}" maxmemory="1024m">
<arg line="${javato.app.args}"/>
<jvmarg line="${jvm_args}"/>
<!-- <sysproperty key="javato.deadlock.goodlock" value="false"/> -->
<syspropertyset>
<propertyref builtin="all"/>
</syspropertyset>
<classpath>
<pathelement location="${javato.work.dir}/tmpclasses"/>
<pathelement path="${javato.app.class.path}"/>
<pathelement location="${javato.home.dir}/classes"/>
</classpath>
</java>
<stopwatch name="timer" action="total"/>
<echo message="${timer}${line.separator}"
file="${javato.work.dir}/error.time" append="true"/>
</target>
<target name="predictest-loop" description="run predictest repeatedly">
<fail unless="javato.activetesting.trialnum.list"/>
<fail unless="javato.activetesting.errorlist.file"/>
<fail if="javato.activetesting.errornum"/>
<fail if="javato.activetesting.errorlist"/>
<loadfile property="javato.activetesting.errorlist"
srcFile="${javato.activetesting.errorlist.file}">
<filterchain>
<striplinebreaks/>
</filterchain>
</loadfile>
<if>
<isset property="javato.activetesting.errorlist"/>
<then>
<for param="trialnum" list="${javato.activetesting.trialnum.list}">
<sequential>
<echo message="Iteration: @{trialnum}"/>
<echo message="------------------"/>
<for param="errornum" list="${javato.activetesting.errorlist}">
<sequential>
<echo message="Error:Iteration = @{errornum}:@{trialnum}"/>
<echo message="------------------"/>
<antcall target="analysis-once">
<param name="javato.activetesting.errorid" value="@{errornum}"/>
</antcall>
<antcall target="analysis-once">
<param name="javato.activetesting.errorid" value="@{errornum}"/>
<param name="javato.race.resolve.order" value="true"/>
</antcall>
</sequential>
</for>
</sequential>
</for>
</then>
</if>
</target>
<target name="predictest-once" description="run predictest once">
<fail unless="javato.activetesting.errorid"/>
<antcall target="analysis-once"/>
<antcall target="analysis-once">
<param name="javato.race.resolve.order" value="true"/>
</antcall>
</target>
<target name="usage" description="print usage instructions">
<echo message="Welcome to CalFuzzer!"/>
<echo message="Use 'ant -p' to see all valid targets."/>
</target>
<target name="predictest-analysis" description="Run deterministic hybrid race (both lock and data) detector and predictest with 2 trials per potential error">
<property name="javato.ignore.methods" value="true"/>
<property name="javato.ignore.allocs" value="true"/>
<property name="javato.activetesting.trialnum.list" value="1,2"/>
<property name="javato.track.iid.visit.count" value="true"/>
<property name="javato.schedule.deterministic" value="true"/>
<property name="javato.hybrid.removeoldaccess" value="true"/>
<property name="javato.activetesting.errorlist.file" value="${javato.work.dir}/error.list"/>
<if>
<isset property="javato.activetesting.errorid"/>
<then>
<antcall target="predictest-once">
<param name="javato.activetesting.analysis.class" value="javato.activetesting.PredictestAnalysis"/>
</antcall>
</then>
<else>
<antcall target="instr"/>
<antcall target="analysis-once">
<param name="javato.activetesting.analysis.class" value="javato.activetesting.PAtomicityAnalysis"/>
</antcall>
<antcall target="predictest-loop">
<param name="javato.activetesting.analysis.class" value="javato.activetesting.PredictestAnalysis"/>
</antcall>
</else>
</if>
</target>
<target name="match.error.stat">
<fail>
<condition>
<not>
<filesmatch
file1="${javato.home.dir}/test/benchmarks/testcases/${test.output.file}"
file2="${javato.work.dir}/error.stat"/>
</not>
</condition>
</fail>
</target>
<!-- predictest test suite follows -->
<target name="test_atom1">
<echo message="no lock-based atomicity violation"/>
<property name="javato.work.dir" value="${tmpdir}"/>
<property name="javato.app.main.class" value="benchmarks.testcases.TestAtomicity1"/>
<antcall target="predictest-analysis"/>
</target>
<target name="test_atom15">
<echo message="1 atomicity violation"/>
<property name="javato.work.dir" value="${tmpdir}"/>
<property name="javato.app.main.class" value="benchmarks.testcases.TestAtomicity15"/>
<antcall target="predictest-analysis"/>
</target>
<target name="test_atom16">
<echo message="1 atomicity violation"/>
<property name="javato.work.dir" value="${tmpdir}"/>
<property name="javato.app.main.class" value="benchmarks.testcases.TestAtomicity16"/>
<antcall target="predictest-analysis"/>
</target>
<target name="test_atom17">
<echo message="2 atomicity violation(s)"/>
<property name="javato.work.dir" value="${tmpdir}"/>
<property name="javato.app.main.class" value="benchmarks.testcases.TestAtomicity17"/>
<antcall target="predictest-analysis"/>
</target>
<target name="test_atom18">
<echo message="1 atomicity violation(s)"/>
<property name="javato.work.dir" value="${tmpdir}"/>
<property name="javato.app.main.class" value="benchmarks.testcases.TestAtomicity18"/>
<antcall target="predictest-analysis"/>
</target>
<target name="test_atom19">
<echo message="3 atomicity violation(s)"/>
<property name="javato.work.dir" value="${tmpdir}"/>
<property name="javato.app.main.class" value="benchmarks.testcases.TestAtomicity19"/>
<antcall target="predictest-analysis"/>
</target>
<target name="test_atom20">
<echo message="3 atomicity violation(s)"/>
<property name="javato.work.dir" value="${tmpdir}"/>
<property name="javato.app.main.class" value="benchmarks.testcases.TestAtomicity20"/>
<antcall target="predictest-analysis"/>
</target>
</project>