php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76346 memory leak
Submitted: 2018-05-16 01:26 UTC Modified: 2018-05-16 01:52 UTC
Votes:9
Avg. Score:4.6 ± 0.7
Reproduced:9 of 9 (100.0%)
Same Version:3 (33.3%)
Same OS:7 (77.8%)
From: vagiz at kaifas dot lt Assigned:
Status: Open Package: cURL related
PHP Version: 7.2.5 OS: CentOS 7
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: vagiz at kaifas dot lt
New email:
PHP Version: OS:

 

 [2018-05-16 01:26 UTC] vagiz at kaifas dot lt
Description:
------------
system memory keeps growing when php infinity loop is used with curl inside

Test script:
---------------
<?php
while (1) {
    $curl_handle = curl_init();
    curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 40);
    curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);

    curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20180101 Firefox/60.1');
    curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($curl_handle, CURLOPT_URL, 'http://example.com');
    $test = curl_exec($curl_handle);
    curl_close($curl_handle);
    unset($test, $curl_handle);
}
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-16 01:30 UTC] vagiz at kaifas dot lt
My php is from remi http://rpms.remirepo.net/enterprise/remi-release-7.rpm
 [2018-05-16 01:52 UTC] vagiz at kaifas dot lt
My server versions:
PHP 5.6.36 (cli) (built: Apr 25 2018 09:44:45)
PHP 7.0.30 (cli) (built: Apr 24 2018 20:40:19) ( NTS )
PHP 7.1.17 (cli) (built: Apr 25 2018 07:24:50) ( NTS )
PHP 7.2.5 (cli) (built: Apr 24 2018 19:12:06) ( NTS )

all of them have the same bug
 [2019-03-27 07:49 UTC] token0801 at qq dot com
I see these functions' calling in interval.c: 
60 timelib_apply_localtime(one, 0);
61 timelib_apply_localtime(two, 0);

When I set 2nd param to 1, the result is correct. But I don't know this modifying whether effect other functions or not.

timelib_apply_localtime(one, 1);
timelib_apply_localtime(two, 1);
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 15:01:22 2019 UTC