Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 164318 - www-servers/lighttpd - fastcgi prints an empty error (from stderr) line for each valid one
Summary: www-servers/lighttpd - fastcgi prints an empty error (from stderr) line for e...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: www-servers Herd (OBSOLETE)
URL: http://trac.lighttpd.net/trac/ticket/998
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-28 21:41 UTC by Carlo Marcelo Arenas Belon
Modified: 2007-08-26 19:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for lighttpd that implements a fix for the problem in gentoo's format (04_all_lighttpd-1.4.13-quiet-error.diff,419 bytes, patch)
2007-01-28 21:44 UTC, Carlo Marcelo Arenas Belon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlo Marcelo Arenas Belon 2007-01-28 21:41:48 UTC
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
Comment 1 Carlo Marcelo Arenas Belon 2007-01-28 21:44:49 UTC
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
Comment 2 Carlo Marcelo Arenas Belon 2007-01-28 22:35:23 UTC
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
Comment 3 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2007-08-26 16:10:25 UTC
is this fixed in recent releases of lighttpd ? 
what is the upstream bug number?
thanks
Comment 4 Carlo Marcelo Arenas Belon 2007-08-26 18:07:24 UTC
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)
Comment 5 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2007-08-26 19:17:08 UTC
ahh - missed the URL - my bad.
thanks for feedback and the original report.