From:             cataphract
Operating system: Windows 7 x64
PHP version:      trunk-SVN-2010-10-25 (SVN)
Package:          Output Control
Bug Type:         Bug
Bug description:Memory leak with phpinfo() + output buffering + zlib compression

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 bug report at http://bugs.php.net/bug.php?id=53153&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53153&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53153&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53153&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53153&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53153&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53153&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53153&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53153&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53153&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53153&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53153&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53153&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53153&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53153&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53153&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53153&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53153&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53153&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53153&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53153&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53153&r=mysqlcfg

Reply via email to