Bug 97111 - httpd insists on always calculating Content-Length from CGI output.
Summary: httpd insists on always calculating Content-Length from CGI output.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: httpd
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact: Brian Brock
URL:
Whiteboard:
: 84642 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-06-10 15:19 UTC by Marc Heckmann
Modified: 2007-04-18 16:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-09-04 07:40:24 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2003:240 0 normal SHIPPED_LIVE : Updated httpd packages fix Apache security vulnerabilities 2003-09-04 04:00:00 UTC

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. ***


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