From:             nikic
Operating system: 
PHP version:      Irrelevant
Package:          *General Issues
Bug Type:         Bug
Bug description:array_fill leaks if start index is PHP_INT_MAX

Description:
------------
<?php array_fill(PHP_INT_MAX, 2, '*')

Leaks:


[Sat Feb 11 20:47:35 2012]  Script:  'reproduceCode4_memoryLeak.php'
/home/nikic/dev/php-src-git/Zend/zend_vm_execute.h(2371) :  Freeing
0xB786F010 
(20 bytes), script=reproduceCode4_memoryLeak.php
[Sat Feb 11 20:47:35 2012]  Script:  'reproduceCode4_memoryLeak.php'
/home/nikic/dev/php-src-git/Zend/zend_vm_execute.h(2374) :  Freeing
0xB7870558 
(1 bytes), script=reproduceCode4_memoryLeak.php
/home/nikic/dev/php-src-git/Zend/zend_variables.c(121) : Actual location 
(location was relayed)
=== Total 2 memory leaks detected ===

Reason:

zval_add_ref is called regardless of whether zend_hash_next_index_insert 
succeeds in 
http://lxr.php.net/opengrok/xref/PHP_TRUNK/ext/standard/array.c#1570.


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

Reply via email to