From owner-p4-projects@FreeBSD.ORG Thu Feb 1 09:15:55 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 574E116A403; Thu, 1 Feb 2007 09:15:55 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 302DC16A401 for ; Thu, 1 Feb 2007 09:15:55 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 1EBA813C461 for ; Thu, 1 Feb 2007 09:15:55 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l119FtKD044493 for ; Thu, 1 Feb 2007 09:15:55 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l119FsM3044489 for perforce@freebsd.org; Thu, 1 Feb 2007 09:15:54 GMT (envelope-from rdivacky@FreeBSD.org) Date: Thu, 1 Feb 2007 09:15:54 GMT Message-Id: <200702010915.l119FsM3044489@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 113819 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2007 09:15:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=113819 Change 113819 by rdivacky@rdivacky_witten on 2007/02/01 09:15:53 Reparent all procs that are part of a threading group but not its leaders to init and SIGCHLD init to finish the zombies off. This fixes zombies left after opera's exit. Noticed by: Scott Robbins Affected files ... .. //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#29 edit Differences ... ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_emul.c#29 (text+ko) ==== @@ -165,6 +165,17 @@ KASSERT(em != NULL, ("proc_exit: emuldata not found.\n")); + /* reparent all procs that are not a thread leader to initproc */ + if (em->shared->group_pid != p->p_pid) { + sx_xlock(&proctree_lock); + wakeup(initproc); + PROC_LOCK(p); + proc_reparent(p, initproc); + p->p_sigparent = SIGCHLD; + PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); + } + child_clear_tid = em->child_clear_tid; EMUL_UNLOCK(&emul_lock);