From owner-freebsd-current@FreeBSD.ORG Mon May 12 22:46:48 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BB2D37B401 for ; Mon, 12 May 2003 22:46:48 -0700 (PDT) Received: from parmenides.zen.co.uk (parmenides.zen.co.uk [212.23.8.69]) by mx1.FreeBSD.org (Postfix) with SMTP id EDACB43F3F for ; Mon, 12 May 2003 22:46:46 -0700 (PDT) (envelope-from tony@ubik.demon.co.uk) Received: (qmail 337 invoked from network); 13 May 2003 05:46:43 -0000 Received: from protagoras.zen.co.uk (212.23.8.61) by parmenides.zen.co.uk with QMQP; 13 May 2003 05:46:43 -0000 Received: from dsl-217-155-183-134.zen.co.uk (HELO ubik.demon.co.uk) (217.155.183.134) by protagoras.zen.co.uk with SMTP; 13 May 2003 05:46:43 -0000 X-Zen-Trace: 217.155.183.134 Message-ID: Date: Tue, 13 May 2003 05:45:38 +0000 To: Don Lewis From: Anthony Naggs References: <3EBFB3CC.5673108C@mindspring.com> <200305121726.h4CHQOM7048113@gw.catspoiler.org> In-Reply-To: <200305121726.h4CHQOM7048113@gw.catspoiler.org> MIME-Version: 1.0 X-Mailer: Turnpike Integrated Version 5.01 U cc: freebsd-current@FreeBSD.org cc: DougB@FreeBSD.org Subject: Re: mtv leaves a zombie after exit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2003 05:46:48 -0000 In article <200305121726.h4CHQOM7048113@gw.catspoiler.org>, Don Lewis writes >On 12 May, Terry Lambert wrote: >> Doug Barton wrote: >>> For some time now on -current whenever I run mtv, it leaves a zombie after >>> it exits: >>> >>> USER PID PPID %CPU %MEM VSZ RSS STAT STARTED TIME COMMAND >>> doug 0 1 0.0 0.0 0 0 ZW - 0:00.00 (mtvp) >>> >>> It runs fine, displays the video fine, but it always leaves a zombie. >> >> Zombies exist when the parent process fails to reap child >> exit status. This may be a bug in your shell. If it's not >> a bug in your shell, then it's a bug in kernel (probably in >> fork_exit). > >In this case PPID == 1, so even if the parent process failed to reap the >child, init should have reaped the mtvp process when the parent process >exited. The parent must have exit have the child process terminated, the shell (iirc) inherits the process. On (at least) some Unix flavours the child is not reaped in this case - the process is already terminated so the shell doesn't get a SIGCHILD. (This is mentioned, for instance, in Unix Internals by Uresh Vahalla.) I'm not familiar enough with FreeBSD to know whether this is the expected behaviour. Probably the simplest fix would be for mtv to wait() for the child mtvp to terminate before it exits itself. >The "ZW" state looks suspicious. I'd expect to see just "Z". >Maybe that's why the process isn't getting reaped. It shouldn't have any effect. The zombie is implicitly idle, the W just means the system has noticed & swapped it out. Tony