Bug #77207 [Fbk->NoF]: openssl_pkey_get_private didn't free memory
| From: | php-bugs at lists dot php dot net | Date: | Sun, 13 Jun 2021 04:22:13 +0000 |
| Subject: | Bug #77207 [Fbk->NoF]: openssl_pkey_get_private didn't free memory | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-234385@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77207&edit=1
ID: 77207
Updated by: php-bugs@lists.php.net
Reported by: sagaxu at qq dot com
Summary: openssl_pkey_get_private didn't free memory
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: OpenSSL related
PHP Version: Irrelevant
Assigned To: cmb
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2021-06-02 11:09:44] cmb@php.net
I cannot reproduce this with current PHP-7.4. Is this still an
issue for you with any of the actively supported PHP versions[1]?
[1] <https://www.php.net/supported-versions.php>
------------------------------------------------------------------------
[2018-11-27 09:53:09] sagaxu at qq dot com
Description:
------------
$ php -v
PHP 7.2.11-3build2 (cli) (built: Nov 26 2018 13:08:29) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.11-3build2, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans
PHP 7.1.X and 7.2.X both affected.
Test script:
---------------
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'stderr');
$pk = '-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAokB9srofHWSRuv0x679iYftvS0WBrTS0FvK/yzpdAodcNm5S
SQ8YJqRv5o/YE/i+d49zMM92/Q7hTVnuaEpmYzsX34PvOKYW7LEuTYpa/QRQvcUJ
p/vZ9sR3s7c/FoWrdzIl7kx/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NR+ci8Znug+vTzmTMCgYAaHUciAIcKEGzKy1FixvXUIIdN4gMey/TeQXyq
8Ho9gx+xPfW32fDPfTmMMeFBZm6aeof3Kl1mSh6vbptxAPEgz6FiPvg54rwyJKJc
leTbVOyx/P+vFm9h1/2HVxM7DXsiV2eXCNv+E3E5bxFX4hNV6cVYqS2fRGro/c7r
07z2gQKBgQCtukjBH1l/zHyV3acr5zXhY416wvEMh3zfYWQYYwoUACOaUTlO4Fqz
EsmRtC76Nc3zpLz3/dhMn9ywz7+HJqZs7hNTvU2vxEBAaCFYyzljaJA1EjIKQAdr
jUfQ5aNvrj5lVBJ+iHbV5O/ktFHLcM8eVurZpDirshS2DFMkcrcLHg==
-----END RSA PRIVATE KEY-----';
for ($i=0; $i<10; $i++) {
for ($j=0; $j<10000; $j++) {
$key = openssl_pkey_get_private($pk);
openssl_pkey_free($key);
}
echo memory_get_usage() . "\n";
}
Expected result:
----------------
223840
223880
223880
223880
223880
223880
223880
223880
223880
223880
Actual result:
--------------
1167336
1931656
2171656
3460256
3700256
3940256
6277408
6517408
6757408
6997408
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77207&edit=1