From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 23 12:08:07 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 639C916A427; Thu, 23 Mar 2006 12:08:07 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from hydra.bec.de (www.ostsee-abc.de [62.206.222.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1AF4343D78; Thu, 23 Mar 2006 12:08:04 +0000 (GMT) (envelope-from joerg@britannica.bec.de) Received: from britannica.bec.de (unknown [139.30.252.72]) by hydra.bec.de (Postfix) with ESMTP id 1D27D35707; Thu, 23 Mar 2006 13:08:03 +0100 (CET) Received: by britannica.bec.de (Postfix, from userid 1000) id 18AC96CD4F; Thu, 23 Mar 2006 13:07:49 +0100 (CET) Date: Thu, 23 Mar 2006 13:07:49 +0100 From: joerg@britannica.bec.de To: freebsd-hackers@freebsd.org, hackers@freebsd.org Message-ID: <20060323120749.GA3780@britannica.bec.de> Mail-Followup-To: freebsd-hackers@freebsd.org, hackers@freebsd.org 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060323105440.GD27116@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.11 Cc: Subject: Re: [patch] Re: dlopen() and dlclose() are not MT-safe? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2006 12:08:07 -0000 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