Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / zend_execute_API.c
| From: | Antony Dovgal | Date: | Tue, 15 Jan 2008 08:46:40 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / zend_execute_API.c | ||
| References: | 1 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-6267@lists.php.net to get a copy of this message | ||
This patch caused the following:
# cat ext/reflection/tests/reflectionProperty_export_error.mem
==10499== Invalid read of size 4
==10499== at 0x8904BA: _zval_ptr_dtor (zend.h:364)
==10499== by 0x673BA5: _reflection_export (php_reflection.c:1236)
==10499== by 0x67D4CB: zim_reflection_property_export (php_reflection.c:3777)
==10499== by 0x8CF55B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:191)
==10499== by 0x8D0396: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:309)
==10499== by 0x8CEF8B: execute (zend_vm_execute.h:87)
==10499== by 0x8A2D63: zend_execute_scripts (zend.c:1139)
==10499== by 0x8419AA: php_execute_script (main.c:2010)
==10499== by 0x93C35B: main (php_cli.c:1140)
==10499== Address 0x8e41330 is 16 bytes inside a block of size 24 free'd
==10499== at 0x4C2292E: free (vg_replace_malloc.c:323)
==10499== by 0x87E958: _efree (zend_alloc.c:2285)
==10499== by 0x89059B: safe_free_zval_ptr_rel (zend_execute.h:70)
==10499== by 0x890510: _zval_ptr_dtor (zend_execute_API.c:422)
==10499== by 0x893755: zend_call_function (zend_execute_API.c:1086)
==10499== by 0x673B86: _reflection_export (php_reflection.c:1233)
==10499== by 0x67D4CB: zim_reflection_property_export (php_reflection.c:3777)
==10499== by 0x8CF55B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:191)
==10499== by 0x8D0396: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:309)
==10499== by 0x8CEF8B: execute (zend_vm_execute.h:87)
==10499== by 0x8A2D63: zend_execute_scripts (zend.c:1139)
==10499== by 0x8419AA: php_execute_script (main.c:2010)
==10499==
==10499== Invalid write of size 4
==10499== at 0x8904C4: _zval_ptr_dtor (zend.h:364)
==10499== by 0x673BA5: _reflection_export (php_reflection.c:1236)
==10499== by 0x67D4CB: zim_reflection_property_export (php_reflection.c:3777)
==10499== by 0x8CF55B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:191)
==10499== by 0x8D0396: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:309)
==10499== by 0x8CEF8B: execute (zend_vm_execute.h:87)
==10499== by 0x8A2D63: zend_execute_scripts (zend.c:1139)
==10499== by 0x8419AA: php_execute_script (main.c:2010)
==10499== by 0x93C35B: main (php_cli.c:1140)
==10499== Address 0x8e41330 is 16 bytes inside a block of size 24 free'd
==10499== at 0x4C2292E: free (vg_replace_malloc.c:323)
==10499== by 0x87E958: _efree (zend_alloc.c:2285)
==10499== by 0x89059B: safe_free_zval_ptr_rel (zend_execute.h:70)
==10499== by 0x890510: _zval_ptr_dtor (zend_execute_API.c:422)
==10499== by 0x893755: zend_call_function (zend_execute_API.c:1086)
==10499== by 0x673B86: _reflection_export (php_reflection.c:1233)
==10499== by 0x67D4CB: zim_reflection_property_export (php_reflection.c:3777)
==10499== by 0x8CF55B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:191)
==10499== by 0x8D0396: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:309)
==10499== by 0x8CEF8B: execute (zend_vm_execute.h:87)
==10499== by 0x8A2D63: zend_execute_scripts (zend.c:1139)
==10499== by 0x8419AA: php_execute_script (main.c:2010)
==10499==
==10499== Invalid read of size 4
==10499== at 0x8904D6: _zval_ptr_dtor (zend.h:352)
==10499== by 0x673BA5: _reflection_export (php_reflection.c:1236)
==10499== by 0x67D4CB: zim_reflection_property_export (php_reflection.c:3777)
==10499== by 0x8CF55B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:191)
==10499== by 0x8D0396: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:309)
==10499== by 0x8CEF8B: execute (zend_vm_execute.h:87)
==10499== by 0x8A2D63: zend_execute_scripts (zend.c:1139)
==10499== by 0x8419AA: php_execute_script (main.c:2010)
==10499== by 0x93C35B: main (php_cli.c:1140)
==10499== Address 0x8e41330 is 16 bytes inside a block of size 24 free'd
==10499== at 0x4C2292E: free (vg_replace_malloc.c:323)
==10499== by 0x87E958: _efree (zend_alloc.c:2285)
==10499== by 0x89059B: safe_free_zval_ptr_rel (zend_execute.h:70)
==10499== by 0x890510: _zval_ptr_dtor (zend_execute_API.c:422)
==10499== by 0x893755: zend_call_function (zend_execute_API.c:1086)
==10499== by 0x673B86: _reflection_export (php_reflection.c:1233)
==10499== by 0x67D4CB: zim_reflection_property_export (php_reflection.c:3777)
==10499== by 0x8CF55B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:191)
==10499== by 0x8D0396: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:309)
==10499== by 0x8CEF8B: execute (zend_vm_execute.h:87)
==10499== by 0x8A2D63: zend_execute_scripts (zend.c:1139)
==10499== by 0x8419AA: php_execute_script (main.c:2010)
==10499==
==10499== Invalid read of size 4
==10499== at 0x890522: _zval_ptr_dtor (zend.h:352)
==10499== by 0x673BA5: _reflection_export (php_reflection.c:1236)
==10499== by 0x67D4CB: zim_reflection_property_export (php_reflection.c:3777)
==10499== by 0x8CF55B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:191)
==10499== by 0x8D0396: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:309)
==10499== by 0x8CEF8B: execute (zend_vm_execute.h:87)
==10499== by 0x8A2D63: zend_execute_scripts (zend.c:1139)
==10499== by 0x8419AA: php_execute_script (main.c:2010)
==10499== by 0x93C35B: main (php_cli.c:1140)
==10499== Address 0x8e41330 is 16 bytes inside a block of size 24 free'd
==10499== at 0x4C2292E: free (vg_replace_malloc.c:323)
==10499== by 0x87E958: _efree (zend_alloc.c:2285)
==10499== by 0x89059B: safe_free_zval_ptr_rel (zend_execute.h:70)
==10499== by 0x890510: _zval_ptr_dtor (zend_execute_API.c:422)
==10499== by 0x893755: zend_call_function (zend_execute_API.c:1086)
==10499== by 0x673B86: _reflection_export (php_reflection.c:1233)
==10499== by 0x67D4CB: zim_reflection_property_export (php_reflection.c:3777)
==10499== by 0x8CF55B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:191)
==10499== by 0x8D0396: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:309)
==10499== by 0x8CEF8B: execute (zend_vm_execute.h:87)
==10499== by 0x8A2D63: zend_execute_scripts (zend.c:1139)
==10499== by 0x8419AA: php_execute_script (main.c:2010)
On 14.01.2008 21:13, Marcus Boerger wrote:
> helly Mon Jan 14 18:13:12 2008 UTC
>
> Modified files: (Branch: PHP_5_3)
> /ZendEngine2 zend_execute_API.c
> Log:
> - Fix memleak (found by colder)
>
>
> http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.331.2.20.2.24.2.17&r2=1.331.2.20.2.24.2.18&diff_format=u
> Index: ZendEngine2/zend_execute_API.c
> diff -u ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.17
> ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.18
> --- ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.17 Thu Jan 10 09:38:23 2008
> +++ ZendEngine2/zend_execute_API.c Mon Jan 14 18:13:12 2008
> @@ -17,7 +17,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.17 2008/01/10 09:38:23 dmitry Exp $ */
> +/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.18 2008/01/14 18:13:12 helly Exp $ */
>
> #include <stdio.h>
> #include <signal.h>
> @@ -1082,6 +1082,10 @@
> {
> INIT_PZVAL(*fci->retval_ptr_ptr);
> }*/
> + if (EG(exception) && fci->retval_ptr_ptr) {
> + zval_ptr_dtor(fci->retval_ptr_ptr);
> + fci->retval_ptr_ptr = NULL;
> + }
> }
> zend_ptr_stack_clear_multiple(TSRMLS_C);
> if (call_via_handler) {
>
--
Wbr,
Antony Dovgal