#32508 [Opn->Fbk]: ob_gzhandler w/ chunking can crash Apache 2
| From: | sniper@php.net | Date: | Thu, 31 Mar 2005 06:20:57 +0000 |
| Subject: | #32508 [Opn->Fbk]: ob_gzhandler w/ chunking can crash Apache 2 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76098@lists.php.net to get a copy of this message | ||
ID: 32508
Updated by: sniper@php.net
Reported By: myronwu at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: Output Control
Operating System: Linux 2.4
PHP Version: 5.0.3
New Comment:
Does it only happen when you have phpinfo() in there?
(I'd put something else between there..)
Also, try doing ./configure --help sometimes. You have several options
used that don't even exist. Like --enable-track-vars, --with-apache2..
Previous Comments:
------------------------------------------------------------------------
[2005-03-31 02:15:34] myronwu at gmail dot com
Reconfirmed the bug using the reproduce code on CVS snapshot
php5-STABLE-200503302230, 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'
Otherwise same setup as reported above.
------------------------------------------------------------------------
[2005-03-30 22:44:12] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
------------------------------------------------------------------------
[2005-03-30 22:38:41] myronwu at gmail dot com
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 this bug report at http://bugs.php.net/?id=32508&edit=1