httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 57229] mod_sed dies on long lines
Date Fri, 08 Jul 2016 05:04:35 GMT

--- Comment #4 from Christophe JAILLET <> ---
Way to reproduce, sent by Kaufmann, Oliver:

sample php code to reliably trigger the problem:

print "first line with newline (all good)<br>\n";
print "now printing one single matching line with $mynum*$mylength=$bytes bytes
expanding to $bytes2 bytes:<br>\n";
for ($i=0; $i < $mynum; $i++)
                print "$myline";
print "\nThis is a test line. If you see it, all is good. Else mod_sed

Apache config snipplet:

LoadModule authn_file_module modules/
LoadModule authn_core_module modules/
LoadModule authz_host_module modules/
LoadModule authz_groupfile_module modules/
LoadModule authz_user_module modules/
LoadModule authz_core_module modules/
LoadModule access_compat_module modules/
LoadModule auth_basic_module modules/
LoadModule reqtimeout_module modules/
LoadModule filter_module modules/
LoadModule sed_module modules/
LoadModule mime_module modules/
LoadModule log_config_module modules/
LoadModule env_module modules/
LoadModule headers_module modules/
LoadModule setenvif_module modules/
LoadModule version_module modules/
LoadModule proxy_module modules/
LoadModule proxy_ajp_module modules/
LoadModule unixd_module modules/
LoadModule status_module modules/
LoadModule autoindex_module modules/
LoadModule info_module modules/
LoadModule vhost_alias_module modules/
LoadModule dir_module modules/
LoadModule alias_module modules/
LoadModule rewrite_module modules/
LoadModule ssl_module modules/
LoadModule php5_module modules/
AddHandler php5-script php
In vhost:
RequestHeader unset Accept-Encoding
AddOutputFilterByType Sed text/html text/css text/javascript
Header unset Content-Length

Software: Apache 2.4.10 + mod_sed compiled from source.
mod_sed  source taken from trunk at the moment, but error also happened on
stock apache 2.4.10 release version, this is why we switched to trunk.
For our tests we have also compiled sed1.c with different #define INIT_BUF_SIZE
values (stock value is 1024). Error scales with this buffer size.
In our current test we have set INIT_BUF_SIZE to 8092 (not 8192).

Remember: We have INIT_BUF_SIZE 8092 in this test.
Ouput: nothing if $mynum>=176. Browser times out and says Connection Problem
(Message depends on Browser vendor of course).
Output: correct if $mynum<=175;
first line with newline (all good)
now printing one single matching line with 175*23=4025 bytes expanding to 7350
Last line is also shown

Beware: Sometimes (maybe on first request, but seldom) you may get output with
values near 176 as well. If you get output this way, you can see that
substitution stopped before all lines were processed. Output then shows
correctly substituted lines at the beginning but at the end the original lines
are shown and rest of document may be completely truncated. Usually if you see
this, you can try to reload the page and might then end up with an empty page
and the connection problem. With $mynum=178 you will always trigger the error.

Just run your own tests with different buffer sizes.

Linux system: Redhat 6.5 x64
HW: HP Proliant G6 with 192GB of RAM
No other jobs or load on this test system.


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