From: Dmitry Stogov Date: Wed, 24 Feb 2016 18:16:35 +0000 (+0300) Subject: Merge branch 'PHP-7.0' X-Git-Tag: php-7.1.0alpha1~571 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1a46917740d97501566f1896e279596b2dde9282;p=php Merge branch 'PHP-7.0' * PHP-7.0: Fixed more synchronisation issues during SHM reload --- 1a46917740d97501566f1896e279596b2dde9282 diff --cc ext/opcache/ZendAccelerator.c index 3907bee279,cd91dfbc4b..5f1c84b6f0 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@@ -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) || diff --cc ext/opcache/zend_file_cache.c index 40a19b997f,b65abca225..59950ae9a6 --- a/ext/opcache/zend_file_cache.c +++ b/ext/opcache/zend_file_cache.c @@@ -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); diff --cc ext/opcache/zend_persist_calc.c index 9516c4e53b,25ba69bee8..22e74d6b36 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@@ -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 */