httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brad Nicholes" <BNICHO...@novell.com>
Subject Re: [PATCH] bug #18756 ldap cache and shared memory - cache init
Date Sat, 13 Dec 2003 20:12:41 GMT
Ah yes, now I remember.  It was a chicken and egg problem.  It's not a
matter of st->cache_rmm being invalid, it is the fact that
util_ald_alloc() expects to allocate from a util_ald_cache_t*, which is
the reason why we are calling util_ald_create_cache() in the first
place.  We have to create one before we can allocate from it.  

+1 check-in

Brad

Brad Nicholes
Senior Software Engineer
Novell, Inc., the leading provider of Net business solutions
http://www.novell.com 

>>> apache@moresecurity.org Friday, December 12, 2003 3:57:08 PM >>>
Hi,

I think my mail wasn't clear :)

All is about the util_ald_alloc function using shm or not,
st->cache_rmm 
is valid :)

At the beginning, it was util_ald_alloc(unsigned long size) and inside,

when the configure set APR_SHARED_MEMORY, it was using a global
rmm_addr.
Then, the patch i did was changing to util_ald_alloc (apr_rmm_t 
rmm_addr, unsigned long size), but with this, it was breaking the code

on plateform without SHM.
To make it work with non SHM plateform, Brad changed util_ald_alloc to

util_ald_alloc(util_ald_cache_t *cache, unsigned long size) and inside,

use cache->rmm_addr if SHM plateform.

The problem happen at line 304 of util_ldap_cache_mgr.c, when it create

the cache, it use util_ald_alloc, but it's unable to give the alloc 
function the cache data, because it's not created yet.
Actually, it's :

cache = (util_ald_cache_t *)util_ald_alloc(st->cache_rmm, 
sizeof(util_ald_cache_t));
This is broken, because the alloc function doesn't receive apr_rmm but

util_ald_cache_t.

that's why i did this alloc directly with the apr_rmm functions.

Matthieu

Brad Nicholes wrote:

>   I don't have a problem with this patch, but since NetWare doesn't
use
>shared memory I am not able to trace down exactly what the issue is. 
>Can you describe the circumstance where the util_ald_create_cache()
>function is called and st->cache_rmm is invalid?  By simply looking
>through the code, it appeared that st->cache_rmm is always set before
>any call to util_ald_create_cache().
>
>Brad
>
>Brad Nicholes
>Senior Software Engineer
>Novell, Inc., the leading provider of Net business solutions
>http://www.novell.com 
>
>  
>
>>>>apache@moresecurity.org Thursday, December 11, 2003 1:51:49 AM >>>
>>>>        
>>>>
>Hi,
>
>st->cache_rmm is now invalid because due to non SHM plateform,
>bnicholes 
>changed the alloc function util_ald_alloc to receive now 
>util_ald_cache_t and no more apr_rmm_t.
>As we are just before the cache alloc, it's impossible to give 
>util_ald_alloc a cache object, that's why there, i did a basic alloc 
>functions.
>
>
>Jeff Trawick wrote:
>
>  
>
>>Matthieu Estrade wrote:
>>
>>    
>>
>>>Here is a little patch, fixing the ldap cache using shared memory.
>>>After the fix for plateform using SHM or not, it was a problem with
>>>      
>>>
>
>  
>
>>>cache init, unable to get it's rmm address to alloc memory.
>>>      
>>>
>>why is st->cache_rmm not filled out (or invalid)?
>>
>>
>>    
>>
>
>
>  
>



Mime
View raw message