Bug #70893 [NEW]: Segfault on new DateTimeZone('leap-seconds.list')

From: Date: Wed, 11 Nov 2015 15:49:24 +0000
Subject: Bug #70893 [NEW]: Segfault on new DateTimeZone('leap-seconds.list')
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197171@lists.php.net to get a copy of this message
From: royanee at gmail dot com Operating system: Debian PHP version: 5.6.15 Package: Reproducible crash Bug Type: Bug Bug description:Segfault on new DateTimeZone('leap-seconds.list') 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 bug report at https://bugs.php.net/bug.php?id=70893&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70893&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70893&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70893&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70893&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70893&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70893&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70893&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70893&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70893&r=support Expected behavior: https://bugs.php.net/fix.php?id=70893&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70893&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70893&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70893&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70893&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70893&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70893&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70893&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70893&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70893&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70893&r=mysqlcfg

« previous php.bugs (#197171) next »