From owner-freebsd-arch@FreeBSD.ORG Thu Feb 12 00:30:24 2015 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D27231D for ; Thu, 12 Feb 2015 00:30:24 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1411B3F7 for ; Thu, 12 Feb 2015 00:30:24 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t1C0UNbg084892 for ; Thu, 12 Feb 2015 00:30:23 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t1C0UNQB084889 for arch@freebsd.org; Thu, 12 Feb 2015 00:30:23 GMT (envelope-from bdrewery) Received: (qmail 94482 invoked from network); 11 Feb 2015 18:30:21 -0600 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 11 Feb 2015 18:30:21 -0600 Message-ID: <54DBF417.4050206@FreeBSD.org> Date: Wed, 11 Feb 2015 18:30:15 -0600 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: Fixing dlopen("libpthread.so") References: <20141226165337.GJ1754@kib.kiev.ua> In-Reply-To: <20141226165337.GJ1754@kib.kiev.ua> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uqQesVRhT3Cr78iS9TWbomwC5tot1vB4H" Cc: threads@freebsd.org, arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2015 00:30:24 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uqQesVRhT3Cr78iS9TWbomwC5tot1vB4H Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 12/26/2014 10:53 AM, Konstantin Belousov wrote: > [Long] > Proposed patch does the following: [...] It seems libthr.3 needs to be updated for the dlopen(3) support, to remove some of r272070. Also note the ordering comment (which I know you may not be ready to change yet). > INTERACTION WITH RUN-TIME LINKER > The libthr library must appear before libc in the global order of > depended objects. >=20 > Loading libthr with the dlopen(3) call in the process after the pr= ogram > binary is activated is not supported, and causes miscellaneous and= hard- > to-diagnose misbehaviour. This is due to libthr interposing sever= al > important libc symbols to provide thread-safe services. In partic= ular, > errno and the locking stubs from libc are affected. This requirem= ent is > currently not enforced. >=20 > If the program loads any modules at run-time, and those modules ma= y > require threading services, the main program binary must be linked= with > libpthread, even if it does not require any services from the libr= ary. >=20 > libthr cannot be unloaded; the dlclose(3) function does not perfor= m any > action when called with a handle for libthr. One of the reasons i= s that > the interposing of libc functions cannot be undone. As for the dlclose(3) refusing to work on libthr, I cannot find the supporting code. Where is it? Thanks, Bryan --uqQesVRhT3Cr78iS9TWbomwC5tot1vB4H Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJU2/QfAAoJEDXXcbtuRpfPNEQIAJHLs6BDBmKoHfKdtNJF/Fqq WFfnHY8niMTgsF9EXQfOmBNxROXYKNK8oQjvJ0jLD1k0Ep1bhKDARBntxf55R6yc oueO2rdMH7014WEcNLGbLQF5jkpcpN0SsgGaNfNpMVqlUeVDnAhkglVG/xKPUgC6 bIjeja4/YWD5lXA4P/lwIPbJHbuhAoYfdoz2oyJ1umhQskbPjj1GYU3fpUr9hX1C zQBdSDlC/hkDFuO6gsan2/S5471tEMV0YcaeLRVaqjJYjk6MO0pmcF8Ta7OPdRkr 3sBQfWt/wTygDwyoL+xcuRDbibEfi0Kk8/FaPonyiN/gdf6ll8uOLx0W+as1v8g= =Vz97 -----END PGP SIGNATURE----- --uqQesVRhT3Cr78iS9TWbomwC5tot1vB4H--