From: Dmitry Stogov Date: Tue, 14 May 2019 11:54:30 +0000 (+0300) Subject: Merge branch 'PHP-7.2' into PHP-7.3 X-Git-Tag: php-7.3.7RC1~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a43678aa120d122460e53034d6484748eedbe130;p=php Merge branch 'PHP-7.2' into PHP-7.3 * PHP-7.2: Fixed possible crashes, because of inconsistent PCRE cache and opcache SHM reset --- a43678aa120d122460e53034d6484748eedbe130 diff --cc ext/opcache/ZendAccelerator.c index f095429270,34e4ef0071..a8ea054d43 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@@ -2203,9 -2057,9 +2203,9 @@@ static int persistent_stream_open_funct } /* zend_resolve_path() replacement for PHP 5.3 and above */ -static zend_string* persistent_zend_resolve_path(const char *filename, int filename_len) +static zend_string* persistent_zend_resolve_path(const char *filename, size_t filename_len) { - if (ZCG(enabled) && accel_startup_ok && + if ( #ifdef HAVE_OPCACHE_FILE_CACHE !file_cache_only && #endif @@@ -2357,8 -2210,9 +2356,9 @@@ static void accel_activate(void if (ZCG(root_hash) != buf.st_ino) { zend_string *key = zend_string_init("opcache.enable", sizeof("opcache.enable")-1, 0); zend_alter_ini_entry_chars(key, "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_RUNTIME); - zend_string_release(key); + zend_string_release_ex(key, 0); zend_accel_error(ACCEL_LOG_WARNING, "Can't cache files in chroot() directory with too big inode"); + ZCG(accelerator_enabled) = 0; return; } } @@@ -2459,13 -2318,9 +2464,9 @@@ static void accel_deactivate(void */ if (ZCG(cwd)) { - zend_string_release(ZCG(cwd)); + zend_string_release_ex(ZCG(cwd), 0); ZCG(cwd) = NULL; } - - if (!ZCG(enabled) || !accel_startup_ok) { - return; - } } static int accelerator_remove_cb(zend_extension *element1, zend_extension *element2)