httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: worker error
Date Tue, 06 Apr 2004 17:43:27 GMT
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);
             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.

View raw message