From owner-freebsd-current Mon Feb 11 19: 7: 5 2002 Delivered-To: freebsd-current@freebsd.org Received: from newman2.bestweb.net (newman2.bestweb.net [209.94.102.67]) by hub.freebsd.org (Postfix) with ESMTP id E2FBC37B497 for ; Mon, 11 Feb 2002 18:17:11 -0800 (PST) Received: from okeeffe.bestweb.net (okeefe.bestweb.net [209.94.100.110]) by newman2.bestweb.net (Postfix) with ESMTP id 2A7CD231E0; Mon, 11 Feb 2002 21:16:50 -0500 (EST) Received: by okeeffe.bestweb.net (Postfix, from userid 0) id 74F239F2A9; Mon, 11 Feb 2002 21:11:55 -0500 (EST) Date: Thu, 07 Feb 2002 19:12:21 -0800 From: Terry Lambert To: Julian Elischer Cc: current@freebsd.org Subject: Re: ucred for threads Message-Id: <20020212021155.74F239F2A9@okeeffe.bestweb.net> 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 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