Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Mar 2004 10:00:17 -0600
From:      "Jacques A. Vidrine" <nectar@FreeBSD.org>
To:        Daniel Eischen <eischen@vigrid.com>
Cc:        Sean McNeil <sean@mcneil.com>
Subject:   Re: nss_ldap broken
Message-ID:  <20040331160017.GH13810@madman.celabo.org>
In-Reply-To: <Pine.GSO.4.10.10403301119430.11221-100000@pcnet5.pcnet.com>
References:  <20040330141631.GH10949@lum.celabo.org> <Pine.GSO.4.10.10403301119430.11221-100000@pcnet5.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040331160017.GH13810>