ID: 13806
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Old Summary: zlib compression is broken?
Status: Open
Bug Type: Reproducible crash
Old Operating System: Linux 2.4.14-pre3/glibc 2.2.2
Operating System: Linux 2.4.4/glibc 2.2.2
Old PHP Version: 4.1.0 RC CVS-2001-10-24
PHP Version: 4.1.0 RC CVS-2001-11-11
New Comment:

Tested with current 4.1.0RC/4.2.0 CVS.

configure:
#! /bin/sh
#
# Created by configure

'./configure' \
'--with-apxs' \
'--disable-short-tags' \
'--without-mysql' \
'--without-pear' \
'--with-zlib' \
'--enable-debug' \
"$@"

php.ini : php.ini-recommended with zlib compression ON

test script #1 (more than buf size):
<?php

for ($i=0; $i < 1026; $i++) {
        echo "abcd";
}

?>

test script #2 (less than buf size):
?php

for ($i=0; $i < 1022; $i++) {
        echo "abcd";
}

?>


result - 4.1.0RC: 
4.1.0RC works fine without zlib compression, but not with zlib output compression. 
httpd just keeps growing when output exceed buf size. (I killed it when it became 
100MB)

It cannot display phpinfo().
There are many log entry for memory leak for apache.
result - 4.2.0:
It seems there is no problem in 4.2.0 now. It works for both script and can display 
phpinfo(). (It was not working before, at least when 4.1.0RC1 is released.)

output.c has not been changed. It seems real problem was in some other place.


Previous Comments:
------------------------------------------------------------------------

[2001-11-10 19:16:03] [EMAIL PROTECTED]

Thanks for your time.

However, 8MB memory limit should be enough for phpinfo() output with zlib compression, 
isn't it?
Buffer size is default. (4096)

I'll test against with current 4.1.0RC CVS and 4.2.0-dev and report result later.


------------------------------------------------------------------------

[2001-11-10 11:48:21] [EMAIL PROTECTED]

Looks like it may be related to bug #13698 after all.  The mbstring-auto-conversion 
may be the problem here, as without it - I cannot reproduce the bug, and it appears to 
work fine...


------------------------------------------------------------------------

[2001-11-10 11:12:21] [EMAIL PROTECTED]

This issue does not appear to be related in any way to the bug id's 12270 and 13698...


------------------------------------------------------------------------

[2001-11-10 11:07:11] [EMAIL PROTECTED]

This is most probably not a bug, at least not in the way you perceive it.  With a 
large output buffer - the script will indeed have to consume lots of memory.  If your 
memory limit does not allow this - you'll get these warnings, and in case of a debug 
build - those complaints about memory being freed...

Now, there could be two authentic bugs:

(a) There may be a bug in the memory limit implementation.  However, it's the same as 
it has been for years, and it may be that just output buffering is exploiting it in a 
way that wasn't thought of before.  Generally, if the memory limit is reached, PHP 
tries to bail out nicely.  If somehow, PHP goes on consuming more memory, beyond 1MB 
above the memory limit - it performs a hard exit().  It's possible that the shutdown 
sequence causes some loop of memory exhaustion - bailout - memory exhaustion - 
bailout#2 - etc., which cannot be broken.  I'll take a look at it.

(b) There might be a memory leak in the zlib output compression code.  Please let me 
know what buffer size you use.  You really shouldn't be using more than about 16KB or 
so.


------------------------------------------------------------------------

[2001-10-28 10:28:34] [EMAIL PROTECTED]

Problem is appearent if output is larger than output buffer size.

httpd exits with code 01 with following script 
(No output)

<?php
for ($i=0; $i < 1024; $i++) echo 'abcd';
?>

but it not with
(Output is correct)

<?php
for ($i=0; $i < 1023; $i++) echo 'abcd';
?>

It exits with code 01 with more complex script w/o output, though.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/?id=13806


Edit this bug report at http://bugs.php.net/?id=13806&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to