Bug #79626 [NEW]: memory leak
| From: | thedinosaurmail at gmail dot com | Date: | Mon, 25 May 2020 06:35:38 +0000 |
| Subject: | Bug #79626 [NEW]: memory leak | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-227144@lists.php.net to get a copy of this message | ||
From: thedinosaurmail at gmail dot com
Operating system: ubuntu 16.
PHP version: 7.4.6
Package: *General Issues
Bug Type: Bug
Bug description:memory leak
Description:
------------
arrow function and anonymous functions should be garbage collect ,but
it seems be the full life cycle
it may relative with this
https://github.com/php/php-src/blob/f3efb9e3fb30fa307e0913e888fb2859cec8209a/Zend/zend_compile.c#L6271
Test script:
---------------
// file1.php
<?php
for ($i = 0; $i < 1000000; $i++)
{
require('file2.php');
}
// file2.php
<?php
$fn1 = fn($x) => $x + $y;
above wil oom
---------
below will not oom
// file3.php
<?php
for ($i = 0; $i < 1000000; $i++)
{
$fn1 = fn($x) => $x + $y;
}
Expected result:
----------------
not report fatal error
Actual result:
--------------
Fatal error: Allowed memory size of 134217728 bytes exhausted at
/root/php-src/Zend/zend_hash.c:149 (tried to allocate 384 bytes) in
/home/dinosaur/test/php746/bin/file2.php on line 2
--
Edit bug report at https://bugs.php.net/bug.php?id=79626&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79626&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79626&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79626&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79626&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79626&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79626&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79626&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79626&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79626&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79626&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79626&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79626&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79626&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79626&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79626&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79626&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79626&r=mysqlcfg