Bug #75579 [Csd]: All Interned Strings Free memory used and PHP crashes

From: Date: Thu, 21 Dec 2017 21:39:19 +0000
Subject: Bug #75579 [Csd]: All Interned Strings Free memory used and PHP crashes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213232@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75579&edit=1 ID: 75579 Updated by: dmitry@php.net Reported by: post at minhost dot no Summary: All Interned Strings Free memory used and PHP crashes Status: Closed Type: Bug Package: opcache Operating System: CentOS 7.4 PHP Version: 7.1.12 Assigned To: dmitry Block user comment: N Private report: N New Comment: I just committed patch to PHP-7.1 and above branches. I can't commit into branches already detached by release managers. If interned string buffer is overflown, we have to keep extra strings somewhere. In case we load script into SHM, we have to copy these extra strings to SHM as well (or we will crash). Or we can load both script and strings into process memory, and then reload again on each request. Previous Comments: ------------------------------------------------------------------------ [2017-12-21 21:22:41] nikic@php.net @dmitry: Yes sorry, I had a logic error. The bailout only happens if both the interned string buffer *and* SHM are full, so there is no problem. ------------------------------------------------------------------------ [2017-12-21 21:16:11] post at minhost dot no @dmitry: My understanding of interned strings is that there should never be saved more interned strings then the limit set in .ini setting: opcache.interned_strings_buffer= So I am confused why it seems you have made it so that it will save interned strings in memory when it exceed the limit we set in .ini setting "opcache.interned_strings_buffer=" Please see: http://php.net/manual/en/opcache.configuration.php Quote from that link: "opcache.interned_strings_buffer The amount of memory used to store interned strings, in megabytes. This configuration directive is ignored in PHP < 5.3.0." So why do you make it so that it stores more interned strings then allocated in this setting? ------------------------------------------------------------------------ [2017-12-21 21:05:00] post at minhost dot no @dmitry: I am frustrated to see you applied the patch to PHP 7.1.14 and not to PHP PHP 7.1.13 - We have production servers with a lot of shared hosting clients running on PHP 7.1.11 - and now we will not be able to upgrade before february 2018. Remember this bug completely makes PHP useless for us that is using file cache as secondary fallback cache. Also remember I reported the bug already 27 november. I feel it is not a priority because you think not so many are using this setup. :( ------------------------------------------------------------------------ [2017-12-21 20:59:21] dmitry@php.net @nikic, Sorry, I missed your last comment. I think, the patch is OK. If we have free SHM memory, "interned" strings are going to be allocated in additional "SHM" blocks and then reused on next requests. If there are no enough SHM, we fall back to process memory. If you think, something is wrong, please, explain. ------------------------------------------------------------------------ [2017-12-21 20:49:31] dmitry@php.net Automatic comment on behalf of dmitry@zend.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=37bf8bdc1494abb2ce5cac40e0be80e23682f851 Log: Fixed bug #75579 (Interned strings buffer overflow may cause crash) ------------------------------------------------------------------------ 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=75579 -- Edit this bug report at https://bugs.php.net/bug.php?id=75579&edit=1

« previous php.bugs (#213232) next »