Compare commits

...
Author SHA1 Message Date
Nikita Popov 21465ec0e1 Fixed bug #78230
(cherry picked from commit 4892bbc167)
2019-07-03 12:49:41 +02:00
Christoph M. Becker 813279f4b4 Prepare PHP 7.3.7 2019-07-02 11:05:25 +02:00
Christoph M. Becker d428155055 Prepare for PHP 7.3.7RC3 2019-06-20 12:27:04 +02:00
Remi Collet 0e7490f49e fix test for Windows and for parallel run
(cherry picked from commit d8202bf917)
2019-06-20 12:24:16 +02:00
Remi Collet 4f40d81b8d improve test clean section
(cherry picked from commit b3cfeda3c7)
2019-06-20 12:24:05 +02:00
Remi Collet e1dc9d6c1e add test for #78185
(cherry picked from commit 63f2d88088)
2019-06-20 12:23:51 +02:00
Dmitry Stogov 525c80ec74 Fixed bug #78185 (File cache no longer works)
(cherry picked from commit cd6a6e4cf2)
2019-06-20 12:22:53 +02:00
Christoph M. Becker 770db7e68c Prepare for PHP 7.3.7RC2 2019-06-18 09:13:10 +02:00
Dmitry Stogov 1b63ca3c78 Backport 96a12578c1
(cherry picked from commit 28808ca96d)
2019-06-18 09:06:56 +02:00
Dmitry Stogov b70fcdd841 Backport 91a6cdbff5
(cherry picked from commit 40f463b560)
2019-06-18 09:06:24 +02:00
Nikita Popov a2058937bc Fixed bug #78106
When disabling opcache during the request via opcache.enable ini
setting, make sure we also disable ZCG(accelerator_enabled).

(cherry picked from commit f1a8138055)
2019-06-18 09:05:24 +02:00
Nikita Popov b6af9da5a0 Add test for bug #78106
Also add PHP_TEST_EXTRA_ARGS environment variable, which allows
to pass on -c, -d etc flags provided by run-tests.php. Otherwise
we won't get the built-in server to run with opcache.

(cherry picked from commit f8a68fd935)
2019-06-18 09:03:37 +02:00
Christoph M. Becker 4c6de12b2d Update for PHP 7.3.7RC1 2019-06-11 12:26:00 +02:00
14 changed files with 143 additions and 12 deletions

No files matched your search

+3 -1
View File
@@ -1,6 +1,6 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 7.3.7
04 Jul 2019, PHP 7.3.7
- Core:
. Fixed bug #76980 (Interface gets skipped if autoloader throws an exception).
@@ -23,6 +23,8 @@ PHP NEWS
- Opcache:
. Fixed bug #78015 (Incorrect evaluation of expressions involving partials
arrays in SCCP). (Nikita)
. Fixed bug #78106 (Path resolution fails if opcache disabled during request).
(Nikita)
- OpenSSL:
. Fixed bug #78079 (openssl_encrypt_ccm.phpt fails with OpenSSL 1.1.1c).
+1 -1
View File
@@ -20,7 +20,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "3.3.7-dev"
#define ZEND_VERSION "3.3.7"
#define ZEND_ENGINE_3
+1 -1
View File
@@ -108,7 +108,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=7
PHP_EXTRA_VERSION="-dev"
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+1
View File
@@ -2204,6 +2204,7 @@ static int try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var,
if (opline->opcode == ZEND_DO_ICALL) {
removed_ops = remove_call(ctx, opline, ssa_op);
} else if (opline->opcode == ZEND_TYPE_CHECK
&& opline->op1_type & (IS_VAR|IS_TMP_VAR)
&& !value_known(&ctx->values[ssa_op->op1_use])) {
/* For TYPE_CHECK we may compute the result value without knowing the
* operand, based on type inference information. Make sure the operand is
+31 -6
View File
@@ -432,7 +432,7 @@ static zend_always_inline zend_string *accel_find_interned_string(zend_string *s
if (!ZCG(counted)) {
if (!ZCG(accelerator_enabled) || accel_activate_add() == FAILURE) {
return str;
return NULL;
}
ZCG(counted) = 1;
}
@@ -754,10 +754,9 @@ static void accel_use_shm_interned_strings(void)
if (ZCSG(interned_strings).saved_top == NULL) {
accel_copy_permanent_strings(accel_new_interned_string);
} else {
ZCG(counted) = 1;
accel_copy_permanent_strings(accel_replace_string_by_shm_permanent);
if (ZCG(counted)) {
accel_deactivate_sub();
}
ZCG(counted) = 0;
}
accel_interned_strings_save_state();
@@ -1187,7 +1186,11 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
cwd_len = ZCG(cwd_key_len) = buf + sizeof(buf) - 1 - res;
cwd = ZCG(cwd_key);
memcpy(ZCG(cwd_key), res, cwd_len + 1);
} else {
return NULL;
}
} else {
return NULL;
}
}
}
@@ -1226,7 +1229,11 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
include_path_len = ZCG(include_path_key_len) = buf + sizeof(buf) - 1 - res;
include_path = ZCG(include_path_key);
memcpy(ZCG(include_path_key), res, include_path_len + 1);
} else {
return NULL;
}
} else {
return NULL;
}
}
}
@@ -1907,11 +1914,22 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
int key_length;
int from_shared_memory; /* if the script we've got is stored in SHM */
if (!file_handle->filename || !ZCG(enabled) || !accel_startup_ok) {
if (!file_handle->filename || !ZCG(accelerator_enabled)) {
/* The Accelerator is disabled, act as if without the Accelerator */
ZCG(cache_opline) = NULL;
ZCG(cache_persistent_script) = NULL;
#ifdef HAVE_OPCACHE_FILE_CACHE
if (file_handle->filename
&& ZCG(accel_directives).file_cache
&& ZCG(enabled) && accel_startup_ok) {
return file_cache_compile_file(file_handle, type);
}
#endif
return accelerator_orig_compile_file(file_handle, type);
#ifdef HAVE_OPCACHE_FILE_CACHE
} else if (file_cache_only) {
ZCG(cache_opline) = NULL;
ZCG(cache_persistent_script) = NULL;
return file_cache_compile_file(file_handle, type);
#endif
} else if (!ZCG(accelerator_enabled) ||
@@ -1921,6 +1939,8 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
return file_cache_compile_file(file_handle, type);
}
#endif
ZCG(cache_opline) = NULL;
ZCG(cache_persistent_script) = NULL;
return accelerator_orig_compile_file(file_handle, type);
}
@@ -1947,10 +1967,14 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
/* try to find cached script by key */
key = accel_make_persistent_key(file_handle->filename, strlen(file_handle->filename), &key_length);
if (!key) {
ZCG(cache_opline) = NULL;
ZCG(cache_persistent_script) = NULL;
return accelerator_orig_compile_file(file_handle, type);
}
persistent_script = zend_accel_hash_str_find(&ZCSG(hash), key, key_length);
} else if (UNEXPECTED(is_stream_path(file_handle->filename) && !is_cacheable_stream_path(file_handle->filename))) {
ZCG(cache_opline) = NULL;
ZCG(cache_persistent_script) = NULL;
return accelerator_orig_compile_file(file_handle, type);
}
@@ -2315,6 +2339,7 @@ static void accel_reset_pcre_cache(void)
static void accel_activate(void)
{
if (!ZCG(enabled) || !accel_startup_ok) {
ZCG(accelerator_enabled) = 0;
return;
}
@@ -2342,6 +2367,7 @@ static void accel_activate(void)
#ifdef HAVE_OPCACHE_FILE_CACHE
if (file_cache_only) {
ZCG(accelerator_enabled) = 0;
return;
}
#endif
@@ -2360,7 +2386,6 @@ static void accel_activate(void)
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");
ZCG(accelerator_enabled) = 0;
return;
}
}
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #78106: Path resolution fails if opcache disabled during request
--FILE--
<?php
include __DIR__ . "/php_cli_server.inc";
php_cli_server_start(getenv('TEST_PHP_EXTRA_ARGS'));
echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/bug78106_test1.php" );
echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/bug78106_test2.php" );
echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/bug78106_test1.php" );
?>
--EXPECT--
included
done
included
done
included
done
+3
View File
@@ -0,0 +1,3 @@
<?php
echo "included\n";
+6
View File
@@ -0,0 +1,6 @@
<?php
ini_set('opcache.enable', 0);
require_once 'bug78106_include.inc';
echo "done\n";
+5
View File
@@ -0,0 +1,5 @@
<?php
require_once 'bug78106_include.inc';
echo "done\n";
+37
View File
@@ -0,0 +1,37 @@
--TEST--
Bug #78185: file cache only no longer works
--INI--
opcache.enable_cli=1
opcache.optimization_level=-1
opcache.file_cache={PWD}
opcache.file_cache_only=1
--FILE--
<?php
if (substr(PHP_OS, 0, 3) !== 'WIN') {
$pattern = __DIR__ . '/*/' . __DIR__ . '/*78185.php.bin';
} else {
$pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*78185.php.bin';
}
foreach (glob($pattern) as $p) {
var_dump($p);
}
?>
--CLEAN--
<?php
if (substr(PHP_OS, 0, 3) !== 'WIN') {
$pattern = __DIR__ . '/*/' . __DIR__ . '/*78185.php.bin';
} else {
$pattern = __DIR__ . '/*/*/' . str_replace(':', '', __DIR__) . '/*78185.php.bin';
}
foreach (glob($pattern) as $p) {
unlink($p);
$p = dirname($p);
while(strlen($p) > strlen(__DIR__)) {
rmdir($p);
$p = dirname($p);
}
}
?>
--EXPECTF--
string(%d) "%s78185.php.bin"
+29
View File
@@ -0,0 +1,29 @@
--TEST--
Bug #78230: Incorrect type check optimization
--FILE--
<?php
function test($x) {
$y = (array) $x;
var_dump(is_array($y));
}
$ary = [1, 2];
$ary[] = 3;
test($ary);
$ary[] = 4;
var_dump($ary);
?>
--EXPECT--
bool(true)
array(4) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
}
+1
View File
@@ -240,6 +240,7 @@ static ZEND_INI_MH(OnEnable)
return FAILURE;
} else {
*p = 0;
ZCG(accelerator_enabled) = 0;
return SUCCESS;
}
}
+2 -2
View File
@@ -3,6 +3,6 @@
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 3
#define PHP_RELEASE_VERSION 7
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.3.7-dev"
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.3.7"
#define PHP_VERSION_ID 70307
+3 -1
View File
@@ -818,7 +818,7 @@ HELP;
if (substr(PHP_OS, 0, 3) == "WIN") {
$pass_options .= " -c " . escapeshellarg($conf_passed);
} else {
$pass_options .= " -c '$conf_passed'";
$pass_options .= " -c '" . realpath($conf_passed) . "'";
}
}
@@ -1600,6 +1600,8 @@ TEST $file
settings2params($ini_settings);
$env['TEST_PHP_EXTRA_ARGS'] = $pass_options . ' ' . $ini_settings;
// Check if test should be skipped.
$info = '';
$warn = false;