Bug #71818 [Csd->Asn]: Memory leak when array altered in destructor

From: Date: Thu, 21 Jul 2016 07:23:56 +0000
Subject: Bug #71818 [Csd->Asn]: Memory leak when array altered in destructor
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202464@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71818&edit=1

 ID:                 71818
 Updated by:         davey@php.net
 Reported by:        james dot harris at icecave dot com dot au
 Summary:            Memory leak when array altered in destructor
-Status:             Closed
+Status:             Assigned
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   OSX
 PHP Version:        7.0.4
 Assigned To:        laruence
 Block user comment: N
 Private report:     N

 New Comment:

Closed accidentally. Reopening.


Previous Comments:
------------------------------------------------------------------------
[2016-07-20 11:29:50] davey@php.net

Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8fc934b0a1781bc0685775f4c476c6704d796a76
Log: Fixed bug #71818 (Memory leak when array altered in destructor)

------------------------------------------------------------------------
[2016-07-14 09:08:25] dmitry@php.net

Fixed in PHP-7.1.
http://git.php.net/?p=php-src.git;a=commitdiff;h=8fc934b0a1781bc0685775f4c476c6704d796a76
The patch might be backported to PHP-7.0 after additional testing.

------------------------------------------------------------------------
[2016-07-14 09:05:57] dmitry@php.net

Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8fc934b0a1781bc0685775f4c476c6704d796a76
Log: Fixed bug #71818 (Memory leak when array altered in destructor)

------------------------------------------------------------------------
[2016-04-15 01:39:11] james dot harris at icecave dot com dot au

Those are the conditions under which the leak does NOT occur. Sorry, I worded it a bit backwards.

I realise this is a bit academic and strange, and I've certainly worked around whatever code I
found doing this (I can't remember what it was now), but I figured it was still worth bring up
incase it was an issue with the array implementation itself.

Thanks,
James

------------------------------------------------------------------------
[2016-04-14 14:35:40] jhdxr@php.net

"$this is removed from the array in the destructor"
In fact, you did NOT removed $thif from the array. $this->things[] = null; add a new
element into the array. 

You can use
$this->things = null;
or
`unset($this->things);

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


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

    https://bugs.php.net/bug.php?id=71818


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


Thread (11 messages)

« previous php.bugs (#202464) next »