From: [EMAIL PROTECTED]
Operating system: Linux 2.4
PHP version: 4CVS-2002-10-03
PHP Bug Type: Session related
Bug description: session_decode segfaults under cli
I've been playing with the session extension recently, and session_decode()
segfaults under cli mode. What I generally did was to write a custom
session save handler which stores the session data inside a database.
After that, i wanted to decode them inside a command-line script executed
from the shell.
Here's a backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x080bb960 in php_set_session_var (name=0x82c4d2c "userid", namelen=6,
state_val=0x8249df4, var_hash=0xbfffb728)
at /usr/local/src/php4/ext/session/session.c:312
312 zend_set_hash_symbol(state_val, name,
namelen, 1
, 2, Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol_table));
(gdb) bt
#0 0x080bb960 in php_set_session_var (name=0x82c4d2c "userid",
namelen=6,
state_val=0x8249df4, var_hash=0xbfffb728)
at /usr/local/src/php4/ext/session/session.c:312
#1 0x080bc197 in ps_srlzr_decode_php (
val=0x8249dbc "userid|s:5:\"mazen\";chatRoom|s:1:\"1\";", vallen=36)
at /usr/local/src/php4/ext/session/session.c:478
#2 0x080bc46a in php_session_decode (
val=0x8249dbc "userid|s:5:\"mazen\";chatRoom|s:1:\"1\";", vallen=36)
at /usr/local/src/php4/ext/session/session.c:524
#3 0x080bec04 in zif_session_decode (ht=1, return_value=0x8249f7c,
this_ptr=0x0, return_value_used=1)
at /usr/local/src/php4/ext/session/session.c:1431
#4 0x0816e353 in execute (op_array=0x8233e3c)
at /usr/local/src/php4/Zend/zend_execute.c:1599
#5 0x0816e4ca in execute (op_array=0x8338b64)
at /usr/local/src/php4/Zend/zend_execute.c:1641
#6 0x0816e4ca in execute (op_array=0x83389ac)
at /usr/local/src/php4/Zend/zend_execute.c:1641
#7 0x0816e4ca in execute (op_array=0x82323bc)
at /usr/local/src/php4/Zend/zend_execute.c:1641
#8 0x0816e4ca in execute (op_array=0x822d5ac)
at /usr/local/src/php4/Zend/zend_execute.c:1641
#9 0x0815c9be in zend_execute_scripts (type=8, retval=0x0, file_count=3)
--
Edit bug report at http://bugs.php.net/?id=19736&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19736&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19736&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19736&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19736&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19736&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19736&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19736&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19736&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19736&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19736&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=19736&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=19736&r=dst