From: [email protected]
Operating system: Linux
PHP version: 5.2CVS-2009-06-15 (CVS)
PHP Bug Type: Date/time related
Bug description: Object comparison using unserialized DateTime object causes
segfault
Description:
------------
This issue just occurs on 5.2.
See the code below.
Reproduce code:
---------------
<?php
unserialize(serialize(new datetime())) == new datetime;
Expected result:
----------------
No SIGSEGV.
Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb6e89b70 (LWP 24361)]
0x080bed7a in date_object_compare_date (d1=0xa7a5308, d2=0xa7a5288,
tsrm_ls=0xa5802a8) at /home/felipe/dev/php5_2/ext/date/php_date.c:1581
1581 if (!o1->time->sse_uptodate) {
(gdb) bt
#0 0x080bed7a in date_object_compare_date (d1=0xa7a5308, d2=0xa7a5288,
tsrm_ls=0xa5802a8) at /home/felipe/dev/php5_2/ext/date/php_date.c:1581
#1 0x084e3773 in compare_function (result=0xbfc93f10, op1=0xa7a5308,
op2=0xa7a5288, tsrm_ls=0xa5802a8) at
/home/felipe/dev/php5_2/Zend/zend_operators.c:1416
#2 0x084e404c in is_equal_function (result=0xbfc93f10, op1=0xa7a5308,
op2=0xa7a5288, tsrm_ls=0xa5802a8) at
/home/felipe/dev/php5_2/Zend/zend_operators.c:1547
#3 0x0853b9f1 in ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER
(execute_data=0xbfc93f44, tsrm_ls=0xa5802a8) at
/home/felipe/dev/php5_2/Zend/zend_vm_execute.h:11516
#4 0x085126e4 in execute (op_array=0xa7a5a10, tsrm_ls=0xa5802a8) at
/home/felipe/dev/php5_2/Zend/zend_vm_execute.h:92
#5 0x084da6aa in zend_eval_string (str=0xbfc957dc
"unserialize(serialize(new datetime())) == new datetime;", retval_ptr=0x0,
string_name=0x87fb6dc "Command line code", tsrm_ls=0xa5802a8) at
/home/felipe/dev/php5_2/Zend/zend_execute_API.c:1214
#6 0x084da8e2 in zend_eval_string_ex (str=0xbfc957dc
"unserialize(serialize(new datetime())) == new datetime;", retval_ptr=0x0,
string_name=0x87fb6dc "Command line code", handle_exceptions=1,
tsrm_ls=0xa5802a8) at /home/felipe/dev/php5_2/Zend/zend_execute_API.c:1248
#7 0x08573484 in main (argc=3, argv=0xbfc94314) at
/home/felipe/dev/php5_2/sapi/cli/php_cli.c:1201
--
Edit bug report at http://bugs.php.net/?id=48559&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48559&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48559&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48559&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48559&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48559&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48559&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48559&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48559&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48559&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48559&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48559&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48559&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48559&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48559&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48559&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48559&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48559&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48559&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48559&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48559&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48559&r=mysqlcfg