Bug #53502 [Opn->Ver]: strtotime with timezone memory leak
| From: | aharvey@php.net | Date: | Thu, 09 Dec 2010 03:09:38 +0000 |
| Subject: | Bug #53502 [Opn->Ver]: strtotime with timezone memory leak | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-156833@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53502&edit=1
ID: 53502
Updated by: aharvey@php.net
Reported by: jsheridan at tenable dot com
Summary: strtotime with timezone memory leak
-Status: Open
+Status: Verified
Type: Bug
-Package: Reproducible crash
+Package: Date/time related
Operating System: Redhat ES5
PHP Version: 5.3.3
Block user comment: N
Private report: N
New Comment:
Verified. I don't have time to look into this further today (or
likely this week), but valgrind on a current 5.3 build shows a loss
record demonstrating this:
==19168== 130,800 (11,200 direct, 119,600 indirect) bytes in 100 blocks
are
definitely lost in loss record 28 of 28
==19168== at 0x4C27480: calloc (vg_replace_malloc.c:467)
==19168== by 0x471A5F: timelib_tzinfo_ctor (timelib.c:108)
==19168== by 0x471317: timelib_parse_tzfile (parse_tz.c:318)
==19168== by 0x442F99: timelib_get_zone (parse_date.re:807)
==19168== by 0x444520: scan (parse_date.re:1641)
==19168== by 0x46ED0E: timelib_strtotime (parse_date.re:1795)
==19168== by 0x435879: zif_strtotime (php_date.c:1427)
==19168== by 0x9E5022: execute_internal (zend_execute.c:1261)
==19168== by 0xBEA2D38: xdebug_execute_internal (xdebug.c:1335)
==19168== by 0x9E6057: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:318)
==19168== by 0x9EA9A7: ZEND_DO_FCALL_SPEC_CONST_HANDLER
(zend_vm_execute.h:1606)
==19168== by 0x9E53E1: execute (zend_vm_execute.h:107)
Previous Comments:
------------------------------------------------------------------------
[2010-12-08 21:05:59] jsheridan at tenable dot com
This was found on a 5.3.2 system but verified against a fresh built
5.3.3 with no
additions.
------------------------------------------------------------------------
[2010-12-08 21:04:11] jsheridan at tenable dot com
Description:
------------
strtotime calls with a timezone embedded function correctly but
continually use up
memory. In a daemon program this becomes quickly fatal.
Test script:
---------------
<?php
while (true) {
strtotime('Monday 00:00 Europe/Paris'); // Memory leak
}
?>
<?php
while (true) {
date_default_timezone_set("Europe/Paris");
strtotime('Monday 00:00'); // No memory leak
}
?>
Expected result:
----------------
Memory usage should remain stable.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53502&edit=1