mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-19 04:58:08 +00:00
Fix child reaping on fuzzer termination
This commit contains the following changes: - Call `waitpid()` on the child and the fork server when terminating the fuzzer; thus, we do not end up with zombies. - Rename `fsrv.kill_signal` to `fsrv.child_kill_signal`, since the documentation states that the signal is used to terminate the *child*. - Use SIGTERM instead of fsrv.(child)_kill_signal, thus the fork server can always reap the child.
This commit is contained in:
@ -113,7 +113,7 @@ static void kill_child() {
|
||||
|
||||
if (fsrv->child_pid > 0) {
|
||||
|
||||
kill(fsrv->child_pid, fsrv->kill_signal);
|
||||
kill(fsrv->child_pid, fsrv->child_kill_signal);
|
||||
fsrv->child_pid = -1;
|
||||
|
||||
}
|
||||
@ -1195,7 +1195,7 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
|
||||
}
|
||||
|
||||
fsrv->kill_signal =
|
||||
fsrv->child_kill_signal =
|
||||
parse_afl_kill_signal_env(getenv("AFL_KILL_SIGNAL"), SIGKILL);
|
||||
|
||||
if (getenv("AFL_CRASH_EXITCODE")) {
|
||||
@ -1351,4 +1351,3 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
exit(0);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user