From owner-freebsd-current@FreeBSD.ORG Mon May 12 23:01:12 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 14BDA37B401; Mon, 12 May 2003 23:01:12 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7021B43F75; Mon, 12 May 2003 23:01:11 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.9/8.12.9) with ESMTP id h4D612M7049395; Mon, 12 May 2003 23:01:06 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200305130601.h4D612M7049395@gw.catspoiler.org> Date: Mon, 12 May 2003 23:01:02 -0700 (PDT) From: Don Lewis To: DougB@FreeBSD.org In-Reply-To: <20030512222359.M647@znfgre.qbhto.arg> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: freebsd-current@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 06:01:12 -0000 On 12 May, Doug Barton wrote: > On Mon, 12 May 2003, Terry Lambert wrote: > >> A "ps -gaxl" will print the wait channel, which may be more >> informative. > > UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND > 1000 0 1 0 -84 0 0 0 - ZW p4 0:00.00 (mtvp) > > BTW, inre your question about the shell, it's bash. But, I get the exact > same results if mtv is started as a child of the shell, as a child of > windowmaker, or as a child of netscape. Does this application use Linux threads? The following code in wait1() makes me think that if a thread somehow gets orphaned by the parent Linux process, it will never get reaped. The exit code for Linux should probably wait for any child threads to exit. LIST_FOREACH(p, &q->p_children, p_sibling) { PROC_LOCK(p); if (uap->pid != WAIT_ANY && p->p_pid != uap->pid && p->p_pgid != -uap->pid) { PROC_UNLOCK(p); continue; } /* * This special case handles a kthread spawned by linux_clone * (see linux_misc.c). The linux_wait4 and linux_waitpid * functions need to be able to distinguish between waiting * on a process and waiting on a thread. It is a thread if * p_sigparent is not SIGCHLD, and the WLINUXCLONE option * signifies we want to wait for threads and not processes. */ if ((p->p_sigparent != SIGCHLD) ^ ((uap->options & WLINUXCLONE) != 0)) { PROC_UNLOCK(p); continue; }