From: Operating system: Debian Squeeze/Sid PHP version: 5.3.2 Package: Date/time related Bug Type: Bug Bug description:Seg fault while creating DatePeriod
Description: ------------ PHP 5.3.2-1 with Suhosin-Patch (cli) (built: Mar 14 2010 00:09:57 Standard Debian packages Segfault when trying to construct a DatePeriod with an unserialized DateInterval. Test script: --------------- <?php $start = new DateTime('2003-01-02 08:00:00'); $end = new DateTime('2003-01-02 12:00:00'); $diff = $start->diff($end); $p = new DatePeriod($start, $diff, 2); $diff_s = serialize($diff); $diff_un = unserialize($diff_s); // Will segfault $p = new DatePeriod($start, $diff_un, 2); Expected result: ---------------- No Segfault Actual result: -------------- #0 timelib_rel_time_clone (rel=0x0) at /usr/include/bits/string3.h:52 #1 0x000000000042de6a in zim_DatePeriod___construct (ht=29638928, return_value=0x0, return_value_ptr=0x0, this_ptr=0x1c09668, return_value_used=104) at /build/buildd-php5_5.3.2-1-amd64-Nz9Pgu/php5-5.3.2/ext/date/php_date.c:3727 #2 0x00007fd3c9990c5c in xdebug_execute_internal (current_execute_data=0x7fd3d3bd6068, return_value_used=0) at /build/buildd-xdebug_2.0.5-1+b1-amd64-qDjrMY/xdebug-2.0.5/build-php5/xdebug.c:1631 #3 0x00000000006cb4c6 in zend_do_fcall_common_helper_SPEC (execute_data=0x7fd3d3bd6068) at /build/buildd-php5_5.3.2-1-amd64-Nz9Pgu/php5-5.3.2/Zend/zend_vm_execute.h:315 #4 0x00000000006a29b0 in execute (op_array=0x1c03258) at /build/buildd-php5_5.3.2-1-amd64-Nz9Pgu/php5-5.3.2/Zend/zend_vm_execute.h:104 #5 0x00007fd3c99908a9 in xdebug_execute (op_array=0x1c03258) at /build/buildd-xdebug_2.0.5-1+b1-amd64-qDjrMY/xdebug-2.0.5/build-php5/xdebug.c:1562 #6 0x000000000067a64d in zend_execute_scripts (type=0, retval=0x7fffdbd0dd20, file_count=3) at /build/buildd-php5_5.3.2-1-amd64-Nz9Pgu/php5-5.3.2/Zend/zend.c:1266 #7 0x0000000000626288 in php_execute_script (primary_file=Cannot access memory at address 0x8000dbd0cbb8 ) at /build/buildd-php5_5.3.2-1-amd64-Nz9Pgu/php5-5.3.2/main/main.c:2288 #8 0x000000000070a992 in main (argc=0, argv=0x2c4bf84) at /build/buildd-php5_5.3.2-1-amd64-Nz9Pgu/php5-5.3.2/sapi/cli/php_cli.c:1196 -- Edit bug report at http://bugs.php.net/bug.php?id=52113&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52113&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52113&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52113&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52113&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52113&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52113&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52113&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52113&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52113&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52113&r=support Expected behavior: http://bugs.php.net/fix.php?id=52113&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52113&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52113&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52113&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52113&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52113&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52113&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52113&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52113&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52113&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52113&r=mysqlcfg