Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Feb 2015 18:30:15 -0600
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        threads@freebsd.org, arch@freebsd.org
Subject:   Re: Fixing dlopen("libpthread.so")
Message-ID:  <54DBF417.4050206@FreeBSD.org>
In-Reply-To: <20141226165337.GJ1754@kib.kiev.ua>
References:  <20141226165337.GJ1754@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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--



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