diff options
author | Dominique Martinet <dominique.martinet@atmark-techno.com> | 2022-01-21 10:27:07 +0900 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2023-04-19 08:09:58 +0200 |
commit | b5f0be2196d897c76144a5b90b168836df54d6fa (patch) | |
tree | cd39c78b8f845185971286e09464050d123d7e53 | |
parent | 89b68e1a5fe131951858d7bcf71587ad7fa25846 (diff) | |
download | tcpdump-b5f0be2196d897c76144a5b90b168836df54d6fa.tar.gz |
child_cleanup: reap as many child processes as possible
Under load it's possible multiple child processes have been killed before
we start processing the SIGCHILD signal, leaving zombie processes behind
everytime we miss a process.
Reap as many processes as possible instead of assuming one handler
call = one process like we currently did.
Can be reproduced by running the following commands in parallel:
- tcpdump -i lo -w /tmp/test -C 1 -z /usr/bin/true
- iperf3 -s
- iperf3 -c localhost
-rw-r--r-- | tcpdump.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2836,7 +2836,7 @@ cleanup(int signo _U_) static void child_cleanup(int signo _U_) { - wait(NULL); + while (waitpid(-1, NULL, WNOHANG) >= 0); } #endif /* HAVE_FORK && HAVE_VFORK */ |