Bug #79263 [Fbk->NoF]: finfo_buffer fails with "PHP Fatal error: Allowed memory size of"
| From: | php-bugs at lists dot php dot net | Date: | Sun, 18 Jul 2021 04:22:24 +0000 |
| Subject: | Bug #79263 [Fbk->NoF]: finfo_buffer fails with "PHP Fatal error: Allowed memory size of" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-235139@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79263&edit=1
ID: 79263
Updated by: php-bugs@lists.php.net
Reported by: anestis at fraganestis dot eu
Summary: finfo_buffer fails with "PHP Fatal error: Allowed
memory size of"
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Unknown/Other Function
Operating System: Debian 9
PHP Version: 7.4.2
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-07-06 16:22:52] cmb@php.net
> In any case, this is a bug in upstream libmagic, it needs to be
> reported and fixed there before we can do anything about it.
Has anybody reported that upstream[1]?
[1] <http://darwinsys.com/file/>
------------------------------------------------------------------------
[2020-06-12 07:47:56] magnar at myrtveit dot com
I've created two scripts illustrating the problem with finfo_buffer:
Memory usage of finfo_file: https://3v4l.org/M3YLG
Memory usage of finfo_buffer: https://3v4l.org/LNNoV
On a 16M file, finfo_file uses 20M memory. finfo_buffer, however, uses 244M!
------------------------------------------------------------------------
[2020-02-14 17:14:53] anestis at fraganestis dot eu
The error is produced when I use the following sequence:
1) read the data from a temp file into a buffer
2) call finfo_buffer to get the mimetype
3) parse the buffer
The error is not produced and everything works fine if the sequence is modified as follows:
1) call finfo_file on temp file to get the mimetype
2) read the data from the same temp file into a buffer
3) parse the buffer
------------------------------------------------------------------------
[2020-02-13 08:15:27] nikic@php.net
This sounds similar to bug #78987. In any case, this is a bug in upstream libmagic, it needs to be
reported and fixed there before we can do anything about it.
------------------------------------------------------------------------
[2020-02-13 05:15:01] anestis at fraganestis dot eu
@requinix@php.net: It's a pdf file. Seems legit. The reader (foxit) opens it just fine.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=79263
--
Edit this bug report at https://bugs.php.net/bug.php?id=79263&edit=1