From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 24 12:32:33 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 A23D516A401; Fri, 24 Mar 2006 12:32:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from fw.zoral.com.ua (ll-227.216.82.212.sovam.net.ua [212.82.216.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 855D743D45; Fri, 24 Mar 2006 12:32:32 +0000 (GMT) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by fw.zoral.com.ua (8.13.4/8.13.3) with ESMTP id k2OCWQCC008693 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Mar 2006 14:32:26 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.13.4/8.13.4) with ESMTP id k2OCWQwe085012; Fri, 24 Mar 2006 14:32:26 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.13.4/8.13.4/Submit) id k2OCWPwZ085011; Fri, 24 Mar 2006 14:32:25 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 24 Mar 2006 14:32:25 +0200 From: Kostik Belousov To: Kazuaki Oda Message-ID: <20060324123225.GG27116@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> <20060324084834.GE27116@deviant.kiev.zoral.com.ua> <4423DDFA.3090504@highway.ne.jp> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BQPnanjtCNWHyqYD" Content-Disposition: inline In-Reply-To: <4423DDFA.3090504@highway.ne.jp> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.88, clamav-milter version 0.87 on fw.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on fw.zoral.com.ua Cc: freebsd-hackers@freebsd.org, freebsd-threads@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 12:32:33 -0000 --BQPnanjtCNWHyqYD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 24, 2006 at 08:54:34PM +0900, Kazuaki Oda wrote: > Kostik Belousov wrote: > > I did understand the purpose of the thread mask code in > > libexec/rtld/rtld_lock.c, or, more precisely, the condition where this = code > > works (for the context, see the mails with same subject on freebsd-hack= ers). > >=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 provid= es > > 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'm a bit confused. Do you mean the following? >=20 > * The current implementation of rtld has a problem both with > libpthread and libthr. It works only with libc_r. It does not work correctly with libc_r too. > * In libpthread case, the problem goes away if we modify rtld code. Yes. > * In libthr case, in addition to above, we must modify libthr code to > provide implementation of the locks for rtld. Yes. --BQPnanjtCNWHyqYD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (FreeBSD) iD8DBQFEI+bYC3+MBN1Mb4gRAj07AJ9juDKTVIIEs+Zt4WiNSO/zPajEYACgrOAG s6fhh4iFaka6huvxUVTOvPY= =e15F -----END PGP SIGNATURE----- --BQPnanjtCNWHyqYD--