Bug 29533

Summary: deadlock
Product: Apache httpd-2 Reporter: ek
Component: CoreAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: CLOSED DUPLICATE    
Severity: normal    
Priority: P3    
Version: 2.0.49   
Target Milestone: ---   
Hardware: All   
OS: All   

Description ek 2004-06-11 22:48:23 UTC
if a CGI process writes a lot of data to stderr it can get into a deadlock
situation with the httpd process connected to it. I can reproduce this by
editing the test-cgi script provided with apache and adding several lines like this:

export 1>&2

if there's enough of these lines, you get a lock up.

it seems that apache waits to read all of the output on stdout of the CGI script
before even looking at stderr. so if you write enough bytes to stderr to
overflow the pipe buffer to httpd, the CGI process will lock up waiting to write
to stderr and the httpd process will lock up waiting for EOF on the CGI's
stdout. this is system dependent because the size of the pipe buffers differs
from system to system. I've seen this problem on solaris and irix.

is there a way to tell apache to not intercept stderr and let it go directly to
the error_log?

thanks

lefteris
Comment 1 André Malo 2004-06-11 22:58:06 UTC

*** This bug has been marked as a duplicate of 22030 ***