Bug 102005

Summary: child httpd hangs when cgi prints more than 4096 bytes to stderr
Product: [Retired] Red Hat Linux Reporter: Luiz <buster>
Component: httpdAssignee: Joe Orton <jorton>
Status: CLOSED UPSTREAM QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
URL: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22030
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-09-11 14:44:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
CGI source code none

Description Luiz 2003-08-08 19:49:14 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030711

Description of problem:
A CGI (and its parent httpd) hangs while printing long strings with more than
4096 bytes to stderr.

Multiple small strings on printf have the same effect as a single long string in
printf.




Version-Release number of selected component (if applicable):
httpd-2.0.40-21.3

How reproducible:
Always

Steps to Reproduce:
1. gcc -o /var/www/cgi-bin/apbuf.cgi apbuf.c
2. wget http://localhost/cgi-bin/apbuf.cgi

    

Actual Results:  Both the cgi and its parent httpd hanged.

# strace -p `pidof apbuf.cgi`
write(2, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"..., 4097 <unfinished ...>

# strace -p 22412
poll( <unfinished ...>

(22412 was apbuf.cgi parent)

Even after killing wget with ctrl-c:
#pstree     
(...)
     &#9500;&#9472;httpd&#9472;&#9516;&#9472;7*[httpd]
     &#9474;       &#9492;&#9472;httpd&#9472;&#9472;&#9472;apbug.cgi
(...)

Nothing is appended to error_log.

Expected Results:  wget should save apbug.cgi file with an "ok",
apache should append a line with 4097 A's to error_log.

Additional info:

LANG="en_US.UTF-8"
SUPPORTED="en_US.UTF-8:en_US:en"
LC_COLLATE="C"

Comment 1 Luiz 2003-08-08 19:51:32 UTC
Created attachment 93535 [details]
CGI source code

Comment 2 Joe Orton 2003-09-11 14:44:41 UTC
This is a known design issue with mod_cgi in httpd 2.0.x; I'll defer to the
upstream bug, there is no simple fix we can integrate.  Thanks for the report.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22030