]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.0'
authorDmitry Stogov <dmitry@zend.com>
Wed, 24 Feb 2016 18:16:35 +0000 (21:16 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 24 Feb 2016 18:16:35 +0000 (21:16 +0300)
* PHP-7.0:
  Fixed more synchronisation issues during SHM reload

1  2 
ext/opcache/ZendAccelerator.c
ext/opcache/zend_file_cache.c
ext/opcache/zend_persist_calc.c

index 3907bee279d9c963b379a356faaecab765a34582,cd91dfbc4b4e8ef53bac8fe22001bde533acc3d5..5f1c84b6f0aab03867f6b08172392ba003c6b893
@@@ -1563,10 -1571,12 +1571,12 @@@ zend_op_array *file_cache_compile_file(
            }
        }
  
+       SHM_UNPROTECT();
        persistent_script = zend_file_cache_script_load(file_handle);
+       SHM_PROTECT();
        if (persistent_script) {
                /* see bug #15471 (old BTS) */
 -              if (persistent_script->full_path) {
 +              if (persistent_script->script.filename) {
                        if (!EG(current_execute_data) || !EG(current_execute_data)->opline ||
                            !EG(current_execute_data)->func ||
                            !ZEND_USER_CODE(EG(current_execute_data)->func->common.type) ||
index 40a19b997f1ea9cbf05e1e9ee518ded6eaee30d3,b65abca2254a149b641da1dd83d82862bdbf3990..59950ae9a68f534200da1464dbc1473067769020
@@@ -1399,8 -1356,9 +1398,9 @@@ use_process_mem
  
        if (cache_it) {
                script->dynamic_members.checksum = zend_accel_script_checksum(script);
+               script->dynamic_members.last_used = ZCG(request_time);
  
 -              zend_accel_hash_update(&ZCSG(hash), ZSTR_VAL(script->full_path), ZSTR_LEN(script->full_path), 0, script);
 +              zend_accel_hash_update(&ZCSG(hash), ZSTR_VAL(script->script.filename), ZSTR_LEN(script->script.filename), 0, script);
  
                zend_shared_alloc_unlock();
                zend_arena_release(&CG(arena), checkpoint);
index 9516c4e53b0e9ab8d26355f32924e7d7ee1773d4,25ba69bee8bf63c122beefeab904cdcd8583ae79..22e74d6b36f12420746cb8571c428f319fba0731
@@@ -405,8 -393,11 +408,11 @@@ uint zend_accel_script_persist_calc(zen
        ADD_DUP_SIZE(new_persistent_script, sizeof(zend_persistent_script));
        if (key) {
                ADD_DUP_SIZE(key, key_length + 1);
+       } else {
+               /* script is not going to be saved in SHM */
+               new_persistent_script->corrupted = 1;
        }
 -      ADD_STRING(new_persistent_script->full_path);
 +      ADD_STRING(new_persistent_script->script.filename);
  
  #ifdef __SSE2__
        /* Align size to 64-byte boundary */