subproc.c (honggfuzz-2.4) | : | subproc.c (honggfuzz-2.5) | ||
---|---|---|---|---|
skipping to change at line 208 | skipping to change at line 208 | |||
_HF_INPUT_FILE_PATH); | _HF_INPUT_FILE_PATH); | |||
run->args[x] = argData; | run->args[x] = argData; | |||
} else { | } else { | |||
run->args[x] = (char*)run->global->exe.cmdline[x]; | run->args[x] = (char*)run->global->exe.cmdline[x]; | |||
} | } | |||
} | } | |||
run->args[x] = NULL; | run->args[x] = NULL; | |||
} | } | |||
static bool subproc_PrepareExecv(run_t* run) { | static bool subproc_PrepareExecv(run_t* run) { | |||
util_ParentDeathSigIfAvail(SIGKILL); | ||||
/* | /* | |||
* The address space limit. If big enough - roughly the size of RAM used | * The address space limit. If big enough - roughly the size of RAM used | |||
*/ | */ | |||
#ifdef RLIMIT_AS | #ifdef RLIMIT_AS | |||
if (run->global->exe.asLimit) { | if (run->global->exe.asLimit) { | |||
const struct rlimit rl = { | const struct rlimit rl = { | |||
.rlim_cur = run->global->exe.asLimit * 1024ULL * 1024ULL, | .rlim_cur = run->global->exe.asLimit * 1024ULL * 1024ULL, | |||
.rlim_max = run->global->exe.asLimit * 1024ULL * 1024ULL, | .rlim_max = run->global->exe.asLimit * 1024ULL * 1024ULL, | |||
}; | }; | |||
if (setrlimit(RLIMIT_AS, &rl) == -1) { | if (setrlimit(RLIMIT_AS, &rl) == -1) { | |||
skipping to change at line 522 | skipping to change at line 524 | |||
void subproc_checkTimeLimit(run_t* run) { | void subproc_checkTimeLimit(run_t* run) { | |||
if (!run->global->timing.tmOut) { | if (!run->global->timing.tmOut) { | |||
return; | return; | |||
} | } | |||
int64_t curUSecs = util_timeNowUSecs(); | int64_t curUSecs = util_timeNowUSecs(); | |||
int64_t diffUSecs = curUSecs - run->timeStartedUSecs; | int64_t diffUSecs = curUSecs - run->timeStartedUSecs; | |||
if (run->tmOutSignaled && (diffUSecs > ((run->global->timing.tmOut + 1) * 10 00000))) { | if (run->tmOutSignaled && (diffUSecs > ((run->global->timing.tmOut + 1) * 10 00000))) { | |||
/* Has this instance been already signaled due to timeout? Just, SIGKILL it */ | /* Has this instance been already signaled due to timeout? Just, SIGKILL it */ | |||
LOG_W("pid=%d has already been signaled due to timeout. Killing it with | LOG_W("pid=%d has already been signaled due to timeout. Killing it with | |||
SIGKILL", run->pid); | SIGKILL", | |||
(int)run->pid); | ||||
kill(run->pid, SIGKILL); | kill(run->pid, SIGKILL); | |||
return; | return; | |||
} | } | |||
if ((diffUSecs > (run->global->timing.tmOut * 1000000)) && !run->tmOutSignal ed) { | if ((diffUSecs > (run->global->timing.tmOut * 1000000)) && !run->tmOutSignal ed) { | |||
run->tmOutSignaled = true; | run->tmOutSignaled = true; | |||
LOG_W("pid=%d took too much time (limit %ld s). Killing it with %s", (in t)run->pid, | LOG_W("pid=%d took too much time (limit %ld s). Killing it with %s", (in t)run->pid, | |||
(long)run->global->timing.tmOut, | (long)run->global->timing.tmOut, | |||
run->global->timing.tmoutVTALRM ? "SIGVTALRM" : "SIGKILL"); | run->global->timing.tmoutVTALRM ? "SIGVTALRM" : "SIGKILL"); | |||
if (run->global->timing.tmoutVTALRM) { | if (run->global->timing.tmoutVTALRM) { | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 5 lines changed or added |