httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shail Bhatnagar <>
Subject Re: Spurious return from select()
Date Wed, 08 Aug 2001 14:35:50 GMT
Jeff, Thanks for your response. I am 
using the standard child_main() loop
in which select() is protected by the
mutex. The only difference is that the
parent is bound to a well known udp
port and so all children are monitoring
this well known port. Despite this mutex,
I see this behavior fairly consistently.
The frequency is more on solaris than on linux.

The crash that I saw was in apr_pool_alloc_init().
apr_lock_create() failed, although there were
not permissions problems and then apr_lock_destroy()
crashed while accessing a NULL pointer.

The relevant code fragment in apr_pool_alloc_init() is :
    status = apr_lock_create(&alloc_mutex, APR_MUTEX, APR_INTRAPROCESS,
                   NULL, globalp);
    if (status != APR_SUCCESS) {
        return status;


Jeff Trawick wrote:
> Shail Bhatnagar <> writes:
> > I have observed that sometimes select()
> > returns a positive value to  one or more processes
> > but only one is able to read UDP data.
> On every system I know of, select() wakes up every process/thread
> selecting on the same descriptor (e.g., UDP socket) when the condition
> is met (e.g., a datagram is ready to read).
> You'll want to use a mutex to ensure that only one process is in the
> select()+recvfrom() path at a time.  Otherwise, the extra wakeups will
> hurt performance.
> But Apache already does this when there are multiple listening (TCP)
> sockets.  Take advantage of that mutex.
> > The server is this case has been modified
> > to listen on a well known udp port.
> >
> > Does anybody have any clue ? The errno returned
> > by recvfrom() is 11 - resource temporarily unavailable.
> >
> > Secondly, is there a know crash on Solaris when
> > APR_HAS_THREADS is on. This is about httpd 2.0.16 beta.
> Justin Erenkrantz fixed a gethostbyname() issue with a threaded build
> on Solaris < 8.  You may wish to try the latest code from CVS.
> --
> Jeff Trawick | | PGP public key at web site:
>              Born in Roswell... married an alien...

View raw message