Bug 97111

Summary: httpd insists on always calculating Content-Length from CGI output.
Product: [Retired] Red Hat Linux Reporter: Marc Heckmann <mh>
Component: httpdAssignee: Joe Orton <jorton>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: hrunting, jgiglio, johnh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-09-04 07:40:24 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:

Description Marc Heckmann 2003-06-10 15:19:18 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.3.1) Gecko/20030527
Debian/1.3.1-2

Description of problem:
httpd always insists on calculating Content-Length from CGI output and ignores
any Content-Length header added by the CGI script.

The result of this is that it buffers all of the CGI's STDOUT _before_ sending
the data to the client. This leads to httpd taking huge amounts of memory for
CGI's that stream data like mp3's to the client and OOM'ing the machine.

I even tried to move the "LoadModule cgi_module.." at the very end of all the
modules in case some filters/other modules were causing this and no difference.

Building httpd-2.0.45 from Rawhide src.rpm solves the problem.

this bug makes the stanard 8.0 httpd useless for me.

Version-Release number of selected component (if applicable):
httpd_2.0.40-11.5

How reproducible:
Always

Steps to Reproduce:

it's easy to reproduce, just drop the following in /var/www/cgi-bin/test.cgi:

=====================================================
#!/bin/sh

echo "Content-Type: audio/mpeg"
# modify line below to change the number to 
# the exact size of your mp3
echo "Content-Length: 13136351"
echo

# replace the following with some large mp3 file
cat /home/archives/56/2003-06-09/t1055196000.mp3

=====================================================

also removing the echo "Content-Length... " entirely should also be valid, but
it still insists on calculating it.

Actual Results:  httpd process used 30+Mb of memory. subsequent requests do the
same to other httpd's processes eventually the box OOM's.

Expected Results:  the memory consunption of httpd processes' should not have
changed much.

this is the case with Apache 2.0.45 and 1.3.x

Additional info:

Comment 1 John Hodrien 2003-08-06 14:12:15 UTC
Confirmed with Redhat 9 too.

httpd-2.0.40-21.3

jh

Comment 2 Mark J. Cox 2003-09-04 07:40:25 UTC
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2003-240.html


Comment 3 Joe Orton 2003-09-05 06:09:45 UTC
*** Bug 103744 has been marked as a duplicate of this bug. ***

Comment 4 Joe Orton 2003-10-09 08:10:02 UTC
*** Bug 84642 has been marked as a duplicate of this bug. ***