ID:               36016
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Assigned
 Bug Type:         Scripting Engine problem
 Operating System: *
 PHP Version:      5CVS-2006-01-14 (CVS)
 Assigned To:      dmitry
 New Comment:

OK, found the problem: it was loosing the cache buckets while
transversing the hash list.
simpl patch: http://mega.ist.utl.pt/~ncpl/php_realpath_cache.txt
it also adds some comments, which can be useful to readers ;)


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

[2006-01-15 02:33:17] [EMAIL PROTECTED]

And remove those ifdefs finally. :)

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

[2006-01-15 02:24:37] [EMAIL PROTECTED]

Dmitry, please take a look at it.

==1216== 4032 bytes in 42 blocks are definitely lost in loss record 1
of 1
==1216==    at 0x1B9008A9: malloc (vg_replace_malloc.c:149)
==1216==    by 0x813977C: realpath_cache_add (tsrm_virtual_cwd.c:330)
==1216==    by 0x8138BD1: virtual_file_ex (tsrm_virtual_cwd.c:616)
==1216==    by 0x8140D14: expand_filepath (fopen_wrappers.c:529)
==1216==    by 0x8153BDF: _php_stream_fopen (plain_wrapper.c:855)
==1216==    by 0x8153F5C: php_plain_files_stream_opener
(plain_wrapper.c:941)
==1216==    by 0x814F5A8: _php_stream_open_wrapper_ex (streams.c:1771)
==1216==    by 0x80DF196: zif_file_get_contents (file.c:530)
==1216==    by 0x819D1A3: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:192)
==1216==    by 0x819FEE9: ZEND_DO_FCALL_SPEC_CONST_HANDLER
(zend_vm_execute.h:1587)
==1216==    by 0x819CE50: execute (zend_vm_execute.h:92)
==1216==    by 0x818026B: zend_execute_scripts (zend.c:1101)
==1216==    by 0x813C5BB: php_execute_script (main.c:1720)
==1216==    by 0x81E37D1: main (php_cli.c:1081)


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

[2006-01-14 23:54:47] [EMAIL PROTECTED]

Description:
------------
the new realpath cache has a memleak when opening many files.

Reproduce code:
---------------
<?php

foreach(range('a','z') as $f) {
        foreach(range('a','z') as $g) {
                $file = $f.$g;
                touch($file);
                file_get_contents($file);
        }
}
?>



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


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

Reply via email to