You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Akins <ba...@web.turner.com> on 2004/04/06 18:17:57 UTC

worker error

[Tue Apr 06 12:16:10 2004] [crit] [Tue Apr 06 12:16:10 2004] file 
worker.c, line 708, assertion "rv == 0 || !csd" failed

Can someone interpret?  2.0.49 on Linux

-- 
Brian Akins
Senior Systems Engineer
CNN Internet Technologies


Re: worker error

Posted by Jeff Trawick <tr...@attglobal.net>.
Brian Akins wrote:
> Jeff Trawick wrote:
> 
>>
>> The better-yet-still-reasonably quick hack is to zap the FD_SETSIZE 
>> checks in os/unix/unixd.c and server/mpm/worker/worker.c.  Since your 
>> platform has poll(), you won't suffer from lack of FD_SETSIZE checking 
>> in APR 0.9.
>>
> I wrapped these sections with:
> 
> #ifndef HAVE_POLL

HAVE_POLL is not defined in that file for me on a system with poll().
This makes sense, as Apache would rely on APR to fuss over such details.

> and all is well now.

or you haven't hit the problem again (yet)?

Re: worker error

Posted by Brian Akins <ba...@web.turner.com>.
Jeff Trawick wrote:

>
> The better-yet-still-reasonably quick hack is to zap the FD_SETSIZE 
> checks in os/unix/unixd.c and server/mpm/worker/worker.c.  Since your 
> platform has poll(), you won't suffer from lack of FD_SETSIZE checking 
> in APR 0.9.
>
I wrapped these sections with:

#ifndef HAVE_POLL

and all is well now.

Is this portable?

-- 
Brian Akins
Senior Systems Engineer
CNN Internet Technologies


Re: worker error

Posted by Jeff Trawick <tr...@attglobal.net>.
Brian Akins wrote:
> [Tue Apr 06 12:16:10 2004] [crit] [Tue Apr 06 12:16:10 2004] file 
> worker.c, line 708, assertion "rv == 0 || !csd" failed
> 
> Can someone interpret?  2.0.49 on Linux

It is a should not occur of course, but I think this code in os/unix/unixd.c is 
the problem:

  if (sockdes >= FD_SETSIZE) {
             ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL,
                          "new file descriptor %d is too large; you probably need "
                          "to rebuild Apache with a larger FD_SETSIZE "
                          "(currently %d)",
                          sockdes, FD_SETSIZE);
             apr_socket_close(csd);
             return APR_EINTR;
         }


This code should have set *accepted to NULL before returning.

The big picture is that this check that is improperly handled is not 
appropriate for your platform anyway.  On modern platforms, Apache2+APR will 
not use select() on descriptors, so FD_SETSIZE concerns are ill-founded.

APR 1.0-dev has changes to handle FD_SETSIZE issues at the proper place, and
Apache 2.1-dev has changes to stop assuming there are FD_SETSIZE issues.  Those 
changes need to be backported to APR 0.9/httpd-2.0.

The easiest hack is probably: before "return APR_EINTR", add "*accepted = 
NULL;".  But that will yield a busy loop until some other thread frees up a 
descriptor < FD_SETSIZE.

The better-yet-still-reasonably quick hack is to zap the FD_SETSIZE checks in 
os/unix/unixd.c and server/mpm/worker/worker.c.  Since your platform has 
poll(), you won't suffer from lack of FD_SETSIZE checking in APR 0.9.