the fastcgi packet protocol sends 2 FCGI_STDERR packets for each call to FCGX_FPrintF(err, ...), and lighttpd prints both resulting in s second line that is empty as shown by the following log excerpt : 2007-01-28 04:08:35: (mod_fastcgi.c.2380) FastCGI-stderr: This is an error message 2007-01-28 04:08:35: (mod_fastcgi.c.2380) FastCGI-stderr: for the following fastcgi program : /* compile with gcc -lfcgi */ #include "fcgi_config.h" #include "fcgi_stdio.h" int main() { while (FCGI_Accept() >=0) { printf("Content-type: text/html\r\n"); printf("\r\n"); printf("This is some content"); fprintf(stderr, "This is some error"); } return 0; } Reproducible: Always Steps to Reproduce: 1. deploy lighttpd with fastcgi support 2. compile and configure attached fastcgi test program 3. Actual Results: 2 lines of errors in the log for each invocation of fprintf, only the first one contains the message while the second one came from a packet with length of 0 and therefore is empty. Expected Results: 1 line of error with the right message in the log
Created attachment 108418 [details, diff] patch for lighttpd that implements a fix for the problem in gentoo's format tested with a lighttpd-1.4.13-r1 based ebuild. just dropping this file in files/1.4.13 should be all that is needed
changing summary as this is a 1.4.13 specific problem but affects also older versions of lighttpd (including the ones that are stable). the patch instructions are 1.4.13 specific (but should work also with older ebuilds) and the testing was only done in 1.4.13 though
is this fixed in recent releases of lighttpd ? what is the upstream bug number? thanks
upstream bug report by me is linked in URL and corresponds with ticket 998. was fixed upstream with >=lighttpd-1.4.14 which is marked stable in most architectures. hence resolving bug as upstream (sorry about that)
ahh - missed the URL - my bad. thanks for feedback and the original report.