From owner-freebsd-bugs@FreeBSD.ORG Fri Mar 12 23:40:01 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F082216A4CE for ; Fri, 12 Mar 2004 23:40:00 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CFB8B43D2D for ; Fri, 12 Mar 2004 23:40:00 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i2D7e0bv063595 for ; Fri, 12 Mar 2004 23:40:00 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i2D7e0fe063594; Fri, 12 Mar 2004 23:40:00 -0800 (PST) (envelope-from gnats) Resent-Date: Fri, 12 Mar 2004 23:40:00 -0800 (PST) Resent-Message-Id: <200403130740.i2D7e0fe063594@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Eugene Grosbein Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5230116A4CE for ; Fri, 12 Mar 2004 23:31:00 -0800 (PST) Received: from www.svzserv.kemerovo.su (www.svzserv.kemerovo.su [213.184.65.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 69A7B43D2D for ; Fri, 12 Mar 2004 23:30:59 -0800 (PST) (envelope-from eugen@www.svzserv.kemerovo.su) Received: from www.svzserv.kemerovo.su (smmsp@localhost [127.0.0.1]) i2D7UurS025137 for ; Sat, 13 Mar 2004 14:30:56 +0700 (KRAT) (envelope-from eugen@www.svzserv.kemerovo.su) Received: (from eugen@localhost) by www.svzserv.kemerovo.su (8.12.11/8.12.11/Submit) id i2D7CTtK017745; Sat, 13 Mar 2004 14:12:29 +0700 (KRAT) (envelope-from eugen) Message-Id: <200403130712.i2D7CTtK017745@www.svzserv.kemerovo.su> Date: Sat, 13 Mar 2004 14:12:29 +0700 (KRAT) From: Eugene Grosbein To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/64198: init(8) may keep zombies X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Mar 2004 07:40:01 -0000 >Number: 64198 >Category: bin >Synopsis: init(8) may keep zombies >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Mar 12 23:40:00 PST 2004 >Closed-Date: >Last-Modified: >Originator: Eugene Grosbein >Release: FreeBSD 4.9-STABLE i386 >Organization: Svyaz Service JSC >Environment: System: FreeBSD www.svzserv.kemerovo.su 4.9-STABLE FreeBSD 4.9-STABLE #4: Wed Mar 3 12:48:22 KRAT 2004 eu@www.svzserv.kemerovo.su:/home4/obj/home/src/sys/WWW i386 >Description: ttys(5) provides a way to run an application before starting main process for terminal line. One can use 'window="..."' for it. Let's look how init(8) impelents this: 1. It forks to serve a line, obtains PID1. 2. It forks again and executes a command written as window argument, if needed. It obtains PID2. 3. It sleeps for WINDOW_WAIT == 3 seconds. 3. It executes main process for terminal line. This process will have PID1 and PID2 will be a child of PID1. PID2 may become a zombie until PID1 finishes if PID2 finishes during the stage 3. init(8) will not call waitpid() in this case. >How-To-Repeat: 1. Make user 'systat' and make the following shell script for its login shell: #!/bin/sh exec nice -10 systat -vm 3 2. Add a record to /etc/gettytab: systat|autologin systat display:\ :al=systat:tc=Pc: 3. Make a record in /etc/ttys: ttyv9 "/usr/libexec/getty systat" cons25 on secure window="/bin/stty susp undef stop undef kill undef quit undef" 4. Make init reread /etc/ttys: kill -1 1 5. Look at stty zombie. >Fix: Teach init(8) to call waitpid() even if a child is not found by the find_session() function. >Release-Note: >Audit-Trail: >Unformatted: