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

From: Date: Thu, 21 Dec 2017 21:50:41 +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-213234@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:         nikic@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've opened bug #75720 to track the other issue that was mentioned in here, regarding the file
cache not being populated after SHM runs full.


Previous Comments:
------------------------------------------------------------------------
[2017-12-21 21:39:17] dmitry@php.net

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.

------------------------------------------------------------------------
[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.

------------------------------------------------------------------------


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


Thread (52 messages)

« previous php.bugs (#213234) next »