Bug 97111 - httpd insists on always calculating Content-Length from CGI output.
httpd insists on always calculating Content-Length from CGI output.
Product: Red Hat Linux
Classification: Retired
Component: httpd (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
Brian Brock
: 84642 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2003-06-10 11:19 EDT by Marc Heckmann
Modified: 2007-04-18 12:54 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-09-04 03:40:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Marc Heckmann 2003-06-10 11:19:18 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.3.1) Gecko/20030527

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):

How reproducible:

Steps to Reproduce:

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


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

# 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 10:12:15 EDT
Confirmed with Redhat 9 too.


Comment 2 Mark J. Cox (Product Security) 2003-09-04 03:40:25 EDT
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.

Comment 3 Joe Orton 2003-09-05 02:09:45 EDT
*** Bug 103744 has been marked as a duplicate of this bug. ***
Comment 4 Joe Orton 2003-10-09 04:10:02 EDT
*** Bug 84642 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.