]> The Tcpdump Group git mirrors - tcpdump/commit
child_cleanup: reap as many child processes as possible
authorDominique Martinet <[email protected]>
Fri, 21 Jan 2022 01:27:07 +0000 (10:27 +0900)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 12 Oct 2023 12:26:08 +0000 (14:26 +0200)
commit1ba8a3969162b356e8906b1b425c858ddf0e9a21
tree941a06a44fc98c8cc8f09a4ce42dd9702b3e02b5
parent9c7ab8f600578e6d04abdbcff1489e339421220b
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

(cherry picked from commit b5f0be2196d897c76144a5b90b168836df54d6fa)
tcpdump.c