php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46115 Memory leak when calling a method using Reflection
Submitted: 2008-09-18 14:36 UTC Modified: 2008-09-19 12:49 UTC
From: felipe@php.net Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3CVS-2008-09-18 (CVS) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: felipe@php.net
New email:
PHP Version: OS:

 

 [2008-09-18 14:36 UTC] felipe@php.net
Description:
------------
zend_execute_API.c:903 -> ALLOC_INIT_ZVAL(*fci->retval_ptr_ptr);
zend_interfaces.c:51 -> fci.retval_ptr_ptr = retval_ptr_ptr ? retval_ptr_ptr : &retval
zend_execute_API.c:699 -> *fci->retval_ptr_ptr = NULL;

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

$x = new reflectionmethod('RecursiveArrayIterator', 'asort');
$x->invoke(new RecursiveArrayIterator(array()));

Actual result:
--------------
==16579== 20 bytes in 1 blocks are definitely lost in loss record 2 of 4
==16579==    at 0x4021620: malloc (vg_replace_malloc.c:149)
==16579==    by 0x838C7DF: zend_call_function (zend_execute_API.c:903)
==16579==    by 0x81B101F: zim_reflection_method_invoke (php_reflection.c:2510)
==16579==    by 0x83B8992: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:315)
==16579==    by 0x83B74EB: execute (zend_vm_execute.h:104)
==16579==    by 0x8397006: zend_execute_scripts (zend.c:1197)
==16579==    by 0x83457F7: php_execute_script (main.c:2080)
==16579==    by 0x841F542: main (php_cli.c:1130)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-19 12:49 UTC] dmitry@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jan 28 22:01:29 2025 UTC