|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25274 zvals refcount allways 1 after leavinf __wakeup()-method
Submitted: 2003-08-27 10:12 UTC Modified: 2003-12-04 02:24 UTC
Avg. Score:4.4 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:4 (66.7%)
Same OS:4 (66.7%)
From: Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5CVS-2003-11-29 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-08-27 10:12 UTC]
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:

  class x {
    function __wakeup() {
	global $a;

  $t=new x();

Expected result:
object(x)#1 (0) {
object(x)#1 (0) {

Actual result:
object(x)#1 (0) {

object(x)#1 (0) { }
Fatal error: Trying to access invalid object in ... on line 15


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-28 08:17 UTC]
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-28 09:48 UTC]
ZE2 problem, can't reproduce with PHP 4.3.3.

 [2003-11-28 20:42 UTC]
See also bug #25975, isn't this pretty much same issue?

 [2003-12-04 02:24 UTC]
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.

 [2004-12-18 14:10 UTC] mikael at SPAMMENOTchl dot chalmers dot se
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;
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 28 17:01:30 2024 UTC