Bug #76484 [Opn->Fbk]: emory leakage with CURLOPT_SSL_VERIFYPEER set to TRUE
| From: | requinix@php.net | Date: | Wed, 25 Jul 2018 19:06:33 +0000 |
| Subject: | Bug #76484 [Opn->Fbk]: emory leakage with CURLOPT_SSL_VERIFYPEER set to TRUE | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216465@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76484&edit=1
ID: 76484
Updated by: requinix@php.net
Reported by: john357smith at gmail dot com
Summary: emory leakage with CURLOPT_SSL_VERIFYPEER set to
TRUE
-Status: Open
+Status: Feedback
Type: Bug
Package: cURL related
Operating System: Linux
PHP Version: 7.2.6
Block user comment: N
Private report: N
New Comment:
Tried this with the 7.2.8 and 7.1.20 I have on hand, and with repeated calls but not for a full hour
(let alone 24). No leaks.
If you var_dump(memory_get_usage()) do you see an increase after a few requests, or does it actually
take on the scale of an hour to see it? What does valgrind have to say?
Previous Comments:
------------------------------------------------------------------------
[2018-07-25 18:48:14] john357smith at gmail dot com
One month after I created this bug and no feedback? Will somebody look at it?
------------------------------------------------------------------------
[2018-06-15 16:57:56] john357smith at gmail dot com
Description:
------------
When cURL is used with CURLOPT_SSL_VERIFYPEER set to TRUE or even without setting it (= default
value is TRUE) there is a memory leakage with every call causing memory usage of php process to be
constantly increasing.
memory_get_usage() reports still the same value so it must be core problem.
Keep test script running for more than 1 hour to see difference in memory usage (e.g. with top/htop
etc.)
After running this script for 24 hours I got 50% of system memory to be used (cca 2GB)!
Test script:
---------------
error_reporting((E_ALL));
while (TRUE)
{
$url = "https://www.yahoo.com/";
echo("Fetching $url ... \n");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_NOBODY, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_exec($ch);
curl_close($ch);
usleep(200000);
}
Expected result:
----------------
No memory leakage even when script is running forever.
Actual result:
--------------
Memory usage is constantly increasing in time.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76484&edit=1