You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Fenlason, Josh" <jf...@ptc.com> on 2005/08/02 22:26:44 UTC

Problems in apr_rmm.c

Has anyone seen any problems in apr_rmm.c on systems with shared memory
and ldap enabled?
When I stop Apache via Crtl-C, I'm getting the Windows error saying that
something is a miss in Apache.  Stepping into the debugger, reveals that
the problem is at line 373 of srclib\apr-util\misc\apr_rmm.c.
 
else {
    if (rmm->base->firstused != this) {
        APR_ANYLOCK_UNLOCK(&rmm->lock);
        return APR_EINVAL;
    }
}
 
firstused has not been initialized.  If I rebuild Apache without shared
memory, the problem goes away.  Has anyone else seen anything like this?
Any suggestions on how to resolve this?
I'm on XP SP1, Apache 2.0.54.
Thanks in advance.
,
Josh.

Re: Problems in apr_rmm.c

Posted by Michael Vergoz <mv...@binarysec.com>.
Le Mardi 2 Août 2005 22:39, Jess Holle a écrit :

I suggest you to disable shm. There is some problems into apr around shm & 
mmap. Because apache use prefork you can have some serious problem with 
global lock (for example when a signal is sent). There is two ways for apache 
folks to fix this problem : 
- Destroy prefork.. (not realist atm)
- Add a netlock model. A server should dispatch locks. 

I had worked a lot of time on this subject. And my last "word" was : "APR must 
rethink its thread design...".

I have some ideas about this design but apr/apache folks doesn't seem to be 
interested :P (my work about this subject is stoped atm)

A part of my work is avaible at :
http://badcode.be/~descript/.apache/2.0.txt
http://badcode.be/~descript/.apache/couple/

> I suspect (somewhat strongly) that this issue is in util_ldap, not in
> APR, but Josh's question is a good one -- is this a known util_ldap issue?
>
> We had for some time disabled shared memory in util_ldap by pretending
> it did not exist on any platform by replacing shared-memory ifdefs with
> #if 0's.  Perhaps it is time to do this again?  Seeing such an issue on
> Windows worries me that other platforms are a house of cards in this
> area as well...
Yes it's best way atm.

Regards,
Michael Vergoz

>
> --
> Jess Holle
>
> Fenlason, Josh wrote:
> > Has anyone seen any problems in apr_rmm.c on systems with shared
> > memory and ldap enabled?
> > When I stop Apache via Crtl-C, I'm getting the Windows error saying
> > that something is a miss in Apache.  Stepping into the debugger,
> > reveals that the problem is at line 373 of
> > srclib\apr-util\misc\apr_rmm.c.
> >
> > else {
> >     if (rmm->base->firstused != this) {
> >         APR_ANYLOCK_UNLOCK(&rmm->lock);
> >         return APR_EINVAL;
> >     }
> > }
> >
> > firstused has not been initialized.  If I rebuild Apache without
> > shared memory, the problem goes away.  Has anyone else seen anything
> > like this?  Any suggestions on how to resolve this?
> > I'm on XP SP1, Apache 2.0.54.
> > Thanks in advance.
> > ,
> > Josh.

-- 
Michael Vergoz
BinarySEC - R&D.
http://www.binarysec.com/
mv@binarysec.com
Skype: descript



Re: Problems in apr_rmm.c

Posted by Jess Holle <je...@ptc.com>.
I suspect (somewhat strongly) that this issue is in util_ldap, not in 
APR, but Josh's question is a good one -- is this a known util_ldap issue?

We had for some time disabled shared memory in util_ldap by pretending 
it did not exist on any platform by replacing shared-memory ifdefs with 
#if 0's.  Perhaps it is time to do this again?  Seeing such an issue on 
Windows worries me that other platforms are a house of cards in this 
area as well...

--
Jess Holle

Fenlason, Josh wrote:

> Has anyone seen any problems in apr_rmm.c on systems with shared 
> memory and ldap enabled?
> When I stop Apache via Crtl-C, I'm getting the Windows error saying 
> that something is a miss in Apache.  Stepping into the debugger, 
> reveals that the problem is at line 373 of srclib\apr-util\misc\apr_rmm.c.
>  
> else {
>     if (rmm->base->firstused != this) {
>         APR_ANYLOCK_UNLOCK(&rmm->lock);
>         return APR_EINVAL;
>     }
> }
>  
> firstused has not been initialized.  If I rebuild Apache without 
> shared memory, the problem goes away.  Has anyone else seen anything 
> like this?  Any suggestions on how to resolve this?
> I'm on XP SP1, Apache 2.0.54.
> Thanks in advance.
> ,
> Josh.



Re: Problems in apr_rmm.c

Posted by Joe Orton <jo...@redhat.com>.
On Tue, Aug 02, 2005 at 04:26:44PM -0400, Fenlason, Josh wrote:
> Has anyone seen any problems in apr_rmm.c on systems with shared memory
> and ldap enabled?
> When I stop Apache via Crtl-C, I'm getting the Windows error saying that
> something is a miss in Apache.  Stepping into the debugger, reveals that
> the problem is at line 373 of srclib\apr-util\misc\apr_rmm.c.

There are at least the following serious shared memory cache handling 
issues in the 2.0.54 code:

1) NULL payload pointers at full cache
   -> http://svn.apache.org/viewcvs?rev=225746&view=rev

2) wrong size of shm segment being used
   -> http://svn.apache.org/viewcvs?rev=225753&view=rev

3) mutex permissions not being initialized properly
   -> http://svn.apache.org/viewcvs.cgi?rev=105412&view=rev

(3) probably doesn't affect Win32 but the other two might.  I'm not 
aware of any apr_rmm bugs in the 2.0.54 (apr-0.9.6) code.

joe