Bug #13806 Updated: zlib compression is broken?

From: Date: Sun, 11 Nov 2001 11:16:53 +0000
Subject: Bug #13806 Updated: zlib compression is broken?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-70092@lists.php.net to get a copy of this message
ID: 13806
User updated by: yasuo_ohgaki@yahoo.com
Reported By: yasuo_ohgaki@yahoo.com
Old Status: Open
Status: Closed
Bug Type: Reproducible crash
Operating System: Linux 2.4.4/glibc 2.2.2
PHP Version: 4.1.0 RC CVS-2001-11-11
New Comment:

This bug is fixed for both 4.1.0 and 4.2.0.
Closed.

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

[2001-11-10 20:44:16] yasuo_ohgaki@yahoo.com

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.


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

[2001-11-10 19:16:03] yasuo_ohgaki@yahoo.com

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] zeev@php.net

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] zeev@php.net

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] zeev@php.net

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.


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

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



Thread (19 messages)

« previous php.dev (#70092) next »