]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.3' into PHP-7.4
authorDmitry Stogov <dmitry@zend.com>
Tue, 14 May 2019 12:09:17 +0000 (15:09 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 14 May 2019 12:09:17 +0000 (15:09 +0300)
* PHP-7.3:
  Moved NEWS entry
  Fixed possible crashes, because of inconsistent PCRE cache and opcache SHM reset

1  2 
ext/opcache/ZendAccelerator.c
ext/opcache/ZendAccelerator.h
ext/opcache/zend_accelerator_module.c

index 7d578c0787e66db01f32fd3def04308f3501c25f,a8ea054d4391b2e8405d3d5400bebce79da5c111..58baf76e5fec20f031b51132f632da2454dae50e
@@@ -1879,10 -1906,13 +1879,10 @@@ zend_op_array *persistent_compile_file(
        if (!file_handle->filename || !ZCG(enabled) || !accel_startup_ok) {
                /* The Accelerator is disabled, act as if without the Accelerator */
                return accelerator_orig_compile_file(file_handle, type);
 -#ifdef HAVE_OPCACHE_FILE_CACHE
        } else if (file_cache_only) {
                return file_cache_compile_file(file_handle, type);
-       } else if ((!ZCG(counted) && !ZCSG(accelerator_enabled)) ||
 -#endif
+       } else if (!ZCG(accelerator_enabled) ||
                   (ZCSG(restart_in_progress) && accel_restart_is_active())) {
 -#ifdef HAVE_OPCACHE_FILE_CACHE
                if (ZCG(accel_directives).file_cache) {
                        return file_cache_compile_file(file_handle, type);
                }
@@@ -2168,10 -2205,11 +2168,8 @@@ 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, size_t filename_len)
  {
-       if (ZCG(enabled) && accel_startup_ok &&
 -      if (
 -#ifdef HAVE_OPCACHE_FILE_CACHE
--              !file_cache_only &&
-           (ZCG(counted) || ZCSG(accelerator_enabled)) &&
-           !ZCSG(restart_in_progress)) {
 -#endif
++      if (!file_cache_only &&
+           ZCG(accelerator_enabled)) {
  
                /* check if callback is called from include_once or it's a main request */
                if ((!EG(current_execute_data) &&
@@@ -2313,7 -2358,8 +2311,8 @@@ int accel_activate(INIT_FUNC_ARGS
                                        zend_alter_ini_entry_chars(key, "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_RUNTIME);
                                        zend_string_release_ex(key, 0);
                                        zend_accel_error(ACCEL_LOG_WARNING, "Can't cache files in chroot() directory with too big inode");
 -                                      return;
+                                       ZCG(accelerator_enabled) = 0;
 +                                      return SUCCESS;
                                }
                        }
                }
                realpath_cache_clean();
  
                accel_reset_pcre_cache();
+               ZCG(pcre_reseted) = 0;
        } else if (reset_pcre) {
                accel_reset_pcre_cache();
+               ZCG(pcre_reseted) = 1;
        }
 +
 +      if (ZCSG(preload_script)) {
 +              preload_activate();
 +      }
 +
 +      return SUCCESS;
  }
  
  int accel_post_deactivate(void)
Simple merge
index f013fb9db978871346a31c159ee2a664cc103b94,5b43a552020441cbe5ad1dbb9a62eebe2f830aa0..fd35098c9e56c79eb553686bd02a69a35d875373
@@@ -433,9 -438,13 +433,7 @@@ void zend_accel_info(ZEND_MODULE_INFO_F
  {
        php_info_print_table_start();
  
-       if (ZCG(enabled) && accel_startup_ok &&
-               ((ZCG(counted) || ZCSG(accelerator_enabled)) || file_cache_only)
 -      if (
 -#ifdef HAVE_OPCACHE_FILE_CACHE
 -              (ZCG(accelerator_enabled) || file_cache_only)
 -#else
 -              (ZCG(accelerator_enabled))
 -#endif
--      ) {
++      if (ZCG(accelerator_enabled) || file_cache_only) {
                php_info_print_table_row(2, "Opcode Caching", "Up and Running");
        } else {
                php_info_print_table_row(2, "Opcode Caching", "Disabled");
@@@ -597,8 -608,9 +595,8 @@@ static ZEND_FUNCTION(opcache_get_status
        array_init(return_value);
  
        /* Trivia */
-       add_assoc_bool(return_value, "opcache_enabled", ZCG(enabled) && (ZCG(counted) || ZCSG(accelerator_enabled)));
+       add_assoc_bool(return_value, "opcache_enabled", ZCG(accelerator_enabled));
  
 -#ifdef HAVE_OPCACHE_FILE_CACHE
        if (ZCG(accel_directives).file_cache) {
                add_assoc_string(return_value, "file_cache", ZCG(accel_directives).file_cache);
        }