Skip to content

Commit

Permalink
fix bug that made bad parses run really slow, and fixed fflush (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
timnewsham committed Aug 3, 2016
1 parent 45c877f commit 5a77962
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,14 @@ main(int argc, char **argv)
showSysRecArr(recs, nrecs);
}

if(filterCalls(filtCalls, nFiltCalls, recs, nrecs)) {
if(parseOk == 0 && filterCalls(filtCalls, nFiltCalls, recs, nrecs)) {
/* trace kernel code while performing syscalls */
startWork(0xffffffff81000000L, 0xffffffffffffffffL);
if(noSyscall) {
x = 0;
} else if(parseOk == 0) {
} else {
/* note: if this crashes, watcher will do doneWork for us */
x = doSysRecArr(recs, nrecs);
} else {
x = -1;
}
if (verbose) printf("syscall returned %ld\n", x);
} else {
Expand Down
2 changes: 1 addition & 1 deletion testAfl.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ runTest(char *fname, char *dat)
x = read(srv[0], &workpid, 4);
xperror(x != 4, "read pid");
printf("test running in pid %d\n", workpid);
fflush(stdout);
alarm(2);
do {
x = read(srv[0], &status, 4);
Expand Down Expand Up @@ -171,7 +172,6 @@ int main(int argc, char **argv)
for(i = 0; files[i] && !forceQuit; i++) {
gettimeofday(&now, NULL);
printf("Input from %s at time %ld.%06ld\n", files[i], (u_long)now.tv_sec, (u_long)now.tv_usec);
fflush(stdout);
runTest(files[i], 0);
}
if(i == 0)
Expand Down

0 comments on commit 5a77962

Please sign in to comment.