From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 24 10:46:14 2006 Return-Path: X-Original-To: freebsd-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 2FB4F16A41F; Fri, 24 Mar 2006 10:46:14 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C52243D55; Fri, 24 Mar 2006 10:46:13 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from localhost.my.domain (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k2OAk9E2079676; Fri, 24 Mar 2006 10:46:10 GMT (envelope-from davidxu@freebsd.org) From: David Xu To: freebsd-threads@freebsd.org Date: Fri, 24 Mar 2006 18:46:00 +0800 User-Agent: KMail/1.8.2 References: <44215FE9.2070602@highway.ne.jp> <20060323105440.GD27116@deviant.kiev.zoral.com.ua> <20060324084834.GE27116@deviant.kiev.zoral.com.ua> In-Reply-To: <20060324084834.GE27116@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200603241846.00579.davidxu@freebsd.org> Cc: Kostik Belousov , freebsd-hackers@freebsd.org Subject: Re: [patch] Re: dlopen() and dlclose() are not MT-safe? YES, esp. for libthr 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: Fri, 24 Mar 2006 10:46:14 -0000 =D4=DA Friday 24 March 2006 16:48=A3=ACKostik Belousov =D0=B4=B5=C0=A3=BA > I did understand the purpose of the thread mask code in > libexec/rtld/rtld_lock.c, or, more precisely, the condition where this co= de > works (for the context, see the mails with same subject on freebsd-hacker= s). >=20 > Look, that code assumes that blocking async signals would stop thread > scheduler from doing preemption of the current thread. This works > for libc_r, but fails in libpthread and libthr cases. libpthread provides > implementation of the locks for rtld. But libthr does not ! >=20 > As result, rtld exhibit races when used with libthr. In other words, > libthr needs code to do proper locking. >=20 > Do you agree ? Does somebody already planned to do this work ? >=20 > Best regards, > Kostik Belousov >=20 I will check libthr source code to see if I can fix it at the weekend. David Xu