Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Mar 2006 14:32:25 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Kazuaki Oda <kaakun@highway.ne.jp>
Cc:        freebsd-hackers@freebsd.org, freebsd-threads@freebsd.org
Subject:   Re: [patch] Re: dlopen() and dlclose() are not MT-safe? YES, esp. for libthr
Message-ID:  <20060324123225.GG27116@deviant.kiev.zoral.com.ua>
In-Reply-To: <4423DDFA.3090504@highway.ne.jp>
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>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



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