Bug #65387 [Com]: Circular references in SPL iterators are not garbage collected
| From: | php dot net at ss dot st dot tc | Date: | Mon, 12 Oct 2020 11:08:44 +0000 |
| Subject: | Bug #65387 [Com]: Circular references in SPL iterators are not garbage collected | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229559@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65387&edit=1
ID: 65387
Comment by: php dot net at ss dot st dot tc
Reported by: bugs dot php dot net at ss dot chernousov dot net
Summary: Circular references in SPL iterators are not garbage
collected
Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: Any
PHP Version: 5.5.1
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Very much appreciated!
Previous Comments:
------------------------------------------------------------------------
[2020-10-12 11:03:16] nikic@php.net
The PDO SQLite GC fix has landed, so I'm closing this again.
------------------------------------------------------------------------
[2020-10-02 09:14:40] nikic@php.net
I've implemented a fix for test case 8 in https://github.com/php/php-src/pull/6262.
However, this one will only go into PHP 8.1, because it changes the internal PDO ABI.
------------------------------------------------------------------------
[2020-10-02 08:37:17] nikic@php.net
I checked test case 7, and that one no longer leaks since PHP 8.0. GC support for CurlHandle has
been implemented as part of the migration from resources to objects (resources do not support cycle
GC).
------------------------------------------------------------------------
[2020-10-01 15:23:56] php dot net at ss dot st dot tc
Thanks, @nikic, I appreciate your attention to this problem.
In the meantime, correction my previous comment, test 8 should read as follows (replaced $db with
$obj->a):
// TEST 8: PDO/sqlite callback
$obj->a = new PDO('sqlite::memory:');
$obj->a->sqliteCreateFunction('md5rev', static function() use ($obj) {}, 1);
------------------------------------------------------------------------
[2020-10-01 15:19:53] nikic@php.net
This issue isn't really related to callbacks, it's a question of whether the specific
object holding the callback implements GC support. As such, it needs to be addressed on a
case-by-case basis. Most of the examples you listed were in 3rd-party extensions over which we have
no control.
I will however check the additional two cases you just provided, those are part of our
responsibility :)
------------------------------------------------------------------------
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=65387
--
Edit this bug report at https://bugs.php.net/bug.php?id=65387&edit=1