Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Mar 2006 13:07:49 +0100
From:      joerg@britannica.bec.de
To:        freebsd-hackers@freebsd.org, hackers@freebsd.org
Subject:   Re: [patch] Re: dlopen() and dlclose() are not MT-safe?
Message-ID:  <20060323120749.GA3780@britannica.bec.de>
In-Reply-To: <20060323105440.GD27116@deviant.kiev.zoral.com.ua>
References:  <44215FE9.2070602@highway.ne.jp> <20060322174312.GB27116@deviant.kiev.zoral.com.ua> <20060322190725.GC27116@deviant.kiev.zoral.com.ua> <4421BA34.8040908@highway.ne.jp> <20060323105440.GD27116@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 23, 2006 at 12:54:40PM +0200, Kostik Belousov wrote:
> On Thu, Mar 23, 2006 at 05:57:24AM +0900, Kazuaki Oda wrote:
> > BTW do you know the reason why lock is released before calling
> > objlist_call_fini()?  If we don't release the lock, what problem will
> > occur?  deadlock?
> The reasoning behind releasing the lock is to allow calls to dl*()
> functions from constructors/destructors. This is common practice
> and shall be supported. Yes, leaving the lock taken will lead to
> deadlock.

Even worse, e.g. access to Thread Locale Storage or possible even lazily
resolved symbols can result in such calls, making it completely
unpredictable.

> Please, try the following patch and report results. I can run (modified *)
> version of your test for some time without crash with both libpthread
> and libthr.

I don't like this patch, give me some time to think of a better
solution.

Joerg



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