Package: libapache2-mod-fastcgi
Version: 2.4.6-1
Severity: normal
Tags: upstream patch

The exact error message I had in error_log is as follow : 

[Thu Jan 12 07:36:56 2012] [error] [client 127.0.0.1] (2)No such file or 
directory: FastCGI: failed to connect to server 
"/var/alternc/cgi-bin/php52.fcgi": socket file descriptor (1345) is larger than 
FD_SETSIZE (1024), you probably need to rebuild Apache with a larger FD_SETSIZE

This bug has already been reported for apache1.3 long ago : #280206 but was 
never fixed.

It is still buggy in apache2, but only appears when you have more than 1024 
file descriptors opened in Apache itself (in my case, more than 512 Vhosts with 
2 filehandle per vhost...)

The FD_SETSIZE check from fastcgi source code definitely looks like a buggy 
check: 
It checks that a file descriptor number is <1024, and pretends it may be above 
ulimit limits if that's the case... but that's useless: if you try to open a 
file above ulimit limits, you will have 0 as file descriptor returned from 
open() syscall...
More than that, it compares that file descriptor number with FD_SETSIZE, which 
is definitely not the maximum number of file an apache2 can open, you may have 
made it far higher with ulimit -n in the system configuration ...
So the patch I'm using since (successfully) is just removing that useless check 
...

Hope this can help solving this, don't hesitate to ask for help on this 
package, as you can see, I use it on many vhosts ;) 


-- System Information:
Debian Release: 6.0.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-vserver-686-bigmem (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libapache2-mod-fastcgi depends on:
ii  apache2.2-common       2.2.16-6+squeeze4 Apache HTTP Server common files
ii  libc6                  2.11.2-10         Embedded GNU C Library: Shared lib

libapache2-mod-fastcgi recommends no packages.

libapache2-mod-fastcgi suggests no packages.

-- no debconf information
--- libapache-mod-fastcgi-2.4.6.orig/mod_fastcgi.c	2007-11-13 00:00:10.000000000 +0100
+++ libapache-mod-fastcgi-2.4.6/mod_fastcgi.c  2012-01-11 18:08:56.000000000 +0100
@@ -1366,16 +1366,6 @@
         return FCGI_FAILED; 
     }
 
-#ifndef WIN32
-    if (fr->fd >= FD_SETSIZE) {
-        ap_log_rerror(FCGI_LOG_ERR, r,
-            "FastCGI: failed to connect to server \"%s\": "
-            "socket file descriptor (%u) is larger than "
-            "FD_SETSIZE (%u), you probably need to rebuild Apache with a "
-            "larger FD_SETSIZE", fr->fs_path, fr->fd, FD_SETSIZE);
-        return FCGI_FAILED;
-    }
-#endif
 
     /* If appConnectTimeout is non-zero, setup do a non-blocking connect */
     if ((fr->dynamic && dynamicAppConnectTimeout) || (!fr->dynamic && fr->fs->appConnectTimeout)) {

Reply via email to