php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19736 session_decode segfaults under cli
Submitted: 2002-10-03 09:59 UTC Modified: 2002-10-03 10:47 UTC
From: marcel at beerta dot de Assigned:
Status: Closed Package: Session related
PHP Version: 4CVS-2002-10-03 OS: Linux 2.4
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: marcel at beerta dot de
New email:
PHP Version: OS:

 

 [2002-10-03 09:59 UTC] marcel at beerta dot de
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)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-03 10:47 UTC] rasmus@php.net
Sascha fixed this.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Dec 05 16:00:02 2025 UTC