You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2013/08/22 16:33:43 UTC

[Bug 55468] New: gzipped input truncated

https://issues.apache.org/bugzilla/show_bug.cgi?id=55468

            Bug ID: 55468
           Summary: gzipped input truncated
           Product: Apache httpd-2
           Version: 2.4.6
          Hardware: PC
            Status: NEW
          Severity: regression
          Priority: P2
         Component: mod_deflate
          Assignee: bugs@httpd.apache.org
          Reporter: shaggie76@hotmail.com

Longer POST bodies get truncated when mod_deflate inflates gzip-encoded data.
This seems to be a recent regression.

We have been using SetInputFilter DEFLATE with gzip-encoded POST bodies with
great success for many months on Linux with Apache 2.2.22. We also have been
using it on Windows 7 with 2.4.2 with no problems for the same period.

We recently updated both to 2.4.6 and started having problems with truncated
POSTs -- it took a while to boil it down because at first it seemed coincident
with an upgrade to PHP 5.5 however I've made an isolated test case that just
uses CGI to rule out PHP entirely so I'm pretty sure recent changes to
mod_deflate.c are responsible.

Here's a quick hack I used to reproduce the problem on Windows

httpd.conf snip:

Alias /inflate/ "S:/InflateTests/"

<Directory "S:/InflateTests">
    SetInputFilter DEFLATE
    Options +ExecCGI
    AddHandler cgi-script .pl

    Order allow,deny
    Allow from all
    Require all granted
</Directory>

echo.pl:

#!d:/Perl/perl/bin/perl.exe
print "Content-Type: text/plain\n\n";
$len = 0;
while (<>) { print; $len += length($_); }

print("$len bytes echoed\n");

repro steps:

I used mod_deflate.c as a test upload

1) wget -O- --post-file=mod_deflate.c http://localhost/inflate/echo.pl
... echoes full file, 58603 bytes echoed

2) gzip -n mod_deflate.c
3) wget -O- --post-file=mod_deflate.c.gz --header="Content-Encoding: gzip"
http://localhost/inflate/echo.pl
... echoes about half of the file, 32480 bytes echoed

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55468] gzipped input truncated

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55468

Glen Miner <sh...@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P1
           Severity|regression                  |blocker

--- Comment #7 from Glen Miner <sh...@hotmail.com> ---
Our production servers got updated to Ubuntu 14 LTS and this brought us up to
apache 2.4.

Linux war-api-dev 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014
x86_64 x86_64 x86_64 GNU/Linux

dpkg -s apache2
...
Version: 2.4.7-1ubuntu4.1

I re-ran this test and confirmed it's still broken. This is extremely
unfortunate because it means we now have to screw around to try to back out
this nightmare.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55468] gzipped input truncated

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55468

--- Comment #2 from Glen Miner <sh...@hotmail.com> ---
The fine gents over at apachelounge provided me a 2.4.4 archive to quickly test
against and it *did not* have the bug.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55468] gzipped input truncated

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55468

Glen Miner <sh...@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Glen Miner <sh...@hotmail.com> ---
2.4.10 is included with Ubuntu utopic -- for posterity this is how we got our
Ubuntu 14.04 LTS to upgrade just apache to get around this.

sudo vi /etc/apt/sources.list

Add these lines:

deb http://us.archive.ubuntu.com/ubuntu/ utopic main restricted universe
multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ utopic main restricted universe
multiverse

sudo vi /etc/apt/preferences

Add these lines:

Package: apache2*
Pin: release n=utopic
Pin-Priority: 999

Package: *
Pin: release a=utopic
Pin-Priority: -10

sudo apt-get update
sudo apt-get dist-upgrade

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55468] gzipped input truncated

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55468

--- Comment #8 from Glen Miner <sh...@hotmail.com> ---
I spent some time building httpd-2.4.10 from src with the intention of trying
to fix this myself only to discover that it seems to be fixed -- or at least my
test case passes now -- I will try to find a built package to install in our
production environment to test with.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55468] gzipped input truncated

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55468

Glen Miner <sh...@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Glen Miner <sh...@hotmail.com> ---
I just downgraded my local Apache to 2.4.2 and cannot reproduce the problem any
more.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55468] gzipped input truncated

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55468

--- Comment #3 from Eric Covener <co...@gmail.com> ---
(In reply to Glen Miner from comment #2)
> The fine gents over at apachelounge provided me a 2.4.4 archive to quickly
> test against and it *did not* have the bug.

Can you mix/match the mod_deflate.so just to make 100% certain it's strictly in
that module and not some intra-module thing?

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55468] gzipped input truncated

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55468

--- Comment #5 from Glen Miner <sh...@hotmail.com> ---
Good idea about module mix-match; it confirmed that the bug is in
mod_deflate.so because the mod from 2.4.6 reproduced the problem when dropped
into 2.4.4 server.

Error log is clean.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55468] gzipped input truncated

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55468

--- Comment #4 from Ruediger Pluem <rp...@apache.org> ---
Any messages in the error log?

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 55468] gzipped input truncated

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55468

--- Comment #6 from Glen Miner <sh...@hotmail.com> ---
I'm sorry if I'm naive but the one thing that jumps out at me in mod_deflate.c
between 2.4.4 and 2.4.6 is that it now calls ap_remove_input_filter (line 1024)
on  EOS (previously it just break out of the loop).

IE: the comment here seems to imply that left-over data may not be processed? 

    /* If we are about to return nothing for a 'blocking' read and we have
     * some data in our zlib buffer, flush it out so we can return something.
     */

I'm just fumbling in the dark here -- I hope it helps.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org