PHP 4.0 Bug #2301: SIGSEGV when using complex object-in-array variables in sessions.
| From: | j at kubs dot cz | Date: | Wed, 15 Sep 1999 09:07:01 +0000 |
| Subject: | PHP 4.0 Bug #2301: SIGSEGV when using complex object-in-array variables in sessions. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10929@lists.php.net to get a copy of this message | ||
From: j@kubs.cz
Operating system: Linux 2.2.11
PHP version: 4.0 Latest CVS (15/09/1999)
PHP Bug Type: Reproduceable crash
Bug description: SIGSEGV when using complex object-in-array variables in sessions.
---- pokus.php ---- cut here ----
<?
class CClass {
var $aa, $bb;
}
session_start();
session_register("tmp");
$tmp["blee"] = new CClass;
$tmp["fuuj"] = new CClass;
$tmp["blee"]->aa = "neee";
echo $tmp["blee"]; // displays "object"
echo "<br><a href=\"pokus1.php\">next</a>";
?>
---- pokus1.php ---- cut here ----
<?
session_start();
echo $tmp["blee"]; // SIGSEGVs
?>
----------------------------------
What am I trying to do is to pass an object-in-array variable in session. I've even tried to
do:
$b = serialize($tmp);
$tmp1 = unserialize($b);
echo $tmp1["blee"];
which resulted into "Array" instead of object, bud didn't cause any crash.
------------------ gdb bt -----
#0 0x80b706e in zend_hash_find (ht=0x14, arKey=0x8190bf0 to_string,
nKeyLength=10, pData=0xbffff928) at zend_hash.c:919
#1 0x80af68d in call_user_function_ex (function_table=0x0, object=0x81983d8,
function_name=0xbffff9a0, retval=0xbffff9d4, param_count=0,
params=0x8197540, no_separation=1) at zend_execute_API.c:329
#2 0x80af623 in call_user_function (function_table=0x0, object=0x81983d8,
function_name=0xbffff9a0, retval=0xbffff9d4, param_count=0, params=0x0)
at zend_execute_API.c:303
#3 0x80b406d in zend_make_printable_zval (expr=0x81983d8,
expr_copy=0xbffff9d4, use_copy=0xbffff9d0) at zend.c:151
#4 0x80b4105 in zend_print_zval (expr=0x81983d8, indent=0) at zend.c:174
#5 0x80b3dad in zend_print_variable (var=0x81983d8) at zend_variables.c:154
#6 0x80bc081 in execute (op_array=0x8193d40) at zend_execute.c:1127
#7 0x807a45d in php_execute_script (primary_file=0xbffffbc0) at main.c:1168
#8 0x807a4d9 in apache_php_module_main (r=0x818e4fc, fd=21,
display_source_mode=0) at main.c:1209
#9 0x8078c80 in send_php ()
#10 0x8078cc4 in send_parsed_php ()
#11 0x80c2c5f in ap_invoke_handler ()
#12 0x80d5cfd in process_request_internal ()
#13 0x80d5d5c in ap_process_request ()
#14 0x80cd5c1 in child_main ()
#15 0x80cd74c in make_child ()
#16 0x80cd8a7 in startup_children ()
#17 0x80cde94 in standalone_main ()
#18 0x80ce6e7 in main ()
---
Jakub