#30674 [Opn]: Unexpected results and core dump with recursive references serializing
| From: | fmmarzoa at gmx dot net | Date: | Wed, 03 Nov 2004 15:47:39 +0000 |
| Subject: | #30674 [Opn]: Unexpected results and core dump with recursive references serializing | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-68656@lists.php.net to get a copy of this message | ||
ID: 30674
User updated by: fmmarzoa at gmx dot net
-Summary: Unexpected results and crashes with recursive
references serializing
Reported By: fmmarzoa at gmx dot net
Status: Open
Bug Type: Zend Engine 2 problem
Operating System: Linux (probably others)
PHP Version: 5.0.2
New Comment:
(just changed "crashed" by "core dump" in subject)
Previous Comments:
------------------------------------------------------------------------
[2004-11-03 16:29:49] fmmarzoa at gmx dot net
Description:
------------
serialize function lost references to itself on an array and produces a
segfault in some other circunstances. I send the code with which I've
discovered the problem, but Andrey Hristov has also cooked some code
based on this that crash the PHP engine.
Complete quoted thread with more code samples can be found on the
internals list archive:
http://marc.theaimsgroup.com/?l=php-dev&m=109949534625983&w=2
Reproduce code:
---------------
<pre>
<?php
$Arr = array();
$Arr['self'] = &$Arr;
var_dump ( $Arr );
$serdata = serialize ($Arr);
$Arr2 = unserialize ( $serdata );
echo "\n\n";
var_dump ( $Arr2 );
?>
</pre>
Complete quoted thread with more code samples, including segfaults, can
be found on the internals list archive:
http://marc.theaimsgroup.com/?l=php-dev&m=109949534625983&w=2
Expected result:
----------------
array(1) {
["self"]=>
array(1) {
["self"]=>
*RECURSION*
}
}
array(1) {
["self"]=>
array(1) {
["self"]=>
*RECURSION*
}
}
Actual result:
--------------
array(1) {
["self"]=>
array(1) {
["self"]=>
*RECURSION*
}
}
array(1) {
["self"]=>
array(1) {
["self"]=>
NULL
}
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30674&edit=1