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

 ID:                 53153
 Updated by:         cataphr...@php.net
 Reported by:        cataphr...@php.net
 Summary:            Memory leak with phpinfo() + output buffering + zlib
                     compression
 Status:             Open
 Type:               Bug
 Package:            Output Control
 Operating System:   Windows 7 x64
 PHP Version:        trunk-SVN-2010-10-25 (SVN)
 Block user comment: N

 New Comment:

Interestingly there's also some corrupted/uninitialized memory in the
memory leak message:



</div></body></html>[Mon Oct 25 18:19:39 2010]  Script: 
'zzzzzzzzz8↔▄¥▄¥¥?d╔�...@Ç

☺'

c:\users\cataphract\documents\php-src\main\output.c(809) :  Freeing
0x012B0088 (

49152 bytes), script=zzzzzzzzz8↔▄¥▄¥¥?d╔�...@Ç☺

=== Total 1 memory leaks detected ===


Previous Comments:
------------------------------------------------------------------------
[2010-10-25 19:25:44] cataphr...@php.net

Description:
------------
There is a memory leak on memory allocated on \main\output.c(809):



                if ((handler->buffer.size - handler->buffer.used) <= buf->used) 
{

                        size_t grow_int = 
PHP_OUTPUT_HANDLER_INITBUF_SIZE(handler->size);

                        size_t grow_buf = 
PHP_OUTPUT_HANDLER_INITBUF_SIZE(buf->used -
(handler->buffer.size - handler->buffer.used));

                        size_t grow_max = MAX(grow_int, grow_buf);

                        

                        handler->buffer.data = erealloc(handler->buffer.data,
handler->buffer.size + grow_max); /* memory was allocated here */

                        handler->buffer.size += grow_max;

                }







phpinfo() code:



        /* Andale!  Andale!  Yee-Hah! */

        php_output_start_default(TSRMLS_C);

        php_print_info(flag TSRMLS_CC);

        php_output_end(TSRMLS_C);

Test script:
---------------
File file.php

---

<?php

phpinfo();



(only the non disablable modules are loaded)



php-cgi -dzlib.output_compression=1 -doutput_buffering=10K file.php



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



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

Reply via email to