httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brad Nicholes" <>
Subject Re: pool use/mutex initialization in util_ldap not thread safe?
Date Wed, 15 Mar 2006 23:56:12 GMT
>>> On 3/15/2006 at 2:34 pm, in message
<>, "Jeff
<> wrote:
> Plz forgive any misunderstanding, as well as my use of 2.0 function
> names ;)  Also, for being slow at learning what ldap stands for.  I
> know this code has been hashed over many many times over the last
> years.
> util_ldap_create_config() creates the per-server config for
>  That saves a config-time pool in the per-server config.
> util_ldap_connection_find() is called on a request and allocates a
> mutex using st->pool without holding a mutex, if the mutex wasn't
> created before.  IOW, the first <very-small-number> of threads in
> process that try to find a connection will allocate a mutex. 
> Hopefully very-small-number is one
> (This is exactly the type of bug I had the displeasure of diagnosing
> in a proprietary module some time back; somebody eons ago had
> some initialization until the first request, assuming incorrectly
> there was no way that at the time of the first request for a certain
> vhost that there would actually be 2+ concurrent requests stomping
> each other.  one of the baby bells proved otherwise continually
> the problem was found and fixed)
> The child init hook really needs to talk the server_recs and create
> the mutex there, right?
> Also, is the pool growth of the config-time pool reasonable?
> What happens when some other module cheats and uses a config-time
> on request processing thread, even if it is "smart" enough to
> the pool misuse with a mutex?  (kaboom)
> If it is reasonable to grow some pool over time during the request
> processing, shouldn't it be an ldap-unique pool

I think you are right.  I am going to take a closer look at that code
and see about fixing both the mutex problem and the use of the config
pool.  This could actually explain some funny things that I have been
seeing on the NetWare build lately.


View raw message