From:             mathieuk at gmail dot com
Operating system: MacOSX 10.5.3
PHP version:      5.3CVS-2008-07-19 (CVS)
PHP Bug Type:     Reproducible crash
Bug description:  Creating instance of DatePeriod crashes

Description:
------------
The new DatePeriod class seems to crash PHP in different ways. 







Reproduce code:
---------------
Crash #1: invalid argument: arg #1 should be DateTime

<?php

$dp = new DatePeriod('2D');

?>

Crash #2: valid argument (i think):
<?php

$begin = new DateTime();
$interval = DateInterval::createFromDateString("1 day");

$dp = new DatePeriod($begin, $interval, 10);

?>




Expected result:
----------------
$dp to be an instance of DatePeriod. Possibly an exception for giving it 
an unknown argument ( not sure what the syntax of the argument should be 
).






Actual result:
--------------
Crashes in both cases:

Crash #1: invalid argument:
-----------------------------------------
(gdb) run DatePeriod.php
Starting program: /Users/mathieu/programs/php/bin/php DatePeriod.php
Reading symbols for shared libraries ++++++.. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x000000a0
0x00050d45 in timelib_update_ts ()
(gdb) bt
#0  0x00050d45 in timelib_update_ts ()
#1  0x000317f9 in zim_DatePeriod___construct ()
#2  0x00295bec in zend_do_fcall_common_helper_SPEC ()
#3  0x00294885 in execute ()
#4  0x00272276 in zend_execute_scripts ()
#5  0x00219114 in php_execute_script ()
#6  0x0031d10e in main ()
------------------------------------------

Crash #2: valid argument:
------------------------------------------
(gdb) run DatePeriod.php 
Starting program: /Users/mathieu/programs/php/bin/php DatePeriod.php
Reading symbols for shared libraries ++++++.. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00052649 in timelib_strtointerval ()
(gdb) bt
#0  0x00052649 in timelib_strtointerval ()
#1  0x0003177e in zim_DatePeriod___construct ()
#2  0x00295bec in zend_do_fcall_common_helper_SPEC ()
#3  0x00294885 in execute ()
#4  0x00272276 in zend_execute_scripts ()
#5  0x00219114 in php_execute_script ()
#6  0x0031d10e in main ()
--------------------------------------------------

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

Reply via email to