summaryrefslogtreecommitdiff
path: root/fuzz.c
diff options
context:
space:
mode:
authorRobert Swiecki <robert@swiecki.net>2019-01-30 11:50:18 +0100
committerRobert Swiecki <robert@swiecki.net>2019-01-30 11:50:18 +0100
commit98e2337238c5a49960c88f4c65823f5c088ffc53 (patch)
tree6b3546f71ab0414e2be50c01d6c0276ab048acaa /fuzz.c
parente2be7a962bad2ab1598b8ae1f55103968096c82c (diff)
downloadhonggfuzz-98e2337238c5a49960c88f4c65823f5c088ffc53.tar.gz
ALL: remove -p (pid), simplify the subproc state machine. NetBSD will stop working for some time, will be fixed in the coming days
Diffstat (limited to 'fuzz.c')
-rw-r--r--fuzz.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fuzz.c b/fuzz.c
index 17e6aa64..d3e2219d 100644
--- a/fuzz.c
+++ b/fuzz.c
@@ -349,7 +349,6 @@ static bool fuzz_fetchInput(run_t* run) {
}
static void fuzz_fuzzLoop(run_t* run) {
- run->pid = 0;
run->timeStartedMillis = 0;
run->crashFileName[0] = '\0';
run->pc = 0;
@@ -360,7 +359,8 @@ static void fuzz_fuzzLoop(run_t* run) {
run->mainWorker = true;
run->mutationsPerRun = run->global->mutate.mutationsPerRun;
run->dynamicFileSz = 0;
- run->dynamicFileCopyFd = -1,
+ run->dynamicFileCopyFd = -1;
+ run->tmOutSignaled = false;
run->linux.hwCnts.cpuInstrCnt = 0;
run->linux.hwCnts.cpuBranchCnt = 0;
@@ -395,7 +395,8 @@ static void fuzz_fuzzLoopSocket(run_t* run) {
run->mainWorker = true;
run->mutationsPerRun = run->global->mutate.mutationsPerRun;
run->dynamicFileSz = 0;
- run->dynamicFileCopyFd = -1,
+ run->dynamicFileCopyFd = -1;
+ run->tmOutSignaled = false;
run->linux.hwCnts.cpuInstrCnt = 0;
run->linux.hwCnts.cpuBranchCnt = 0;
@@ -422,7 +423,6 @@ static void fuzz_fuzzLoopSocket(run_t* run) {
/* Fuzzer could not connect to target, and told us to
restart it. Do it on the next iteration. */
LOG_D("------[ 2.1: Target down, will restart it");
- run->hasCrashed = true;
return;
}
@@ -445,7 +445,6 @@ static void* fuzz_threadNew(void* arg) {
run_t run = {
.global = hfuzz,
.pid = 0,
- .persistentPid = 0,
.dynfileqCurrent = NULL,
.dynamicFile = NULL,
.dynamicFileFd = -1,
@@ -453,9 +452,6 @@ static void* fuzz_threadNew(void* arg) {
.persistentSock = -1,
.tmOutSignaled = false,
.origFileName = "[DYNAMIC]",
-
- .linux.attachedPid = 0,
- .netbsd.attachedPid = 0,
};
/* Do not try to handle input files with socketfuzzer */
@@ -510,6 +506,10 @@ static void* fuzz_threadNew(void* arg) {
}
}
+ if (run.pid) {
+ kill(run.pid, SIGKILL);
+ }
+
LOG_I("Terminating thread no. #%" PRId32 ", left: %zu", fuzzNo,
hfuzz->threads.threadsMax - run.global->threads.threadsFinished);
ATOMIC_POST_INC(run.global->threads.threadsFinished);