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

From: Date: Thu, 30 Nov 2017 14:49:04 +0000
Subject: Bug #75579 [Opn]: All Interned Strings Free memory used and PHP crashes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212839@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 User updated by: post at minhost dot no Reported by: post at minhost dot no Summary: All Interned Strings Free memory used and PHP crashes Status: Open Type: Bug Package: opcache Operating System: CentOS 7.4 PHP Version: 7.1.12 Block user comment: N Private report: N New Comment: I spoke to soon. After more testing on PHP 7.1.12 with the patch from bug #75573 applied: http://git.php.net/?p=php-src.git;a=commit;h=3b9ba7b6bd9e24bdbeca8e8e3f24cee2fccc51d8 - still the bug is present! After visiting about nine wordpress sites on the test server, the interned strings used memory became full and PHP sites started to crash and go down. From apache error log for one of the domains after it stopped working: [Thu Nov 30 15:40:40.273796 2017] [proxy_fcgi:error] [pid 17990:tid 140238684755712] [client 176.74.214.18:42343] AH01071: Got error 'PHP message: PHP Fatal error: Cannot declare interface JsonSerializable, because the name is already in use in /home/USER/domains/DOMAIN.TLD/public_html/wp-includes/compat.php on line 428\n' [Thu Nov 30 15:40:41.697018 2017] [proxy_fcgi:error] [pid 17990:tid 140238693148416] [client 176.74.214.18:52760] AH01071: Got error 'PHP message: PHP Fatal error: Cannot declare interface JsonSerializable, because the name is already in use in /home/USER/domains/DOMAIN.TLD/public_html/wp-includes/compat.php on line 428\n' So this still prevents us from upgrading to PHP 7.1.12. Remeber the bug is not present in PHP 7.1.11 Previous Comments: ------------------------------------------------------------------------ [2017-11-29 18:32:20] post at minhost dot no Related To: Bug #75573 ------------------------------------------------------------------------ [2017-11-29 18:08:01] post at minhost dot no @nikic@php.net: I have now applied the patch from bug #75573, I applied this patch: http://git.php.net/?p=php-src.git;a=commit;h=3b9ba7b6bd9e24bdbeca8e8e3f24cee2fccc51d8 - on my small test vps server, this seem to have solved the problem with crashing php sites. They no longer seem to crash and seem to function correctly! However "Interned Strings Free memory" still runs full very quick, wich it never did in PHP 7.1.11. I can only speculate that in PHP 7.1.11 it did not correctly display what was actually used, and the reason it runs full in 7.1.12 is because this is fixed in this version so that it shows whats really is used? Would be nice if someone could confirm that? I think we can consider closing my bug report, as it seems fixed in bug #75573. :) ------------------------------------------------------------------------ [2017-11-29 11:20:10] post at minhost dot no @nikic@php.net: Thank you. (Please note that I am running PHP 7.1.11 trying to upgrade to 7.1.12.) What can I do to give you more information so this could be solved? ------------------------------------------------------------------------ [2017-11-29 11:16:53] nikic@php.net PHP definitely shouldn't crash just because the interned string buffer runs full. The only recent change to interning in 7.0 I see is https://github.com/php/php-src/commit/d82805f097564558d94e3062e87b17d6ccae893f, which does not look problematic to me. It might be that this is a round-about side-effect of bug #75573, which is a memory corruption issue that also seems to affect some WP plugins. ------------------------------------------------------------------------ [2017-11-29 11:07:29] post at minhost dot no @spam2 at rhsoft dot net: You are wrong about this. I have allocated enough memory to opcache (32 GB). I am talking about "opcache.interned_strings_buffer", it should not crash PHP sites when it is to low. And in PHP 7.1.11 it does not. Suddenly in PHP 7.1.12 it uses all "Interned Strings Free memory" and sites start to go down. I just now was able to reproduce this in a test VPS server wich only contain a few test sites. This is what I did: I was using this value wich is default: opcache.interned_strings_buffer=4 Then I installed 8 vanilla WordPress sites, and visited them all. After that it looked like this in PHP info page: Interned Strings Used memory 2094032 Interned Strings Free memory 2100272 Then on ONE of the WordPress sites I installed the following plugins: All In One SEO Pack Contact Form 7 Jetpack by WordPress.com MetaSlider TinyMCE Advanced WooCommerce Wordfence Security Then it looked like this in PHP info page: Interned Strings Used memory 4194288 Interned Strings Free memory 16 As you can see all interned strings free memory was suddenly used, if this would have been on PHP 7.1.11 that would NOT happen. And at this point sites start to stop working. Suddenly I can't log into wordpress admin area on some of the sites, they only give "HTTP ERROR 500", and apache error log give this: [Wed Nov 29 11:53:08.623533 2017] [proxy_fcgi:error] [pid 10182:tid 139804087817984] [client 176.74.214.18:32283] AH01071: Got error 'PHP message: PHP Fatal error: require_once(): Failed opening required '\x02' (include_path='.:/usr/local/php71/lib/php') in... However on this test there was no errors in /usr/local/php71/var/log/php-fpm.log So I am able to duplicate this on a test VPS server without any clients, only by installing a few WordPress sites and som extra plugins in one of them. ------------------------------------------------------------------------ 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 (#212839) next »