From owner-freebsd-hackers Wed Jun 19 19:13:40 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mta5.snfc21.pbi.net (mta5.snfc21.pbi.net [206.13.28.241]) by hub.freebsd.org (Postfix) with ESMTP id 09BB037B40A; Wed, 19 Jun 2002 19:13:34 -0700 (PDT) Received: from kokeb.ambesa.net ([64.172.25.248]) by mta5.snfc21.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0GXZ0040NFIL9M@mta5.snfc21.pbi.net>; Wed, 19 Jun 2002 19:13:33 -0700 (PDT) Received: from kokeb.ambesa.net (tanstaafl@localhost [127.0.0.1]) by kokeb.ambesa.net (8.12.3/8.12.3) with ESMTP id g5K2IleU022445; Wed, 19 Jun 2002 19:18:47 -0700 (PDT envelope-from mikem@kokeb.ambesa.net) Received: (from mikem@localhost) by kokeb.ambesa.net (8.12.3/8.12.3/Submit) id g5K2Ik7O022444; Wed, 19 Jun 2002 19:18:46 -0700 (PDT envelope-from mikem) Date: Wed, 19 Jun 2002 19:18:46 -0700 From: Mike Makonnen Subject: Re: Suggested fixes for uidinfo "would sleep" messages In-reply-to: <200206192256.g5JMuCM1067585@gw.catspoiler.org> To: Don Lewis Cc: bright@mu.org, jhb@FreeBSD.ORG, hackers@FreeBSD.ORG Message-id: <20020619191846.4aa74dd6.makonnen@pacbell.net> MIME-version: 1.0 X-Mailer: Sylpheed version 0.7.0 (GTK+ 1.2.10; i386--freebsd5.0) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT References: <20020619172107.GF85935@elvis.mu.org> <200206192256.g5JMuCM1067585@gw.catspoiler.org> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I actually submitted a patch for this a few days ago to John Baldwin, but I think he's busy right now 'cause I haven't heard from him. Here it is: Index: sys/kern/kern_exec.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_exec.c,v retrieving revision 1.164 diff -u -r1.164 kern_exec.c --- sys/kern/kern_exec.c 7 Jun 2002 05:41:27 -0000 1.164 +++ sys/kern/kern_exec.c 16 Jun 2002 14:14:37 -0000 @@ -133,7 +133,7 @@ struct image_params image_params, *imgp; struct vattr attr; int (*img_first)(struct image_params *); - struct pargs *oldargs, *newargs = NULL; + struct pargs *oldargs=NULL, *newargs = NULL; struct procsig *oldprocsig, *newprocsig; #ifdef KTRACE struct vnode *tracevp = NULL; @@ -383,8 +383,10 @@ #endif /* Make sure file descriptors 0..2 are in use. */ error = fdcheckstd(td); - if (error != 0) - goto exec_fail_dealloc; + if (error != 0) { + oldcred = NULL; + goto done1; + } /* * Set the new credentials. */ @@ -467,6 +469,7 @@ p->p_args = newargs; newargs = NULL; } +done1: PROC_UNLOCK(p); /* @@ -476,7 +479,6 @@ crfree(oldcred); else crfree(newcred); - KASSERT(newargs == NULL, ("leaking p_args")); /* * Handle deferred decrement of ref counts. */ @@ -486,7 +488,10 @@ if (tracevp != NULL) vrele(tracevp); #endif - pargs_drop(oldargs); + if (oldargs != NULL) + pargs_drop(oldargs); + if (newargs != NULL) + pargs_drop(newargs); exec_fail_dealloc: Cheers, Mike. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message