#46108 [Asn]: DateTime - Memory leak when unserializing
ID: 46108
Updated by: jani@php.net
Reported By: felipe@php.net
Status: Assigned
Bug Type: Date/time related
Operating System: *
-PHP Version: 5.3CVS-2008-09-17 (CVS)
+PHP Version: 5.3CVS-2008-11-11
Assigned To: derick
New Comment:
Note: PHP_5_3 only (and propably HEAD, I didn't test that)
Previous Comments:
------------------------------------------------------------------------
[2008-09-17 16:30:17] felipe@php.net
Description:
------------
See below.
Reproduce code:
---------------
<?php
unserialize(serialize(new Datetime));
Actual result:
--------------
==18547== 51 bytes in 1 blocks are definitely lost in loss record 8 of
13
==18547== at 0x4021620: malloc (vg_replace_malloc.c:149)
==18547== by 0x80C1A51: timelib_parse_tzfile (parse_tz.c:207)
==18547== by 0x80A01DB: php_date_parse_tzfile (php_date.c:904)
==18547== by 0x80A259F: get_timezone_info (php_date.c:1004)
==18547== by 0x80A33FB: date_initialize (php_date.c:2443)
==18547== by 0x80A3810: zim_DateTime___construct (php_date.c:2525)
==18547== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==18547== by 0x83E9602: execute (zend_vm_execute.h:104)
==18547== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==18547== by 0x836916C: php_execute_script (main.c:2080)
==18547== by 0x845B734: main (php_cli.c:1130)
==18547==
==18547==
==18547== 120 bytes in 2 blocks are indirectly lost in loss record 9 of
13
==18547== at 0x4021620: malloc (vg_replace_malloc.c:149)
==18547== by 0x80C279F: timelib_tzinfo_clone (timelib.c:116)
==18547== by 0x80A9C40: timelib_fill_holes (parse_date.re:2111)
==18547== by 0x80A32F9: date_initialize (php_date.c:2463)
==18547== by 0x80A3810: zim_DateTime___construct (php_date.c:2525)
==18547== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==18547== by 0x83E9602: execute (zend_vm_execute.h:104)
==18547== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==18547== by 0x836916C: php_execute_script (main.c:2080)
==18547== by 0x845B734: main (php_cli.c:1130)
==18547==
==18547==
==18547== 1,614 (152 direct, 1,462 indirect) bytes in 2 blocks are
definitely lost in loss record 10 of 13
==18547== at 0x402095F: calloc (vg_replace_malloc.c:279)
==18547== by 0x80C26DA: timelib_tzinfo_ctor (timelib.c:95)
==18547== by 0x80C2714: timelib_tzinfo_clone (timelib.c:103)
==18547== by 0x80A9C40: timelib_fill_holes (parse_date.re:2111)
==18547== by 0x80A32F9: date_initialize (php_date.c:2463)
==18547== by 0x80A3810: zim_DateTime___construct (php_date.c:2525)
==18547== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==18547== by 0x83E9602: execute (zend_vm_execute.h:104)
==18547== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==18547== by 0x836916C: php_execute_script (main.c:2080)
==18547== by 0x845B734: main (php_cli.c:1130)
==18547==
==18547==
==18547== 256 bytes in 2 blocks are indirectly lost in loss record 11
of 13
==18547== at 0x4021620: malloc (vg_replace_malloc.c:149)
==18547== by 0x80C2756: timelib_tzinfo_clone (timelib.c:112)
==18547== by 0x80A9C40: timelib_fill_holes (parse_date.re:2111)
==18547== by 0x80A32F9: date_initialize (php_date.c:2463)
==18547== by 0x80A3597: php_date_initialize_from_hash
(php_date.c:2566)
==18547== by 0x80A368D: zim_DateTime___wakeup (php_date.c:2607)
==18547== by 0x83B8A1E: zend_call_function (zend_execute_API.c:907)
==18547== by 0x83B9666: call_user_function_ex
(zend_execute_API.c:681)
==18547== by 0x832EC41: php_var_unserialize
(var_unserializer.re:377)
==18547== by 0x831AC86: zif_unserialize (var.c:866)
==18547== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==18547== by 0x83E9602: execute (zend_vm_execute.h:104)
==18547== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==18547== by 0x836916C: php_execute_script (main.c:2080)
==18547== by 0x845B734: main (php_cli.c:1130)
==18547==
==18547==
==18547== 1,024 bytes in 2 blocks are indirectly lost in loss record 12
of 13
==18547== at 0x4021620: malloc (vg_replace_malloc.c:149)
==18547== by 0x80C2748: timelib_tzinfo_clone (timelib.c:111)
==18547== by 0x80A9C40: timelib_fill_holes (parse_date.re:2111)
==18547== by 0x80A32F9: date_initialize (php_date.c:2463)
==18547== by 0x80A3810: zim_DateTime___construct (php_date.c:2525)
==18547== by 0x83FB4DF: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:315)
==18547== by 0x83E9602: execute (zend_vm_execute.h:104)
==18547== by 0x83C3A6E: zend_execute_scripts (zend.c:1197)
==18547== by 0x836916C: php_execute_script (main.c:2080)
==18547== by 0x845B734: main (php_cli.c:1130)
==18547==
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46108&edit=1
Thread (5 messages)