Skip to content

Commit 9362e18

Browse files
authored
Merge pull request #1 from jon-bell/master
merge
2 parents 473b812 + 0fa605c commit 9362e18

22 files changed

Lines changed: 346 additions & 110 deletions

Code/ChroniclerJ/nondeterministic-methods.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31149,7 +31149,6 @@ com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.getDOMImpleme
3114931149
com/sun/xml/internal/xsom/util/NameGetter.modelGroup:(Lcom/sun/xml/internal/xsom/XSModelGroup;)Ljava/lang/Object;
3115031150
org/omg/DynamicAny/_DynStructStub.copy:()Lorg/omg/DynamicAny/DynAny;
3115131151
com/sun/org/apache/xerces/internal/dom/ElementNSImpl.setName:(Ljava/lang/String;Ljava/lang/String;)V
31152-
java/util/Random.<init>:()V
3115331152
javax/xml/stream/util/EventReaderDelegate.nextTag:()Ljavax/xml/stream/events/XMLEvent;
3115431153
com/sun/xml/internal/bind/v2/model/core/TypeInfoSet.dump:(Ljavax/xml/transform/Result;)V
3115531154
com/sun/org/apache/xml/internal/serializer/ToHTMLStream.startDTD:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

Code/ChroniclerJ/src/edu/columbia/cs/psl/chroniclerj/ChroniclerJExportRunner.java

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
public class ChroniclerJExportRunner extends Thread {
2222

23-
private static String mainClass;
23+
private static String mainClass = "";
2424

25-
private static String[] mainArgs;
25+
private static String[] mainArgs = new String[0];
2626

2727
private static ArrayList<String> serializableLogs = new ArrayList<>();
2828

@@ -35,12 +35,16 @@ public static void logMain(String main, String[] args) {
3535
System.arraycopy(args, 0, mainArgs, 0, args.length);
3636
}
3737

38-
public static void genTestCase() {
38+
public static void genTestCase()
39+
{
40+
genTestCase("chroniclerj-crash-" + System.currentTimeMillis() + ".test");
41+
}
42+
public static void genTestCase(String name) {
3943
export();
4044
exportSerializable();
4145
try {
4246

43-
File logFile = new File("chroniclerj-crash-" + System.currentTimeMillis() + ".test");
47+
File logFile = new File(name);
4448

4549
Manifest manifest = new Manifest();
4650
manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");
@@ -99,7 +103,8 @@ public static void genTestCase() {
99103
zos.flush();
100104
zos.close();
101105
System.out.println("Chroniclerj exported a test case");
102-
106+
serializableLogs.clear();
107+
otherLogs.clear();
103108
} catch (IOException e) {
104109
// TODO Auto-generated catch block
105110
e.printStackTrace();
@@ -149,6 +154,7 @@ public static void export() {
149154
ExportedLog.aLog = Log.aLog;
150155
ExportedLog.aLog_owners = Log.aLog_owners;
151156
ExportedLog.aLog_fill = Log.aLog_fill;
157+
ExportedLog.aLog_debug = Log.aLog_debug;
152158
Log.logsize = 0;
153159
Log.aLog = new Object[Constants.DEFAULT_LOG_SIZE];
154160
Log.aLog_fill = 0;
@@ -211,6 +217,16 @@ public static void exportSerializable() {
211217
ExportedSerializableLog.cLog_owners = SerializableLog.cLog_owners;
212218
ExportedSerializableLog.sLog_owners = SerializableLog.sLog_owners;
213219

220+
ExportedSerializableLog.aLog_debug = SerializableLog.aLog_debug;
221+
ExportedSerializableLog.iLog_debug = SerializableLog.iLog_debug;
222+
ExportedSerializableLog.jLog_debug = SerializableLog.jLog_debug;
223+
ExportedSerializableLog.fLog_debug = SerializableLog.fLog_debug;
224+
ExportedSerializableLog.dLog_debug = SerializableLog.dLog_debug;
225+
ExportedSerializableLog.bLog_debug = SerializableLog.bLog_debug;
226+
ExportedSerializableLog.zLog_debug = SerializableLog.zLog_debug;
227+
ExportedSerializableLog.cLog_debug = SerializableLog.cLog_debug;
228+
ExportedSerializableLog.sLog_debug = SerializableLog.sLog_debug;
229+
214230
SerializableLog.aLog = new Object[Constants.DEFAULT_LOG_SIZE];
215231
SerializableLog.iLog = new int[Constants.DEFAULT_LOG_SIZE];
216232
SerializableLog.jLog = new long[Constants.DEFAULT_LOG_SIZE];
@@ -229,6 +245,15 @@ public static void exportSerializable() {
229245
SerializableLog.zLog_owners = new String[Constants.DEFAULT_LOG_SIZE];
230246
SerializableLog.cLog_owners = new String[Constants.DEFAULT_LOG_SIZE];
231247
SerializableLog.sLog_owners = new String[Constants.DEFAULT_LOG_SIZE];
248+
SerializableLog.aLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
249+
SerializableLog.iLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
250+
SerializableLog.jLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
251+
SerializableLog.fLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
252+
SerializableLog.dLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
253+
SerializableLog.bLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
254+
SerializableLog.zLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
255+
SerializableLog.cLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
256+
SerializableLog.sLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
232257
SerializableLog.logsize = 0;
233258
SerializableLog.iLog_fill = 0;
234259
SerializableLog.jLog_fill = 0;

Code/ChroniclerJ/src/edu/columbia/cs/psl/chroniclerj/ExportedLog.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33

44
import java.util.HashMap;
55

6+
67
public class ExportedLog {
78
public static Object[] aLog = new Object[Constants.DEFAULT_LOG_SIZE];
89

910
public static String[] aLog_owners = new String[Constants.DEFAULT_LOG_SIZE];
1011

12+
public static String[] aLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
13+
14+
1115
public static int aLog_fill;
1216

1317
public static int globalReplayIndex = 0;
@@ -17,6 +21,7 @@ public class ExportedLog {
1721
public static void clearLog() {
1822
aLog = new Object[Constants.DEFAULT_LOG_SIZE];
1923
aLog_owners = new String[Constants.DEFAULT_LOG_SIZE];
24+
aLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
2025
aLog_fill = 0;
2126
globalReplayIndex = 0;
2227
}

Code/ChroniclerJ/src/edu/columbia/cs/psl/chroniclerj/ExportedSerializableLog.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,30 @@ public class ExportedSerializableLog implements Serializable {
7171
public static String[] cLog_owners = new String[Constants.DEFAULT_LOG_SIZE];
7272

7373
public static String[] sLog_owners = new String[Constants.DEFAULT_LOG_SIZE];
74+
75+
public static String[] aLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
76+
77+
public static String[] iLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
78+
79+
public static String[] jLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
80+
81+
public static String[] fLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
82+
83+
public static String[] dLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
84+
85+
public static String[] bLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
86+
87+
public static String[] zLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
88+
89+
public static String[] cLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
90+
91+
public static String[] sLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
7492

7593
public static void clearLog() {
7694
aLog = new Serializable[Constants.DEFAULT_LOG_SIZE];
7795
aLog_fill = 0;
96+
aLog_owners = new String[Constants.DEFAULT_LOG_SIZE];
97+
aLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
7898
}
7999

80100
private void writeObject(ObjectOutputStream oos) throws IOException {
@@ -107,6 +127,16 @@ private void writeObject(ObjectOutputStream oos) throws IOException {
107127
oos.writeObject(zLog_owners);
108128
oos.writeObject(cLog_owners);
109129
oos.writeObject(sLog_owners);
130+
131+
oos.writeObject(aLog_debug);
132+
oos.writeObject(iLog_debug);
133+
oos.writeObject(jLog_debug);
134+
oos.writeObject(fLog_debug);
135+
oos.writeObject(dLog_debug);
136+
oos.writeObject(bLog_debug);
137+
oos.writeObject(zLog_debug);
138+
oos.writeObject(cLog_debug);
139+
oos.writeObject(sLog_debug);
110140

111141
}
112142

@@ -140,6 +170,16 @@ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFound
140170
zLog_owners = (String[]) ois.readObject();
141171
cLog_owners = (String[]) ois.readObject();
142172
sLog_owners = (String[]) ois.readObject();
173+
174+
aLog_debug = (String[]) ois.readObject();
175+
iLog_debug = (String[]) ois.readObject();
176+
jLog_debug = (String[]) ois.readObject();
177+
fLog_debug = (String[]) ois.readObject();
178+
dLog_debug = (String[]) ois.readObject();
179+
bLog_debug = (String[]) ois.readObject();
180+
zLog_debug = (String[]) ois.readObject();
181+
cLog_debug = (String[]) ois.readObject();
182+
sLog_debug = (String[]) ois.readObject();
143183

144184
ExportedSerializableLog.aLog_replayIndex = new HashMap<String, Integer>();
145185
ExportedSerializableLog.iLog_replayIndex = new HashMap<String, Integer>();

Code/ChroniclerJ/src/edu/columbia/cs/psl/chroniclerj/Instrumenter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class Instrumenter {
5555

5656
private static final int PASS_OUTPUT = 1;
5757

58-
public static final boolean IS_DACAPO = true;
58+
public static final boolean IS_DACAPO = false;
5959

6060
private static int pass_number = 0;
6161

@@ -82,6 +82,7 @@ public static AnnotatedMethod getAnnotatedMethod(String owner, String name, Stri
8282
private static void analyzeClass(InputStream inputStream) {
8383
try {
8484
ClassNode analysisResult = ma.analyzeClass(new ClassReader(inputStream));
85+
inputStream.close();
8586
if (analysisResult == null) {
8687
logger.error("Null analysis result on this analysis");
8788
}
@@ -111,6 +112,7 @@ private static byte[] instrumentClass(InputStream is) {
111112
cr.accept(uidAdder, 0);
112113
byte[] b = cw.toByteArray();
113114
cr = new ClassReader(b);
115+
is.close();
114116
}
115117

116118
ClassWriter cw = new InstrumenterClassWriter(cr, ClassWriter.COMPUTE_MAXS

Code/ChroniclerJ/src/edu/columbia/cs/psl/chroniclerj/Log.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ public class Log {
99

1010
public static String[] aLog_owners = new String[Constants.DEFAULT_LOG_SIZE];
1111

12+
public static String[] aLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
13+
14+
1215
public static Lock logLock = new ReentrantLock();
1316

1417
public static int logsize = 0;
@@ -21,8 +24,21 @@ public static void clearLog() {
2124
logsize = 0;
2225
aLog = new Object[Constants.DEFAULT_LOG_SIZE];
2326
aLog_owners = new String[Constants.DEFAULT_LOG_SIZE];
27+
aLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
2428

2529
aLog_fill = 0;
2630

2731
}
32+
33+
// private static boolean hasRegisteredHook = false;
34+
// static {
35+
// if(!hasRegisteredHook){
36+
// hasRegisteredHook = true;
37+
// Runtime.getRuntime().addShutdownHook(new Thread(){
38+
// public void run(){
39+
// ChroniclerJExportRunner.genTestCase();
40+
// }
41+
// });
42+
// }
43+
// }
2844
}

Code/ChroniclerJ/src/edu/columbia/cs/psl/chroniclerj/SerializableLog.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,24 @@ public class SerializableLog implements Serializable {
4343

4444
public static String[] sLog_owners = new String[Constants.DEFAULT_LOG_SIZE];
4545

46+
public static String[] aLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
47+
48+
public static String[] iLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
49+
50+
public static String[] jLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
51+
52+
public static String[] fLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
53+
54+
public static String[] dLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
55+
56+
public static String[] bLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
57+
58+
public static String[] zLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
59+
60+
public static String[] cLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
61+
62+
public static String[] sLog_debug = new String[Constants.DEFAULT_LOG_SIZE];
63+
4664
public static int logsize = 0;
4765

4866
public static int aLog_fill, iLog_fill, jLog_fill, fLog_fill, dLog_fill, bLog_fill, zLog_fill,

0 commit comments

Comments
 (0)