Bug #76844 [Ana->Csd]: PHP crashes on big file with array inside
| From: | nielsdos@php.net | Date: | Thu, 26 Oct 2023 21:29:26 +0000 |
| Subject: | Bug #76844 [Ana->Csd]: PHP crashes on big file with array inside | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-245662@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76844&edit=1
ID: 76844
Updated by: nielsdos@php.net
Reported by: denis at bitrix dot ru
Summary: PHP crashes on big file with array inside
-Status: Analyzed
+Status: Closed
Type: Bug
Package: opcache
Operating System: Ubuntu 14.04.5 LTS
PHP Version: 7.2.9
-Assigned To:
+Assigned To: nielsdos
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
If you are still experiencing this bug, try to check out latest source from https://github.com/php/php-src and re-test.
Thank you for the report, and for helping us make PHP better.
Fixed by Dmitry via https://github.com/php/php-src/commit/bd185c3dd5f8811319db442ba6f8dd3d15515f3f
Previous Comments:
------------------------------------------------------------------------
[2021-07-08 14:09:37] cmb@php.net
Related To: Bug #77620
------------------------------------------------------------------------
[2019-06-29 13:09:02] cmb@php.net
Related To: Bug #77620
------------------------------------------------------------------------
[2018-09-06 08:40:52] nikic@php.net
@rhsoft: The interned strings buffer is not really relevant to this issue. As @cmb pointed out, this
is a stack overflow in zend_ssa_check_scc_var. The test script has a very long (and linear) chain of
uses, each of which results in another recursive call. This could be resolved either by making the
algorithm non-recursive or adding / changing some limits. E.g. we might want to punt on SSA
optimizations if there are too many SSA vars.
------------------------------------------------------------------------
[2018-09-06 08:31:07] spam2 at rhsoft dot net
"Fatal Error Zend OPcache cannot allocate buffer for interned strings" clearly indicates
that "opcache.memory_consumption" is way too small
frankly if you can allocate 18 MB i guess someone has lowered the default value
------
-rw-r--r-- 1 root root 198K 2018-03-05 16:37
/usr/share/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusans.ph
/usr/share/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusans.php allocates 1,36 MB in opcache so
your guess 16M should be enough for 12M file is pretty wrong
------------------------------------------------------------------------
[2018-09-06 08:24:47] denis at bitrix dot ru
opcache.interned_strings_buffer doesn't seem to affect:
$ php -i|grep opcache.interned_strings_buffer
opcache.interned_strings_buffer => 8 => 8
$ php -d opcache.enable_cli=1 -d opcache.interned_strings_buffer=16 restore.file_list.php
Segmentation fault
I guess, 16M should be enough for 12M file. And further I got an error:
$ php -d opcache.enable_cli=1 -d opcache.interned_strings_buffer=18 restore.file_list.php
Thu Sep 6 10:19:14 2018 (12707): Fatal Error Zend OPcache cannot allocate buffer for interned
strings
------------------------------------------------------------------------
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=76844
--
Edit this bug report at https://bugs.php.net/bug.php?id=76844&edit=1