From owner-freebsd-current Thu Feb 7 19:20:47 2002 Delivered-To: freebsd-current@freebsd.org Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by hub.freebsd.org (Postfix) with ESMTP id 1755437B48D for ; Thu, 7 Feb 2002 19:20:13 -0800 (PST) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020208032012.TLDF2951.rwcrmhc53.attbi.com@InterJet.elischer.org>; Fri, 8 Feb 2002 03:20:12 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id TAA99335; Thu, 7 Feb 2002 19:17:53 -0800 (PST) Date: Thu, 7 Feb 2002 19:17:53 -0800 (PST) From: Julian Elischer To: Terry Lambert Cc: current@freebsd.org Subject: Re: ucred for threads In-Reply-To: <3C634215.23CF1227@mindspring.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Terry I don't have time to work on it now, but if you would like to take a -current system and apply the threading KSE diffs from my web page, then maybe you can investigate whether I really ned the if clause or not.. I don't have time now to go back to it for a while On Thu, 7 Feb 2002, Terry Lambert wrote: > Julian Elischer wrote: > > yes.. well in booting yuo can have a null ucred. ( I know,s > > I've hit it), but in general you are correct. > > [ ... ] > > > > What is the default state of td->td_ucred? > > > > on creation, NULL followed very rapidly with being set to > > p->p_ucred. (via crhold) > > Non-problem, then. > > > > > If that's the case, then the code should be: > > > > > > if (td->td_ucred != p->p_ucred) { > > > PROC_LOCK(p); > > > if (td->td_ucred) { > > > crfree(td->td_ucred); > > > } > > > > without the if it crashes in boot sometimes. > > (this may not be true right now but was during my testing of > > the KSE kernel) > > The place to fix this is by setting up a default reference to > a root/boot ucred, I think, for use by the initial process > template. > > What are the consequences, if any, of me having removed the > setting the thing to NULL, during boot? I guess that it > would leave the thread cred uninitialized. Obviously, the > problem with your crash is in the crhold( NULL). 8-). > > It seems to me that the test would leave threads with NULL > ucreds around as well, and just complicate things later. > > Is there a reason you can't set up an initial ucred? > > -- Terry > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message