From:             mbecc...@php.net
Operating system: Ubuntu 9.10
PHP version:      6SVN-2009-12-31 (SVN)
PHP Bug Type:     Unicode Engine related
Bug description:  Memory leak in OnUpdateUTF8String

Description:
------------
Discovered this while checking for leaks in my own changes. It always
happens, even with an empty script.

90 bytes are definitely lost, plus 7+ kbytes still reachable that I'm not
reporting here (overlong list).

Reproduce code:
---------------
# valgrind --tool=memcheck --num-callers=30 --leak-check=full sapi/cli/php
< /dev/null

Expected result:
----------------
No leaks

Actual result:
--------------
==18400== HEAP SUMMARY:
==18400==     in use at exit: 7,750 bytes in 33 blocks
==18400==   total heap usage: 36,914 allocs, 36,881 frees, 4,687,551 bytes
allocated
==18400== 
==18400== 90 bytes in 2 blocks are definitely lost in loss record 28 of
32
==18400==    at 0x4C2524D: realloc (vg_replace_malloc.c:476)
==18400==    by 0x721D10: OnUpdateUTF8String (zend_ini.c:694)
==18400==    by 0x722AAA: zend_register_ini_entries (zend_ini.c:215)
==18400==    by 0x5937B9: zm_startup_session (session.c:2006)
==18400==    by 0x70CC08: zend_startup_module_ex (zend_API.c:1929)
==18400==    by 0x71525B: zend_hash_apply (zend_hash.c:873)
==18400==    by 0x70CA1B: zend_startup_modules (zend_API.c:1978)
==18400==    by 0x69EBC9: php_module_startup (main.c:2157)
==18400==    by 0x7A37EC: php_cli_startup (php_cli.c:407)
==18400==    by 0x7A412A: main (php_cli.c:781)
==18400== 
==18400== LEAK SUMMARY:
==18400==    definitely lost: 90 bytes in 2 blocks
==18400==    indirectly lost: 0 bytes in 0 blocks
==18400==      possibly lost: 0 bytes in 0 blocks
==18400==    still reachable: 7,660 bytes in 31 blocks
==18400==         suppressed: 0 bytes in 0 blocks


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

Reply via email to