ID:               12793
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Analyzed
+Status:           Closed
 Bug Type:         Session related
 Operating System: Linux
 PHP Version:      4.0CVS-2002-03-0
 New Comment:

This bug has been fixed in CVS.




Previous Comments:
------------------------------------------------------------------------

[2002-03-19 05:05:21] [EMAIL PROTECTED]

Actually a duplicate, but I would like to keep it open since
nice backtrace is in it.

------------------------------------------------------------------------

[2002-03-06 08:11:27] [EMAIL PROTECTED]

I can reproduce the crash with the following backtrace:

Starting program: /home/ek/projects/php/php4/sapi/cli/php -f ~/t
sleep!<br>
Program received signal SIGSEGV, Segmentation fault.
0x80dc1c8 in php_var_serialize (buf=0x7fffe3e0, struc=0x816c6ec,
var_hash=0x7fffe3ec)
    at var.c:561
561             smart_str_0(buf);
(gdb) bt
#0  0x80dc1c8 in php_var_serialize (buf=0x7fffe3e0, struc=0x816c6ec,
    var_hash=0x7fffe3ec) at var.c:561
#1  0x80dc24f in zif_serialize (ht=1, return_value=0x81773ec,
this_ptr=0x0,
    return_value_used=1) at var.c:583
#2  0x80f0ed1 in execute (op_array=0x81715d4) at ./zend_execute.c:1598
#3  0x807011c in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at zend.c:810
#4  0x807d51f in php_execute_script (primary_file=0x7ffff8dc) at
main.c:1377
#5  0x805ad89 in main (argc=3, argv=0x7ffff944) at php_cli.c:555


------------------------------------------------------------------------

[2002-03-06 07:14:58] [EMAIL PROTECTED]

Confirm this bug on PHP 4.0.6 and 4.1.1 on Windows 2000 Server and
Apache 1.3.23

Here is requested testcase:

<?php
class myClass
{
    function myClass()
    {
    }

    function __sleep()
    {
        echo 'sleep!<br>';
    }

    function __wakeup()
    {
        echo 'wakeup!<br>';
    }
};

$obj = new myClass();
$str = serialize($obj);
echo $str."<br>";
$obj2 = unserialize($str);
print_r($obj2);
?>

 Running this script on PHP 4.0.6 will set $str to empty string
(however __sleep() is called properly). Commenting out __sleep() method
will return normal serialized value of an object.
 Running this script on PHP 4.1.1 cause PHP to crash.

 Please reopen this bug or i'll submit new one :)

------------------------------------------------------------------------

[2001-12-26 18:51:58] [EMAIL PROTECTED]

No feedback. Closing.

------------------------------------------------------------------------

[2001-12-05 10:19:18] [EMAIL PROTECTED]

Can you provide a _simple_ sample-script?

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/12793

-- 
Edit this bug report at http://bugs.php.net/?id=12793&edit=1

Reply via email to