httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 44782] New: (104)Connection reset by peer: ap_content_length_filter: apr_bucket_read() failed
Date Wed, 09 Apr 2008 04:46:12 GMT

           Summary: (104)Connection reset by peer: ap_content_length_filter:
                    apr_bucket_read() failed
           Product: Apache httpd-2
           Version: 2.2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: All

After months of trying to figure out what triggers this error:

[Tue Apr 08 18:48:41 2008] [error] [client 123.456.789.012] (104)Connection
reset by peer: ap_content_length_filter: apr_bucket_read() failed, referer:

I finally found how to duplicate this on any Apache server. I've found this to
be true with all versions from 2.2.4 (earliest 2.x version I have) to 2.2.8

Linux CentOS (2.6.18-53.1.14.el5) completely up-to-date. Apache compiled from
source. Using mod_perl compiled like this:

shell> perl Makefile.PL MP_USE_STATIC=1 \
MP_AP_PREFIX=/usr/local/src/httpd-2.2.8 \
MP_AP_CONFIGURE="--with-mpm=worker \
--enable-nonportable-atomics=yes \
--prefix=/usr/local/etc/httpd \
--enable-so \
--enable-expires \
--enable-headers \
--enable-rewrite \
--with-ssl=/usr/local/src/openssl-0.9.8g \
--enable-ssl \
--disable-autoindex \

All it takes to produce the above error with Apache is to send a post to a cgi
script that does not handle the post data. Example program (test.cgi - not
running in mod_perl):

#!/usr/bin/perl -w
$| = 1;

print "Content-type: text/html\n\n";
print <<"end_of_html";
<title>your title</title>


Now setup a simple HTML form and post to the above program:

<title>your title</title>
<form action="/cgi-bin/test.cgi" method="post">
<input type="submit" name="test" value="Test It">

(notice the "name='test'" as some data is required.) The above will cause the
browser to hang after post triggering the browser to disconnect from the server
and will always produce the above error guaranteed! Change from POST to GET and
no "Connection reset by peer" error. The test.cgi script will exit properly,
but Apache keeps the connection alive and then the browser disconnects.

I have tested this with Linux Firefox/ -, Opera 9.26 as well
as on Windows XP Professional with Firefox/ and IE 7.0.5730.11.

Note: If you add this to the top of the test.cgi program:

read(STDIN, my $buffer, $ENV{'CONTENT_LENGTH'});

No disconnect is encountered.

I believe this to be an Apache problem as all earlier versions of Apache did
not behave in this manner.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message