|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-10-14 15:45 UTC] nikic@php.net
-Status: Open
+Status: Verified
[2019-10-14 15:45 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 22:00:02 2025 UTC |
Description: ------------ Here docker stack : ---------- FROM php:7.3.10-fpm-buster RUN pecl install apcu \ && echo "extension=apcu.so" > /usr/local/etc/php/conf.d/apcu.ini WORKDIR /var/www EXPOSE 9000 CMD ["php-fpm"] Case 1 : php.ini [CRASH 1] ------------------- error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED output_buffering = Off display_errors = On apc.shm_size=80M apc.entries_hint=5000 Case 2 : php.ini [CRASH 2] ------------------- error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED output_buffering = Off display_errors = On apc.shm_size=200M apc.entries_hint=5000 Test script: --------------- <?php set_time_limit(0); for ($i = 1; $i <= 2000; $i++) { apcu_store('session_' . $i, str_pad('', mt_rand(10000, 30000))); } $lasts_news = str_pad('', 5000000); $count_iteration = 0; while (true) { $i = mt_rand(1, 2000); $temoin = apcu_store('session_' . $i, apcu_fetch('session_' . $i)); if ($temoin === false) { throw new \Exception('Unable to store session '.$i.' AT iteration '.$count_iteration); } $temoin = apcu_store('lasts_news', $lasts_news); if ($temoin === false) { throw new \Exception('[CRASH 2] Unable to store lasts news AT iteration ' . $count_iteration); } $cache_info = apcu_cache_info(); if (sizeof($cache_info['cache_list']) < 10) { throw new \Exception('[CRASH 1] APC LIST EMPTY AT iteration ' . $count_iteration); } $count_iteration++; } Expected result: ---------------- Hello, this script should loop indefinitely (stable data length and keys count). In case 1 (low memory), after some loops, it empties the cache list. In case 2 (more memory), after some loops, it refuses to store big entry. Thanks to the whole PHP team for your great work in PHP enhancements. Actual result: -------------- Instead of looping, in the case 1 (apc.shm_size=80M) : Fatal error: Uncaught Exception: [CRASH 1] APC LIST EMPTY AT iteration 96 in /var/www/html/members_area/www/public/crash_reproduction.php:33 Stack trace: #0 {main} thrown in /var/www/html/members_area/www/public/crash_reproduction.php on line 33 Instead of looping, in the case 2 (apc.shm_size=200M) : Fatal error: Uncaught Exception: [CRASH 2] Unable to store lasts news AT iteration 576 in /var/www/html/members_area/www/public/crash_reproduction.php:27 Stack trace: #0 {main} thrown in /var/www/html/members_area/www/public/crash_reproduction.php on line 27