Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 May 2003 16:37:31 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   Re: 5.1-RELEASE TODO
Message-ID:  <XFMail.20030520163731.jhb@FreeBSD.org>
In-Reply-To: <Pine.NEB.3.96L.1030519143701.59393H-100000@fledge.watson.org>

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

On 19-May-2003 Robert Watson wrote:
> 
> On Mon, 19 May 2003, Terry Lambert wrote:
> 
>> Robert Watson wrote:
>> >    |-------------------+-------------+---------------+----------------------|
>> >    |                   |             |               | Update the run-time  |
>> >    | rtld-elf          | --          | Alexander     | link editor (rtld)   |
>> >    | thread-safety     |             | Kabaev        | thread-safe with     |
>> >    |                   |             |               | libpthread.          |
>> >    |-------------------+-------------+---------------+----------------------|
>> 
>> According to chapter 12 of the "Go Solo 2" book, this is a bogus thing
>> to do.  Callers are required to take a critical section over the calls
>> to the dl* functions because the dlerror() function uses a static buffer
>> that can be overwritten in a multi-threaded environment. 
> 
> Sadly, that insight doesn't seem to have influenced the development
> practices of a number of major application vendors :-(. 

As Peter has mentioned before, simply locking calls to dlopen() in the
application is not sufficient since every time you have to resolve a
symbol when doing a call to a function for the first time, you hit the
same data structures and need the locks in those cases as well.  Assuming
I recalled all that correctly.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/



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