From owner-freebsd-current@FreeBSD.ORG Wed Mar 31 08:00:41 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BDB516A4D4 for ; Wed, 31 Mar 2004 08:00:41 -0800 (PST) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8AB7143D46 for ; Wed, 31 Mar 2004 08:00:18 -0800 (PST) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (not verified)) by gw.celabo.org (Postfix) with ESMTP id 310605487F; Wed, 31 Mar 2004 10:00:18 -0600 (CST) Received: by madman.celabo.org (Postfix, from userid 1001) id D629F6D465; Wed, 31 Mar 2004 10:00:17 -0600 (CST) Date: Wed, 31 Mar 2004 10:00:17 -0600 From: "Jacques A. Vidrine" To: Daniel Eischen Message-ID: <20040331160017.GH13810@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Daniel Eischen , Sean McNeil , freebsd-current@FreeBSD.org References: <20040330141631.GH10949@lum.celabo.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.6i cc: freebsd-current@FreeBSD.org cc: Sean McNeil Subject: Re: nss_ldap broken X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2004 16:00:42 -0000 On Tue, Mar 30, 2004 at 11:25:01AM -0500, Daniel Eischen wrote: > > On Tue, Mar 30, 2004 at 01:37:44AM -0800, Sean McNeil wrote: > > > I'm still concerned that nss_atexit can cause a seg11 if a nss_*.so.1 > > > starts up any threads when the program isn't threaded otherwise. Don't > > > really know why an nss plugin would want to do that, but it is > > > hazardous. > > It shouldn't be doing that. Why do I get the sinking feeling that we'll need to have nsswitch pull in e.g. nss_foo.so.1 if (!__isthreaded) and nss_foo_r.so.1 otherwise? > > The locks may not be needed regardless. Dan, how do threads interact > > with atexit()? Are threads serialized at that point? Does the main > > thread call all the atexit handlers? > > exit() calls the finalization of atexit() to run down the exit > handlers. The threads library has nothing to do with it, > but the atexit() stuff is protected with mutexes (see > src/lib/libc/stdlib/atexit.c). So whichever thread calls exit() will call all of the registered atexit handlers? So why are the mutexes needed? You are referring to __cxa_finalize, correct? It appears to me that in any case, the atexit_mutex is not held while calling the actual handler. Cheers, -- Jacques Vidrine / nectar@celabo.org / jvidrine@verio.net / nectar@freebsd.org