Bug #16044 Updated: crashing apparently in session module
ID: 16044 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Duplicate Bug Type: Session related Operating System: Linux 2.4.7 PHP Version: 4.1.2 New Comment: I actually read your code now. You should return string type from read function _always_. It's well known session bug, though. Duplicate of #14529. Previous Comments: [2002-04-02 08:53:53] [EMAIL PROTECTED] I actually read your code now. You should return string type from read function _always_. It's well known session bug, though. Duplicate of #14529. [2002-03-21 16:40:00] [EMAIL PROTECTED] backtrace as follows (this looks strange to me.. i did compile with --enable-debug though..): Program received signal SIGSEGV, Segmentation fault. zend_hash_add_or_update (ht=0x40506514, arKey=0x80f96e8 "?\226\017\b\b\227\017\b\f", nKeyLength=135239400, pData=0xbfffee7c, nDataSize=4, pDest=0x0, flag=2) at zend_hash.h:197 197 h ^= (ulong) *arKey++; (gdb) Continuing. Cannot find user-level thread for LWP 8505: generic error (gdb) bt #0 zend_hash_add_or_update (ht=Error accessing memory address 0xbfffee50: No such process. ) at zend_hash.h:197 Error accessing memory address 0x4042901c: No such process. [2002-03-19 05:07:06] [EMAIL PROTECTED] To properly diagnose this bug, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". [2002-03-13 12:24:49] [EMAIL PROTECTED] db_request() just sends whatever string to the sql database, and db_single() returns a single result from a specified query, if that helps. [2002-03-13 12:23:19] [EMAIL PROTECTED] Using any handler BUT files for sessions seems to crash the PHP program nine times out of ten - once the session is registered, however, it seems to operate just fine. Here's my session code, hope it will help. "; $q = "SELECT svalue FROM $SESS_DBTABLE WHERE sesskey='$key' AND expire < ".time(); $dbr = db_request($q); if($dbr && mysql_num_rows($dbr)) { $q = "DELETE FROM $SESS_DBTABLE WHERE sesskey='$key'"; db_request($q); header("Location: expire.php"); exit; } $q = "SELECT svalue FROM $SESS_DBTABLE WHERE sesskey='$key' AND expire > " . time(); $dbr = db_request($q); if($debug_session) echo "msql($q) returns $dbr"; if(!$dbr) return false; $value = mysql_fetch_row($dbr); if($debug_session) echo "sess_read returning $value[0]"; return $value[0]; } function sess_write($key, $val) { global $user,$debug_session, $SESS_LIFE, $SESS_DBNAME, $SESS_DBTABLE; $expire = time() + (60 * 30); $value = addslashes($val); $q = "INSERT INTO $SESS_DBTABLE VALUES ('$key', $expire, '$value', '$user[username]', '$user[location]', '$user[activity]')"; $dbr = db_request($q); if($debug_session) echo "sess_write($key, $val)msql($q) returns $dbr"; if(!$dbr) { $q = "UPDATE $SESS_DBTABLE SET location='$user[location]',activity='$user[activity]',username='$user[username]',expire=$expire,svalue='$value' WHERE sesskey = '$key' AND expire > " . time(); $dbr = db_request($q); } if($debug_session) echo "sess_write() returning $dbr"; return $dbr; } function sess_destroy($key) { global $debug_session, $SESS_DBNAME, $SESS_DBTABLE; $q = "DELETE FROM $SESS_DBTABLE WHERE sesskey = '$key'"; $dbr = db_request($q); if($debug_session) echo "sess_destroy($key)msql($q) return $dbr"; return $dbr; } function sess_gc($maxlifetime) { global $SESS_DBNAME, $SESS_DBTABLE; $q = "DELETE FROM $SESS_DBTABLE WHERE expire < " . time(); $dbr = db_request($q); return mysql_affected_rows(); } function session_dump() { $session_array = explode(';',session_encode()); $html = "\n\n"; echo $html; } function query_present($loc) { global $SESS_DBTABLE; $q = "location='$loc' and expire > ".time(); $f = "username,activity"; $dbr = db_array($SESS_DBTABLE, $q, $f); if(!$dbr) return 0; while($x = each($dbr)) { $ret[$x['value']['username']] = $x['value']['activity']; } return $ret; } function query_num_online() { global $SESS_DBTABLE; $q = "expire > ".time(); $f =
Bug #16044 Updated: crashing apparently in session module
ID: 16044 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Duplicate Bug Type: Session related Operating System: Linux 2.4.7 PHP Version: 4.1.2 New Comment: I actually read your code now. You should return string type from read function _always_. It's well known session bug, though. Duplicate of #14529. Previous Comments: [2002-03-21 16:40:00] [EMAIL PROTECTED] backtrace as follows (this looks strange to me.. i did compile with --enable-debug though..): Program received signal SIGSEGV, Segmentation fault. zend_hash_add_or_update (ht=0x40506514, arKey=0x80f96e8 "?\226\017\b\b\227\017\b\f", nKeyLength=135239400, pData=0xbfffee7c, nDataSize=4, pDest=0x0, flag=2) at zend_hash.h:197 197 h ^= (ulong) *arKey++; (gdb) Continuing. Cannot find user-level thread for LWP 8505: generic error (gdb) bt #0 zend_hash_add_or_update (ht=Error accessing memory address 0xbfffee50: No such process. ) at zend_hash.h:197 Error accessing memory address 0x4042901c: No such process. [2002-03-19 05:07:06] [EMAIL PROTECTED] To properly diagnose this bug, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". [2002-03-13 12:24:49] [EMAIL PROTECTED] db_request() just sends whatever string to the sql database, and db_single() returns a single result from a specified query, if that helps. [2002-03-13 12:23:19] [EMAIL PROTECTED] Using any handler BUT files for sessions seems to crash the PHP program nine times out of ten - once the session is registered, however, it seems to operate just fine. Here's my session code, hope it will help. "; $q = "SELECT svalue FROM $SESS_DBTABLE WHERE sesskey='$key' AND expire < ".time(); $dbr = db_request($q); if($dbr && mysql_num_rows($dbr)) { $q = "DELETE FROM $SESS_DBTABLE WHERE sesskey='$key'"; db_request($q); header("Location: expire.php"); exit; } $q = "SELECT svalue FROM $SESS_DBTABLE WHERE sesskey='$key' AND expire > " . time(); $dbr = db_request($q); if($debug_session) echo "msql($q) returns $dbr"; if(!$dbr) return false; $value = mysql_fetch_row($dbr); if($debug_session) echo "sess_read returning $value[0]"; return $value[0]; } function sess_write($key, $val) { global $user,$debug_session, $SESS_LIFE, $SESS_DBNAME, $SESS_DBTABLE; $expire = time() + (60 * 30); $value = addslashes($val); $q = "INSERT INTO $SESS_DBTABLE VALUES ('$key', $expire, '$value', '$user[username]', '$user[location]', '$user[activity]')"; $dbr = db_request($q); if($debug_session) echo "sess_write($key, $val)msql($q) returns $dbr"; if(!$dbr) { $q = "UPDATE $SESS_DBTABLE SET location='$user[location]',activity='$user[activity]',username='$user[username]',expire=$expire,svalue='$value' WHERE sesskey = '$key' AND expire > " . time(); $dbr = db_request($q); } if($debug_session) echo "sess_write() returning $dbr"; return $dbr; } function sess_destroy($key) { global $debug_session, $SESS_DBNAME, $SESS_DBTABLE; $q = "DELETE FROM $SESS_DBTABLE WHERE sesskey = '$key'"; $dbr = db_request($q); if($debug_session) echo "sess_destroy($key)msql($q) return $dbr"; return $dbr; } function sess_gc($maxlifetime) { global $SESS_DBNAME, $SESS_DBTABLE; $q = "DELETE FROM $SESS_DBTABLE WHERE expire < " . time(); $dbr = db_request($q); return mysql_affected_rows(); } function session_dump() { $session_array = explode(';',session_encode()); $html = "\n\n"; echo $html; } function query_present($loc) { global $SESS_DBTABLE; $q = "location='$loc' and expire > ".time(); $f = "username,activity"; $dbr = db_array($SESS_DBTABLE, $q, $f); if(!$dbr) return 0; while($x = each($dbr)) { $ret[$x['value']['username']] = $x['value']['activity']; } return $ret; } function query_num_online() { global $SESS_DBTABLE; $q = "expire > ".time(); $f = "count(*)"; $dbr = db_single($SESS_DBTABLE, $q, $f); return $dbr[0]; } session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc"); ?> ---
Bug #16044 Updated: crashing apparently in session module
ID: 16044 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: Session related Operating System: Linux 2.4.7 PHP Version: 4.1.2 New Comment: backtrace as follows (this looks strange to me.. i did compile with --enable-debug though..): Program received signal SIGSEGV, Segmentation fault. zend_hash_add_or_update (ht=0x40506514, arKey=0x80f96e8 "?\226\017\b\b\227\017\b\f", nKeyLength=135239400, pData=0xbfffee7c, nDataSize=4, pDest=0x0, flag=2) at zend_hash.h:197 197 h ^= (ulong) *arKey++; (gdb) Continuing. Cannot find user-level thread for LWP 8505: generic error (gdb) bt #0 zend_hash_add_or_update (ht=Error accessing memory address 0xbfffee50: No such process. ) at zend_hash.h:197 Error accessing memory address 0x4042901c: No such process. Previous Comments: [2002-03-19 05:07:06] [EMAIL PROTECTED] To properly diagnose this bug, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". [2002-03-13 12:24:49] [EMAIL PROTECTED] db_request() just sends whatever string to the sql database, and db_single() returns a single result from a specified query, if that helps. [2002-03-13 12:23:19] [EMAIL PROTECTED] Using any handler BUT files for sessions seems to crash the PHP program nine times out of ten - once the session is registered, however, it seems to operate just fine. Here's my session code, hope it will help. "; $q = "SELECT svalue FROM $SESS_DBTABLE WHERE sesskey='$key' AND expire < ".time(); $dbr = db_request($q); if($dbr && mysql_num_rows($dbr)) { $q = "DELETE FROM $SESS_DBTABLE WHERE sesskey='$key'"; db_request($q); header("Location: expire.php"); exit; } $q = "SELECT svalue FROM $SESS_DBTABLE WHERE sesskey='$key' AND expire > " . time(); $dbr = db_request($q); if($debug_session) echo "msql($q) returns $dbr"; if(!$dbr) return false; $value = mysql_fetch_row($dbr); if($debug_session) echo "sess_read returning $value[0]"; return $value[0]; } function sess_write($key, $val) { global $user,$debug_session, $SESS_LIFE, $SESS_DBNAME, $SESS_DBTABLE; $expire = time() + (60 * 30); $value = addslashes($val); $q = "INSERT INTO $SESS_DBTABLE VALUES ('$key', $expire, '$value', '$user[username]', '$user[location]', '$user[activity]')"; $dbr = db_request($q); if($debug_session) echo "sess_write($key, $val)msql($q) returns $dbr"; if(!$dbr) { $q = "UPDATE $SESS_DBTABLE SET location='$user[location]',activity='$user[activity]',username='$user[username]',expire=$expire,svalue='$value' WHERE sesskey = '$key' AND expire > " . time(); $dbr = db_request($q); } if($debug_session) echo "sess_write() returning $dbr"; return $dbr; } function sess_destroy($key) { global $debug_session, $SESS_DBNAME, $SESS_DBTABLE; $q = "DELETE FROM $SESS_DBTABLE WHERE sesskey = '$key'"; $dbr = db_request($q); if($debug_session) echo "sess_destroy($key)msql($q) return $dbr"; return $dbr; } function sess_gc($maxlifetime) { global $SESS_DBNAME, $SESS_DBTABLE; $q = "DELETE FROM $SESS_DBTABLE WHERE expire < " . time(); $dbr = db_request($q); return mysql_affected_rows(); } function session_dump() { $session_array = explode(';',session_encode()); $html = "\n\n"; echo $html; } function query_present($loc) { global $SESS_DBTABLE; $q = "location='$loc' and expire > ".time(); $f = "username,activity"; $dbr = db_array($SESS_DBTABLE, $q, $f); if(!$dbr) return 0; while($x = each($dbr)) { $ret[$x['value']['username']] = $x['value']['activity']; } return $ret; } function query_num_online() { global $SESS_DBTABLE; $q = "expire > ".time(); $f = "count(*)"; $dbr = db_single($SESS_DBTABLE, $q, $f); return $dbr[0]; } session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc"); ?> -- Edit this bug report at http://bugs.php.net/?id=16044&edit=1
Bug #16044 Updated: crashing apparently in session module
ID: 16044 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback -Bug Type: Reproducible crash +Bug Type: Session related Operating System: Linux 2.4.7 PHP Version: 4.1.2 New Comment: To properly diagnose this bug, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Previous Comments: [2002-03-13 12:24:49] [EMAIL PROTECTED] db_request() just sends whatever string to the sql database, and db_single() returns a single result from a specified query, if that helps. [2002-03-13 12:23:19] [EMAIL PROTECTED] Using any handler BUT files for sessions seems to crash the PHP program nine times out of ten - once the session is registered, however, it seems to operate just fine. Here's my session code, hope it will help. "; $q = "SELECT svalue FROM $SESS_DBTABLE WHERE sesskey='$key' AND expire < ".time(); $dbr = db_request($q); if($dbr && mysql_num_rows($dbr)) { $q = "DELETE FROM $SESS_DBTABLE WHERE sesskey='$key'"; db_request($q); header("Location: expire.php"); exit; } $q = "SELECT svalue FROM $SESS_DBTABLE WHERE sesskey='$key' AND expire > " . time(); $dbr = db_request($q); if($debug_session) echo "msql($q) returns $dbr"; if(!$dbr) return false; $value = mysql_fetch_row($dbr); if($debug_session) echo "sess_read returning $value[0]"; return $value[0]; } function sess_write($key, $val) { global $user,$debug_session, $SESS_LIFE, $SESS_DBNAME, $SESS_DBTABLE; $expire = time() + (60 * 30); $value = addslashes($val); $q = "INSERT INTO $SESS_DBTABLE VALUES ('$key', $expire, '$value', '$user[username]', '$user[location]', '$user[activity]')"; $dbr = db_request($q); if($debug_session) echo "sess_write($key, $val)msql($q) returns $dbr"; if(!$dbr) { $q = "UPDATE $SESS_DBTABLE SET location='$user[location]',activity='$user[activity]',username='$user[username]',expire=$expire,svalue='$value' WHERE sesskey = '$key' AND expire > " . time(); $dbr = db_request($q); } if($debug_session) echo "sess_write() returning $dbr"; return $dbr; } function sess_destroy($key) { global $debug_session, $SESS_DBNAME, $SESS_DBTABLE; $q = "DELETE FROM $SESS_DBTABLE WHERE sesskey = '$key'"; $dbr = db_request($q); if($debug_session) echo "sess_destroy($key)msql($q) return $dbr"; return $dbr; } function sess_gc($maxlifetime) { global $SESS_DBNAME, $SESS_DBTABLE; $q = "DELETE FROM $SESS_DBTABLE WHERE expire < " . time(); $dbr = db_request($q); return mysql_affected_rows(); } function session_dump() { $session_array = explode(';',session_encode()); $html = "\n\n"; echo $html; } function query_present($loc) { global $SESS_DBTABLE; $q = "location='$loc' and expire > ".time(); $f = "username,activity"; $dbr = db_array($SESS_DBTABLE, $q, $f); if(!$dbr) return 0; while($x = each($dbr)) { $ret[$x['value']['username']] = $x['value']['activity']; } return $ret; } function query_num_online() { global $SESS_DBTABLE; $q = "expire > ".time(); $f = "count(*)"; $dbr = db_single($SESS_DBTABLE, $q, $f); return $dbr[0]; } session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc"); ?> -- Edit this bug report at http://bugs.php.net/?id=16044&edit=1
Bug #16044 Updated: crashing apparently in session module
ID: 16044 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Reproducible crash Operating System: Linux 2.4.7 PHP Version: 4.1.2 New Comment: db_request() just sends whatever string to the sql database, and db_single() returns a single result from a specified query, if that helps. Previous Comments: [2002-03-13 12:23:19] [EMAIL PROTECTED] Using any handler BUT files for sessions seems to crash the PHP program nine times out of ten - once the session is registered, however, it seems to operate just fine. Here's my session code, hope it will help. "; $q = "SELECT svalue FROM $SESS_DBTABLE WHERE sesskey='$key' AND expire < ".time(); $dbr = db_request($q); if($dbr && mysql_num_rows($dbr)) { $q = "DELETE FROM $SESS_DBTABLE WHERE sesskey='$key'"; db_request($q); header("Location: expire.php"); exit; } $q = "SELECT svalue FROM $SESS_DBTABLE WHERE sesskey='$key' AND expire > " . time(); $dbr = db_request($q); if($debug_session) echo "msql($q) returns $dbr"; if(!$dbr) return false; $value = mysql_fetch_row($dbr); if($debug_session) echo "sess_read returning $value[0]"; return $value[0]; } function sess_write($key, $val) { global $user,$debug_session, $SESS_LIFE, $SESS_DBNAME, $SESS_DBTABLE; $expire = time() + (60 * 30); $value = addslashes($val); $q = "INSERT INTO $SESS_DBTABLE VALUES ('$key', $expire, '$value', '$user[username]', '$user[location]', '$user[activity]')"; $dbr = db_request($q); if($debug_session) echo "sess_write($key, $val)msql($q) returns $dbr"; if(!$dbr) { $q = "UPDATE $SESS_DBTABLE SET location='$user[location]',activity='$user[activity]',username='$user[username]',expire=$expire,svalue='$value' WHERE sesskey = '$key' AND expire > " . time(); $dbr = db_request($q); } if($debug_session) echo "sess_write() returning $dbr"; return $dbr; } function sess_destroy($key) { global $debug_session, $SESS_DBNAME, $SESS_DBTABLE; $q = "DELETE FROM $SESS_DBTABLE WHERE sesskey = '$key'"; $dbr = db_request($q); if($debug_session) echo "sess_destroy($key)msql($q) return $dbr"; return $dbr; } function sess_gc($maxlifetime) { global $SESS_DBNAME, $SESS_DBTABLE; $q = "DELETE FROM $SESS_DBTABLE WHERE expire < " . time(); $dbr = db_request($q); return mysql_affected_rows(); } function session_dump() { $session_array = explode(';',session_encode()); $html = "\n\n"; echo $html; } function query_present($loc) { global $SESS_DBTABLE; $q = "location='$loc' and expire > ".time(); $f = "username,activity"; $dbr = db_array($SESS_DBTABLE, $q, $f); if(!$dbr) return 0; while($x = each($dbr)) { $ret[$x['value']['username']] = $x['value']['activity']; } return $ret; } function query_num_online() { global $SESS_DBTABLE; $q = "expire > ".time(); $f = "count(*)"; $dbr = db_single($SESS_DBTABLE, $q, $f); return $dbr[0]; } session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc"); ?> -- Edit this bug report at http://bugs.php.net/?id=16044&edit=1