From owner-cvs-all@FreeBSD.ORG Mon Oct 23 15:49:10 2006 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49B8B16A707; Mon, 23 Oct 2006 15:49:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41F4743D55; Mon, 23 Oct 2006 15:48:59 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k9NFmWgl001019; Mon, 23 Oct 2006 11:48:51 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: David Xu Date: Mon, 23 Oct 2006 11:48:34 -0400 User-Agent: KMail/1.9.1 References: <200610220014.k9M0E5mG061752@gw.catspoiler.org> <200610221354.57273.davidxu@freebsd.org> In-Reply-To: <200610221354.57273.davidxu@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610231148.35326.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 23 Oct 2006 11:48:52 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/2081/Mon Oct 23 09:43:22 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: cvs-src@freebsd.org, Don Lewis , src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern kern_exit.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Oct 2006 15:49:10 -0000 On Sunday 22 October 2006 01:54, David Xu wrote: > On Sunday 22 October 2006 08:14, Don Lewis wrote: > > On 21 Oct, David Xu wrote: > > > davidxu 2006-10-21 23:59:15 UTC > > > > > > FreeBSD src repository > > > > > > Modified files: > > > sys/kern kern_exit.c > > > Log: > > > Since revision 1.333 of kern_sig.c no longer uses P_WEXIT, the change > > > opened a race window which can cause memory leak in signal queue. > > > Here we free memory for signal queue when process state is set to > > > PRS_ZOMBIE. > > > > > > Revision Changes Path > > > 1.291 +8 -2 src/sys/kern/kern_exit.c > > > > I wonder if the earlier change is what broke portupgrade after I > > upgraded from an August 31st version of current to yesterday's version. > > The symptoms were random processes dying from SIGHUP. It was easy to > > reproduce by just going to a port directory and running > > script foo make clean > > a few times. I'd randomly see make complain about a non-zero exit > > status from uname or some other sub-process. I tracked the problem back > > to the SIGHUP bit being set in td2's sigqueue in fork1(). As a > > workaround, I added a call to sigqueue_init() where td2 gets bzero'ed. > > > > Disappearing back into the void ... > > But I am still worrried by these signal changes, if an exiting process > can be sent a signal, and msleep will interrupted in cleanup code, where the > code will return to ? in normal case, code will return to userland, and > signal will be removed and delivered, but if a thread is in exit1(), where > the code can be returned to ? if a cleanup procedure is interrupted, isn't > there is any resource leak or dead-loop if it is retried because signal is > never removed ? It will return to the exit1() function. :) If a process has W_EXIT set and is asleep in msleep() with PCATCH, it called msleep() from exit1() or some other number of functions in between the two. Note that this was the behavior of FreeBSD prior to the Linux threads stuff (and BSD). -- John Baldwin