diff options
author | Nils Bars <nils.bars@rub.de> | 2022-10-20 13:14:29 +0200 |
---|---|---|
committer | Nils Bars <nils.bars@rub.de> | 2022-10-20 18:08:07 +0200 |
commit | f84ea696606b3dd6ae40006e5efb9f178651e916 (patch) | |
tree | 3989c18c5f2705925d012b1ca4a6bd3bfa9f2c83 /src/afl-analyze.c | |
parent | 5ccf38941472bda9415d14edc4ecefaa43c79d67 (diff) | |
download | afl++-f84ea696606b3dd6ae40006e5efb9f178651e916.tar.gz |
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.
Diffstat (limited to 'src/afl-analyze.c')
-rw-r--r-- | src/afl-analyze.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/afl-analyze.c b/src/afl-analyze.c index a21f014f..f21acd7f 100644 --- a/src/afl-analyze.c +++ b/src/afl-analyze.c @@ -114,7 +114,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; } @@ -1115,7 +1115,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); read_initial_file(); @@ -1151,4 +1151,3 @@ int main(int argc, char **argv_orig, char **envp) { exit(0); } - |