You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Tim Moloney <mo...@mrsl.com> on 2002/03/05 06:28:39 UTC

httpd-ldap and apr shared memory

I'm trying to get the auth_ldap module to work with 2.0.32.  I can
successfully build and install both 2.0.32 and httpd-ldap.  I had to
apply the following for httpd-ldap to compile

   --- util_ldap_cache.h.orig  Fri Feb  8 13:29:17 2002
   +++ util_ldap_cache.h   Mon Mar  4 23:54:11 2002
   @@ -102,7 +102,7 @@
    } util_ald_cache_t;

    #if APR_HAS_SHARED_MEMORY
   -apr_shmem_t *util_ldap_shm;
   +apr_shm_t *util_ldap_shm;
    #endif
    util_ald_cache_t *util_ldap_cache;
    apr_thread_rwlock_t *util_ldap_cache_lock;

Unfortunately, when I start apache, I get the following error message:

   Syntax error on line 221 of /usr/local/apache2/conf/httpd.conf:
   Cannot load /usr/local/apache2/modules/mod_ldap.so into server:
   /usr/local/apache2/modules/mod_ldap.so: undefined symbol:
   apr_shm_calloc
   bin/apachectl start: httpd could not be started

A little investigation leads me to believe that apr changed its shared
memory API and httpd-ldap has not been updated.  Is anyone actively
using and maintaining httpd-ldap for apache 2.0?

-- 
Tim Moloney
ManTech Real-time Systems Laboratory
2015 Cattlemen Road                             \     /
Sarasota, FL  34232                     .________\(O)/________.
(941) 377-6775 x208                        '  '  O(.)O  '  '


Re: httpd-ldap and apr shared memory

Posted by Aaron Bannert <aa...@clove.org>.
On Wed, Mar 06, 2002 at 08:42:26AM -0500, Tim Moloney wrote:
> I took a look at apr_rmm.h and I vaguely understand what it's doing.
> 
> I see two approaches to fixing httpd-ldap.
> 
> - Replace the shm calls with rmm calls.  If this is done, what is the
>   memory buffer (third arg) that is passed to apr_rmm_create()?
> 
> - Use the rmm calls on the shared memory.  Would the shared memory would
>   be the memory buffer (third arg) passed to apr_rmm_create()?

I think you're on the right track.

create the shm
set up the anylock (it's just for determining the scope of the lock)
create the rmm (pass in the anylock and the shm)

then in the child, like in child_init():

attach to the shm
attach to the rmm

> Either way...
> 
> - What is "the appropriate type of lock" for rmm (second arg to
>   apr_rmm_create())?

It's a way to tell the internals of the rmm how wide of a scope
to use for the locking. It comes down to:
intrathread, intraprocess, both (aka global)

> - Are the rmm pool and the shm pool the same (fifth arg to
>   apr_rmm_create())?

The pool is just a way to keep track of resources and release
them at the appropriate time. In this case they're probably the same.

-aaron

Re: httpd-ldap and apr shared memory

Posted by Tim Moloney <mo...@mrsl.com>.
Aaron Bannert wrote:

> On Wed, Mar 06, 2002 at 07:05:04AM -0500, Tim Moloney wrote:
> 
>>Further investigation shows that the new shared memory API in APR does
>>not include the functionality of the old API.  Specifically, the
>>following functions are missing:
>>
>>  apr_shm_malloc()
>>  apr_shm_calloc()
>>  apr_shm_free()
>>
>>So the solution to get httpd-ldap running is to complete APR's new
>>shared memory API.  Adding this functionality is beyond me but I'll
>>post it here so that someone more knowledgable can fix it.
>>
>>By the way, I currently have httpd-ldap running by commenting out the
>>httpd-ldap code that uses shared memory.
> 
> Actually, the malloc/calloc/free code was moved somewhere more generic.
> This allows the apr_shm.h API to deal with only the basics of shared
> memory allocation/deallocation, and do so in a way that is fully
> cross-platform. The old API didn't support non-process-inheritance
> systems like Win32, OS/2, etc.
> 
> See apr_rmm.h in apr-util. If you need more details I'd be happy to
> answer your questions over on the dev@apr.apache.org mailing list.


I took a look at apr_rmm.h and I vaguely understand what it's doing.

I see two approaches to fixing httpd-ldap.

- Replace the shm calls with rmm calls.  If this is done, what is the
   memory buffer (third arg) that is passed to apr_rmm_create()?

- Use the rmm calls on the shared memory.  Would the shared memory would
   be the memory buffer (third arg) passed to apr_rmm_create()?

Either way...

- What is "the appropriate type of lock" for rmm (second arg to
   apr_rmm_create())?

- Are the rmm pool and the shm pool the same (fifth arg to
   apr_rmm_create())?

-- 
Tim Moloney
ManTech Real-time Systems Laboratory
2015 Cattlemen Road                             \     /
Sarasota, FL  34232                     .________\(O)/________.
(941) 377-6775 x208                        '  '  O(.)O  '  '


Re: httpd-ldap and apr shared memory

Posted by Aaron Bannert <aa...@clove.org>.
On Wed, Mar 06, 2002 at 07:05:04AM -0500, Tim Moloney wrote:
> Further investigation shows that the new shared memory API in APR does
> 
> not include the functionality of the old API.  Specifically, the
> 
> following functions are missing:
> 
> 
>   apr_shm_malloc()
>   apr_shm_calloc()
>   apr_shm_free()
> 
> So the solution to get httpd-ldap running is to complete APR's new
> shared memory API.  Adding this functionality is beyond me but I'll
> post it here so that someone more knowledgable can fix it.
> 
> By the way, I currently have httpd-ldap running by commenting out the
> httpd-ldap code that uses shared memory.

Actually, the malloc/calloc/free code was moved somewhere more generic.
This allows the apr_shm.h API to deal with only the basics of shared
memory allocation/deallocation, and do so in a way that is fully
cross-platform. The old API didn't support non-process-inheritance
systems like Win32, OS/2, etc.

See apr_rmm.h in apr-util. If you need more details I'd be happy to
answer your questions over on the dev@apr.apache.org mailing list.

-aaron

Re: httpd-ldap and apr shared memory

Posted by Tim Moloney <mo...@mrsl.com>.
Graham Leggett wrote:

> Tim Moloney wrote:
> 
>>A little investigation leads me to believe that apr changed its shared
>>memory API and httpd-ldap has not been updated.  Is anyone actively
>>using and maintaining httpd-ldap for apache 2.0?
> 
> It's on the todo list, however reducing the overdraft and fixes to the
> proxy have been priorities of late. If you notice stuff like this,
> submit a patch and it will be included.



Further investigation shows that the new shared memory API in APR does

not include the functionality of the old API.  Specifically, the

following functions are missing:


   apr_shm_malloc()
   apr_shm_calloc()
   apr_shm_free()

So the solution to get httpd-ldap running is to complete APR's new
shared memory API.  Adding this functionality is beyond me but I'll
post it here so that someone more knowledgable can fix it.

By the way, I currently have httpd-ldap running by commenting out the
httpd-ldap code that uses shared memory.

-- 
Tim Moloney
ManTech Real-time Systems Laboratory
2015 Cattlemen Road                             \     /
Sarasota, FL  34232                     .________\(O)/________.
(941) 377-6775 x208                        '  '  O(.)O  '  '


Re: httpd-ldap and apr shared memory

Posted by Graham Leggett <mi...@sharp.fm>.
Tim Moloney wrote:

> A little investigation leads me to believe that apr changed its shared
> memory API and httpd-ldap has not been updated.  Is anyone actively
> using and maintaining httpd-ldap for apache 2.0?

It's on the todo list, however reducing the overdraft and fixes to the
proxy have been priorities of late. If you notice stuff like this,
submit a patch and it will be included.

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."