From:             [EMAIL PROTECTED]
Operating system: 
PHP version:      5.3CVS-2008-09-17 (CVS)
PHP Bug Type:     Date/time related
Bug description:  DateTime - Memory leak when unserializing

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 bug report at http://bugs.php.net/?id=46108&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46108&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46108&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46108&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=46108&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=46108&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=46108&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=46108&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=46108&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=46108&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=46108&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=46108&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=46108&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=46108&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46108&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=46108&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=46108&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=46108&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46108&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=46108&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=46108&r=mysqlcfg

Reply via email to