From:             [EMAIL PROTECTED]
Operating system: OpenBSD 3.2 (sparc64)
PHP version:      4.2.3
PHP Bug Type:     Reproducible crash
Bug description:  setcookie() with an expire argument causes a bus error

Installed PHP 4.2.3 as a DSO with the mysql extension enabled.  Everything
works fine until doing a setcookie() with any argument for the expiration,
which results in:

[Sun Dec 15 22:35:57 2002] [notice] child pid 3155 exit signal Bus error
(10)

The bug in its most basic form using the PHP CLI (no working gdb
available, using pmdb):

$> pmdb ./php -r 'setcookie("test", "test", 1, "/");'
pmdb: Loading symbols from ./php at 0x0
pmdb> run
pmdb: process started with PID 6187
PMDB stopping child. signal: BUS
pmdb: Loading symbols from /usr/local/lib/libintl.so.1.1 at 0x40408000
pmdb: Loading symbols from /usr/local/lib/libiconv.so.3.0 at 0x40510000
pmdb: Loading symbols from /usr/lib/libz.so.2.0 at 0x40718000
pmdb: Loading symbols from /usr/lib/libssl.so.7.0 at 0x40828000
pmdb: Loading symbols from /usr/lib/libcrypto.so.9.0 at 0x4096a000
pmdb: Loading symbols from /usr/lib/libm.so.1.0 at 0x40baa000
pmdb: Loading symbols from /usr/lib/libc.so.29.0 at 0x40ce8000
pmdb: Loading symbols from /usr/libexec/ld.so at 0x40300000
pmdb: Loading symbols from /usr/local/lib/php/modules/mysql.so at
0x40ed8000
pmdb: Loading symbols from /usr/local/lib/libmysqlclient.so.10.0 at
0x40fe8000
pmdb> trace
zend_parse_arg_impl(0x1, 0x0, 0x0, 0x0, 0x0, 0x0)+0x47c
zend_parse_arg_impl(0x104b50, 0x47c, 0x28, 0x400, 0xffffffffffffcb48,
0x0)+0x8
zend_parse_arg(0x464c28, 0xffffffffffffcc08, 0xffffffffffffcbd8, 0x112d2f,
0x112d45, 0x110990)+0x50
zend_parse_va_args(0x3, 0x464c28, 0xffffffffffffcc08, 0xffffffffffffcbd8,
0x0, 0x40306188)+0x410
zend_parse_parameters(0x4, 0x282808, 0xffffffffffffcc08, 0x0, 0x0,
0x40306188)+0x40
zif_setcookie(0x4, 0x282808, 0xffffffffffffcd38, 0xffffffffffffcd14,
0xffffffffffffcd30, 0xffffffffffffcd10)+0x94
execute(0x4, 0x45ac58, 0x0, 0x0, 0x1e3054, 0x0)+0x4130
zend_eval_string(0x462118, 0x3da5f0, 0x246c44, 0x0, 0x0, 0x0)+0x1dc
main(0xffffffffffffd9c1, 0x0, 0x26bc20, 0x26b000, 0x4, 0x4)+0xfb4
___start(0x3, 0xffffffffffffd4d8, 0xffffffffffffd4f8, 0x3d4000, 0x0,
0x40305960)+0x80
_dl_start(0xffffffffffffd9b8, 0x3c34f8, 0x40306008, 0xffffffffffffd450,
0x40305968, 0x40300000)+0x40
pmdb> 

Using nothing for the expiration works without crashing:

$> pmdb ./php -r 'setcookie("test", "test", "", "/");'
pmdb: Loading symbols from ./php at 0x0
pmdb> run
pmdb: process started with PID 24403
PHP Warning:  setcookie() expects parameter 3 to be long, string given in
Command line code on line 1
process exited with status 0
pmdb>

I cannot reproduce this on i386, so I'm assuming it's a 64-bit issue.  I
cannot reproduce the crash on sparc64 with any other functions I've tried,
other than setcookie.
-- 
Edit bug report at http://bugs.php.net/?id=21037&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=21037&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=21037&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=21037&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=21037&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=21037&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=21037&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=21037&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=21037&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=21037&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=21037&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21037&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=21037&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=21037&r=isapi

Reply via email to