Bug #75649 [Fbk->NoF]: fgets second parameter causes memory leak
Edit report at https://bugs.php.net/bug.php?id=75649&edit=1
ID: 75649
Updated by: php-bugs@lists.php.net
Reported by: zoolyka at gmail dot com
Summary: fgets second parameter causes memory leak
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Filesystem function related
Operating System: ubuntu
PHP Version: 5.6.32
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-03-16 12:03:32] cmb@php.net
I cannot reproduce this with 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>
------------------------------------------------------------------------
[2017-12-07 17:46:53] zoolyka at gmail dot com
Description:
------------
If I specify a larger number then 8192 for fgets's length then PHP process starts to eat
memory.
Test script:
---------------
<?php
$handle = fopen('multi_gb_file', 'r');
while (
! feof($handle)
) {
$buffer = fgets($handle, 10485760);
}
fclose($handle);
?>
Expected result:
----------------
If length is much more then 8192 and the opened file is really huge then memory usage will rise up
to the size of the readed file's size.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75649&edit=1
Thread (3 messages)