php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74640 Generators can leak memory
Submitted: 2017-05-23 15:47 UTC Modified: 2017-10-16 06:28 UTC
From: g dot aivaras at gmail dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 7.1.5 OS: MacOS 10.12.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: g dot aivaras at gmail dot com
New email:
PHP Version: OS:

 

 [2017-05-23 15:47 UTC] g dot aivaras at gmail dot com
Description:
------------
When iterating over generators sometimes yielded objects have extra references somewhere. I tried to simplify the test case as much has possible but almost same code in single file did not had this problem

Test script:
---------------
https://github.com/GrandLTU/GeneratorTest

Expected result:
----------------
$ php bin/test.php
Object created 
Object created
Object destroyed 
Object destroyed 
int(0)
int(0)
Exit

Actual result:
--------------
$ php bin/test.php
Object created 
Object created 
int(2)
int(2)
Exit
Object destroyed 
Object destroyed

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-08-12 00:15 UTC] ajf@php.net
This is quite a complicated test case. Does it need to be this many files?

Also, can you provide the “almost same code in single file”?
 [2017-10-16 06:28 UTC] g dot aivaras at gmail dot com
-Status: Open +Status: Closed
 [2017-10-16 06:28 UTC] g dot aivaras at gmail dot com
Not a bug, after looking over with fresh mind I saw that this is code issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 23:01:28 2024 UTC