|
4 | 4 | import pexplicit.runtime.STATUS;
|
5 | 5 | import pexplicit.runtime.logger.PExplicitLogger;
|
6 | 6 | import pexplicit.runtime.logger.StatWriter;
|
| 7 | +import pexplicit.runtime.scheduler.Schedule; |
7 | 8 | import pexplicit.runtime.scheduler.explicit.ExplicitSearchScheduler;
|
8 |
| -import pexplicit.runtime.scheduler.replay.ReplayScheduler; |
| 9 | +import pexplicit.runtime.scheduler.replay.ReceiverQueueReplayer; |
| 10 | +import pexplicit.runtime.scheduler.replay.SenderQueueReplayer; |
9 | 11 | import pexplicit.utils.exceptions.BugFoundException;
|
10 | 12 | import pexplicit.utils.exceptions.MemoutException;
|
11 | 13 | import pexplicit.utils.monitor.MemoryMonitor;
|
@@ -99,21 +101,31 @@ private static void process(boolean resume) throws Exception {
|
99 | 101 | PExplicitGlobal.setResult(String.format("found cex of length %d", scheduler.getStepNumber()));
|
100 | 102 | PExplicitLogger.logStackTrace(e);
|
101 | 103 |
|
102 |
| - ReplayScheduler replayer = new ReplayScheduler(scheduler.schedule); |
103 |
| - PExplicitGlobal.setScheduler(replayer); |
| 104 | + SenderQueueReplayer senderQueueReplayer = new SenderQueueReplayer(scheduler.schedule); |
| 105 | + PExplicitGlobal.setScheduler(senderQueueReplayer); |
104 | 106 | try {
|
105 |
| - replayer.run(); |
106 |
| - } catch (NullPointerException | StackOverflowError | ClassCastException replayException) { |
107 |
| - PExplicitLogger.logStackTrace((Exception) replayException); |
108 |
| - throw new BugFoundException(replayException.getMessage(), replayException); |
109 |
| - } catch (BugFoundException replayException) { |
110 |
| - PExplicitLogger.logStackTrace(replayException); |
111 |
| - throw replayException; |
112 |
| - } catch (Exception replayException) { |
113 |
| - PExplicitLogger.logStackTrace(replayException); |
114 |
| - throw new Exception("Error when replaying the bug", replayException); |
| 107 | + senderQueueReplayer.run(); |
| 108 | + } catch (NullPointerException | StackOverflowError | ClassCastException | BugFoundException senderQueueException) { |
| 109 | + ReceiverQueueReplayer receiverQueueReplayer = new ReceiverQueueReplayer(senderQueueReplayer.getReceiverSemanticsSchedule()); |
| 110 | + PExplicitGlobal.setScheduler(receiverQueueReplayer); |
| 111 | + try { |
| 112 | + receiverQueueReplayer.run(); |
| 113 | + } catch (NullPointerException | StackOverflowError | ClassCastException receiverQueueException) { |
| 114 | + PExplicitLogger.logStackTrace((Exception) receiverQueueException); |
| 115 | + throw new BugFoundException(receiverQueueException.getMessage(), receiverQueueException); |
| 116 | + } catch (BugFoundException receiverQueueException) { |
| 117 | + PExplicitLogger.logStackTrace(receiverQueueException); |
| 118 | + throw receiverQueueException; |
| 119 | + } catch (Exception receiverQueueException) { |
| 120 | + PExplicitLogger.logStackTrace(receiverQueueException); |
| 121 | + throw new Exception("Error when replaying the bug in receiver queue semantics", receiverQueueException); |
| 122 | + } |
| 123 | + throw new Exception("Failed to replay bug in receiver queue semantics", e); |
| 124 | + } catch (Exception senderQueueException) { |
| 125 | + PExplicitLogger.logStackTrace(senderQueueException); |
| 126 | + throw new Exception("Error when replaying the bug in sender queue semantics", senderQueueException); |
115 | 127 | }
|
116 |
| - throw new Exception("Failed to replay bug", e); |
| 128 | + throw new Exception("Failed to replay bug in sender queue semantics", e); |
117 | 129 | } catch (InterruptedException e) {
|
118 | 130 | PExplicitGlobal.setStatus(STATUS.INTERRUPTED);
|
119 | 131 | throw new Exception("INTERRUPTED", e);
|
|
0 commit comments