From:             myronwu at gmail dot com
Operating system: Linux 2.4
PHP version:      5.0.3
PHP Bug Type:     Output Control
Bug description:  ob_gzhandler w/ chunking can crash Apache 2

Description:
------------
In certain browsers, attempting to output data before a 
call to ob_start('ob_gzhandler', chunk_size) causes 
Apache 2 to consume huge (all) amounts of memory.  This 
only occurs when chunking takes place (ie size of data 
output > chunk_size).

Outputting data before a call to ob_start without a 
chunk_size or without 'ob_gzhandler' works as expected.

Browsers tested that were affected:  Firefox, Opera
Browsers tested that were unaffected:  Links

Diff between php.ini and php.ini-dist:
register_globals = On

Apache version:
Apache/2.0.53 (Unix) mod_ssl/2.0.53 OpenSSL/0.9.7a PHP/
5.0.3

using prefork mpm.

Zlib version: 1.1.4

PHP configure command:

'./configure' '--with-mysqli=/usr/local/mysql/bin/
mysql_config' '--with-mysql=/usr/local/mysql' '--with-
apache2=/usr/src/apache/httpd-2.0.53' '--enable-yp' '--
enable-track-vars' '--with-zlib' '--with-jpeg' '--with-
png' '--with-tiff' '--with-pdflib' '--with-gd' '--with-
apxs2=/var/www/bin/apxs' '--with-gettext' '--with-
pspell'

This was also reproduced on another box with the same 
versions of Apache 2, zlib, but PHP 4.3.1 with configure 
command:

'./configure' '--with-mysql=/usr/local/mysql' '--with-
apache2=/usr/src/httpd-2.0.46' '--enable-yp' '--enable-
track-vars' '--with-zlib-dir=/usr/local/lib' '--with-
jpeg-dir=/usr/local/lib' '--with-png-dir=/usr/local/lib' 
'--with-tiff-dir=/usr/local/lib' '--with-pdflib' '--
with-gd=yes' '--with-apxs2=/var/www/bin/apxs'

Reproduce code:
---------------
<?php

echo 'test!';
ob_start('ob_gzhandler', 2048);
phpinfo();
ob_end_flush();

?>

Expected result:
----------------
test! (phpinfo() output)

Actual result:
--------------
Nothing.  The browser doesn't receive any information to 
display and httpd begins to consume all available 
memory.

-- 
Edit bug report at http://bugs.php.net/?id=32508&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32508&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32508&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32508&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32508&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32508&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32508&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32508&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32508&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32508&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32508&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32508&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32508&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32508&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32508&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32508&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32508&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32508&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32508&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32508&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32508&r=mysqlcfg

Reply via email to