#25274 [Com]: zvals refcount allways 1 after leavinf __wakeup()-method

From: Date: Sat, 18 Dec 2004 13:10:44 +0000
Subject: #25274 [Com]: zvals refcount allways 1 after leavinf __wakeup()-method
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-70597@lists.php.net to get a copy of this message
ID: 25274 Comment by: mikael at SPAMMENOTchl dot chalmers dot se Reported By: bernd@php.net Status: No Feedback Bug Type: Zend Engine 2 problem Operating System: linux PHP Version: 5CVS-2003-11-29 New Comment: More like bug #29423 This issue popped up in PHP 4.3.10, code that worked fine with previous releases started segfaulting when doing things like: function __wakeup() { global $a; $a[] =& $this; } Previous Comments: ------------------------------------------------------------------------ [2003-12-04 02:24:21] sniper@php.net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. ------------------------------------------------------------------------ [2003-11-28 20:42:36] sniper@php.net See also bug #25975, isn't this pretty much same issue? ------------------------------------------------------------------------ [2003-08-28 09:48:29] sniper@php.net ZE2 problem, can't reproduce with PHP 4.3.3. ------------------------------------------------------------------------ [2003-08-28 08:17:52] bernd@php.net after commenting out line 2543 of Zend/zend_execute.c the bug seems to be fixed.. but i have no idea if that solution induces more other problems... ------------------------------------------------------------------------ [2003-08-27 10:12:42] bernd@php.net Description: ------------ Its mainly an internal problem... if i use zval_add_ref(&getThis()); in the __wakeup() method it will be ignored at all... after unserializing the refcount of my object is allways set to "1" :( its reproduceable even through this php-code: Reproduce code: --------------- <?php $a=array(); class x { function __wakeup() { global $a; $a[]=$this; } } $t=new x(); var_dump($t); $t=unserialize(serialize($t)); unset($a); var_dump($t); ?> Expected result: ---------------- object(x)#1 (0) { } object(x)#1 (0) { } Actual result: -------------- object(x)#1 (0) { } UNKNOWN:0 or: object(x)#1 (0) { } Fatal error: Trying to access invalid object in ... on line 15 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25274&edit=1

« previous php.bugs (#70597) next »