Subject: bin/35227: /bin/sh does not clean up zombies under certain circumstances
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <rillig@NetBSD.org>
List: netbsd-bugs
Date: 12/10/2006 13:35:00
>Number:         35227
>Category:       bin
>Synopsis:       /bin/sh does not clean up zombies under certain circumstances
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 10 13:35:00 +0000 2006
>Originator:     Roland Illig
>Release:        3.0 or current, doesn't matter
>Organization:
>Environment:
>Description:
After the execution of a backticks operator, the terminated child processes are not cleaned up under certain circumstances.

The following shell script creates 10 zombies, one per second.

>How-To-Repeat:


#!/bin/sh

set -eu

for i in 1 2 3 4 5 6 7 8 9 10; do
        input=`cat /etc/hosts; sleep 1`

        # comment out the following lines to make the zombies go away.
        while read line; do
                :;
        done <<EOF
$input
EOF

        # uncomment the next line to make the zombies go away.
        #sleep 1
done


>Fix: