From: joey
Operating system: Debian stable
PHP version: trunk-SVN-2010-09-09 (SVN)
Package: Date/time related
Bug Type: Bug
Bug description:Negative intervals segfault
Description:
------------
Creating an interval with a "negative duration" (i.e., "start" date
precedes "end" date) creates what appears to be a valid DateInterval
object, but any attempt to work with the object results in a segfault.
Test script:
---------------
<?php $a = new DateInterval("2008-05-11T15:30:00Z/2007-03-01T13:00:00Z");
var_dump($a); ?>
Expected result:
----------------
At a minimum, "Not crashing". Ideally, a DateInterval object with a
negative duration, but I don't know of ISO-8601 allows those.
Actual result:
--------------
(gdb) r -r '$a = new
DateInterval("2008-05-11T15:30:00Z/2007-03-01T13:00:00Z"); var_dump($a);'
Program received signal SIGSEGV, Segmentation fault.
0x0000000000420faf in date_object_get_properties_interval (object=<value
optimized out>) at /home/joey/src/php/trunk/ext/date/php_date.c:2242
2242 PHP_DATE_INTERVAL_ADD_PROPERTY("y", y);
"bt full" output available at http://codepad.org/on7ZS6Qd
--
Edit bug report at http://bugs.php.net/bug.php?id=52808&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52808&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52808&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52808&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52808&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52808&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52808&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52808&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52808&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52808&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52808&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52808&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52808&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52808&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52808&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52808&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52808&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52808&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52808&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52808&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52808&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52808&r=mysqlcfg