Bug #70893 [Opn->Fbk]: Segfault on new DateTimeZone('leap-seconds.list')
Edit report at https://bugs.php.net/bug.php?id=70893&edit=1
ID: 70893
Updated by: cmb@php.net
Reported by: royanee at gmail dot com
Summary: Segfault on new DateTimeZone('leap-seconds.list')
-Status: Open
+Status: Feedback
Type: Bug
Package: Reproducible crash
Operating System: Debian
PHP Version: 5.6.15
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
So, has this issue been resolved in the meantime?
Previous Comments:
------------------------------------------------------------------------
[2015-11-19 20:42:05] royanee at gmail dot com
I'm so sorry Derick! I just found your discussion from 2008 about the distributions using the
central tzdata. I'll reference this issue in the bug report I file with Debian.
------------------------------------------------------------------------
[2015-11-17 11:14:59] derick@php.net
I can't reproduce this. Are you sure this is stock PHP, and not a PHP that has weird patches
for using the timezone database from the OS?
------------------------------------------------------------------------
[2015-11-11 15:49:20] royanee at gmail dot com
Description:
------------
I have a script that loops through all of the DateTimeZone identifiers and creates a DateTimeZone
instance of each one for use later in the script. I noticed that it was triggering a segmentation
fault while trying to get another application working.
Here's how I identified that the "leap-seconds.list" timezone was breaking it:
<?php
foreach (DateTimeZone::listIdentifiers(DateTimeZone::ALL_WITH_BC) as $tz) {
echo $tz . PHP_EOL;
$dtz = new DateTimeZone($tz);
}
echo 'Success' . PHP_EOL;
Test script:
---------------
<?php
$tz = 'leap-seconds.list';
$dtz = new DateTimeZone($tz);
echo 'Success' . PHP_EOL;
Expected result:
----------------
Success
Actual result:
--------------
Segmentation fault
(gdb) bt
#0 __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:116
#1 0x000000000048ca86 in memcpy (__len=8148847036, __src=0x7ffff7ff002c, __dest=0x7ffe08580010) at
/usr/include/x86_64-linux-gnu/bits/string3.h:51
#2 read_transistions (tz=0x11c4020, tzf=0x7fffffffa618) at
/build/php5-z1CRVw/php5-5.6.14+dfsg/ext/date/lib/parse_tz.c:134
#3 timelib_parse_tzfile (timezone=timezone@entry=0x11c4000 "leap-seconds.list",
tzdb=tzdb@entry=0x11bd530) at /build/php5-z1CRVw/php5-5.6.14+dfsg/ext/date/lib/parse_tz.c:881
#4 0x00000000004677ab in php_date_parse_tzfile (formal_tzname=0x11c4000
"leap-seconds.list", tzdb=0x11bd530) at
/build/php5-z1CRVw/php5-5.6.14+dfsg/ext/date/php_date.c:926
#5 0x00000000004708ad in timelib_parse_zone (ptr=ptr@entry=0x7fffffffa728,
dst=dst@entry=0x7fffffffa730, t=t@entry=0x7ffff7fc7858,
tz_not_found=tz_not_found@entry=0x7fffffffa734, tzdb=<optimized out>,
tz_wrapper=tz_wrapper@entry=0x467830 <php_date_parse_tzfile_wrapper>)
at /build/php5-z1CRVw/php5-5.6.14+dfsg/ext/date/lib/parse_date.c:782
#6 0x000000000046727a in timezone_initialize (tzobj=0x7ffff7fc7638, tz=0x7ffff7ec5079 "",
tz_len=17) at /build/php5-z1CRVw/php5-5.6.14+dfsg/ext/date/php_date.c:3713
#7 0x00000000004673aa in zim_DateTimeZone___construct (ht=1, return_value=<optimized out>,
return_value_ptr=<optimized out>, this_ptr=0x7ffff7fc5900, return_value_used=<optimized
out>) at /build/php5-z1CRVw/php5-5.6.14+dfsg/ext/date/php_date.c:3758
#8 0x00000000006dae1a in dtrace_execute_internal (execute_data_ptr=<optimized out>,
fci=<optimized out>, return_value_used=<optimized out>) at
/build/php5-z1CRVw/php5-5.6.14+dfsg/Zend/zend_dtrace.c:97
#9 0x000000000079a4f7 in zend_do_fcall_common_helper_SPEC (execute_data=<optimized out>) at
/build/php5-z1CRVw/php5-5.6.14+dfsg/Zend/zend_vm_execute.h:560
#10 0x0000000000729520 in execute_ex (execute_data=execute_data@entry=0x7ffff7f92190) at
/build/php5-z1CRVw/php5-5.6.14+dfsg/Zend/zend_vm_execute.h:363
#11 0x00000000006dacc1 in dtrace_execute_ex (execute_data=0x7ffff7f92190) at
/build/php5-z1CRVw/php5-5.6.14+dfsg/Zend/zend_dtrace.c:73
#12 0x00000000006ed7d0 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0,
file_count=file_count@entry=3) at /build/php5-z1CRVw/php5-5.6.14+dfsg/Zend/zend.c:1341
#13 0x0000000000688840 in php_execute_script (primary_file=primary_file@entry=0x7fffffffce40) at
/build/php5-z1CRVw/php5-5.6.14+dfsg/main/main.c:2597
#14 0x000000000079c441 in do_cli (argc=2, argv=0xeb0e70) at
/build/php5-z1CRVw/php5-5.6.14+dfsg/sapi/cli/php_cli.c:994
#15 0x000000000046237e in main (argc=2, argv=0xeb0e70) at
/build/php5-z1CRVw/php5-5.6.14+dfsg/sapi/cli/php_cli.c:1378
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70893&edit=1
Thread (6 messages)