summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-07-01 17:28:01 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-01 17:28:01 +0200
commit9ab5c28c8b35b230cf5e838d1e404e0f30f05737 (patch)
tree3a37fbc1b0af76dfd928aa478c478481a9d5f004
parent017e2939927ae4a9f1b27da08aeb0d7d445ce4d6 (diff)
parent0dfca74be21125ae5a6e5735b8b52adc8825d6e7 (diff)
downloadphp-git-9ab5c28c8b35b230cf5e838d1e404e0f30f05737.tar.gz
Merge branch 'PHP-7.4'
-rw-r--r--Zend/tests/runtime_compile_time_binary_operands.phpt11
-rw-r--r--azure-pipelines.yml5
-rw-r--r--azure/apt.yml1
-rw-r--r--azure/msan_job.yml76
-rw-r--r--azure/test.yml1
-rw-r--r--ext/fileinfo/tests/cve-2014-3538-mb.phpt3
-rw-r--r--ext/fileinfo/tests/cve-2014-3538.phpt3
7 files changed, 96 insertions, 4 deletions
diff --git a/Zend/tests/runtime_compile_time_binary_operands.phpt b/Zend/tests/runtime_compile_time_binary_operands.phpt
index 897ce3e1a5..afced7af0c 100644
--- a/Zend/tests/runtime_compile_time_binary_operands.phpt
+++ b/Zend/tests/runtime_compile_time_binary_operands.phpt
@@ -108,16 +108,16 @@ function prepareLine($op1, $op2, $cmp, $operator) {
$error = "echo '" . addcslashes("$op1_p $operator $op2_p", "\\'") . '\', "\n"; $f++;';
$compare = "@($op1_p $operator $op2_p)";
- $line = "\$c++; try { ";
+ $line = "\$c++; ";
try {
$result = makeParam($cmp());
- $line .= "if (" . ($result === "(NAN)" ? "!is_nan($compare)" : "$compare !== $result") . ") { $error } } catch (Error \$e) { $error }";
+ $line .= "if (" . ($result === "(NAN)" ? "!is_nan($compare)" : "$compare !== $result") . ") { $error }";
} catch (Error $e) {
if (get_class($e) == "Error") {
return "// exempt $op1_p $operator $op2_p from checking, it generates a compile time error";
}
$msg = makeParam($e->getMessage());
- $line .= "$compare; $error } catch (Error \$e) { if (\$e->getMessage() !== $msg) { $error } }";
+ $line .= "try { $compare; $error } catch (Error \$e) { if (\$e->getMessage() !== $msg) { $error } }";
}
return $line;
}
@@ -130,7 +130,10 @@ fwrite($file, "<?php\n");
foreach ($input as $left) {
foreach ($input as $right) {
foreach ($operands as $operand) {
- fwrite($file, prepareLine($left, $right, function() use ($left, $right, $operand) { return eval("return @(\$left $operand \$right);"); }, $operand) . "\n");
+ $line = prepareLine($left, $right, function() use ($left, $right, $operand) {
+ return eval("return @(\$left $operand \$right);");
+ }, $operand);
+ fwrite($file, $line . "\n");
}
}
}
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 7f03f3f9ff..915b743658 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -64,3 +64,8 @@ jobs:
LDFLAGS='-fsanitize=undefined,address'
runTestsParameters: --asan
timeoutInMinutes: 150
+ - template: azure/msan_job.yml
+ parameters:
+ configurationName: DEBUG_ZTS_MSAN
+ configurationParameters: '--enable-debug --enable-maintainer-zts'
+ runTestsParameters: --asan
diff --git a/azure/apt.yml b/azure/apt.yml
index 843ae1daf1..5c0a9a0c55 100644
--- a/azure/apt.yml
+++ b/azure/apt.yml
@@ -34,5 +34,6 @@ steps:
libargon2-0-dev \
postgresql \
postgresql-contrib \
+ llvm \
${{ parameters.packages }}
displayName: 'APT'
diff --git a/azure/msan_job.yml b/azure/msan_job.yml
new file mode 100644
index 0000000000..bae65e018e
--- /dev/null
+++ b/azure/msan_job.yml
@@ -0,0 +1,76 @@
+parameters:
+ configurationName: ''
+ configurationParameters: ''
+ runTestsParameters: ''
+ timeoutInMinutes: 60
+
+jobs:
+ - job: ${{ parameters.configurationName }}
+ timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
+ pool:
+ vmImage: 'ubuntu-latest'
+ steps:
+ - template: apt.yml
+ - script: |
+ export CC=clang
+ export CXX=clang++
+ export CFLAGS="-fsanitize=memory -DZEND_TRACK_ARENA_ALLOC"
+ export LDFLAGS="-fsanitize=memory"
+ ./buildconf --force
+ # msan requires all used libraries to be instrumented,
+ # so we should avoiding linking against anything but libc here
+ ./configure ${{ parameters.configurationParameters }} \
+ --prefix=/usr \
+ --without-sqlite3 \
+ --without-pdo-sqlite \
+ --without-libxml \
+ --disable-dom \
+ --disable-simplexml \
+ --disable-xml \
+ --disable-xmlreader \
+ --disable-xmlwriter \
+ --without-pcre-jit \
+ --enable-phpdbg \
+ --enable-fpm \
+ --with-pdo-mysql=mysqlnd \
+ --with-mysqli=mysqlnd \
+ --without-pear \
+ --enable-exif \
+ --enable-sysvsem \
+ --enable-sysvshm \
+ --enable-shmop \
+ --enable-pcntl \
+ --enable-mbstring \
+ --disable-mbregex \
+ --enable-sockets \
+ --enable-bcmath \
+ --enable-calendar \
+ --enable-ftp \
+ --enable-zend-test \
+ --enable-werror \
+ --with-config-file-path=/etc \
+ --with-config-file-scan-dir=/etc/php.d
+ displayName: 'Configure Build'
+ - script: make -j$(/usr/bin/nproc) >/dev/null
+ displayName: 'Make Build'
+ - script: |
+ sudo make install
+ sudo mkdir /etc/php.d
+ sudo chmod 777 /etc/php.d
+ echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
+ echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
+ displayName: 'Install Build'
+ - script: |
+ mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
+ displayName: 'Setup'
+ - template: test.yml
+ parameters:
+ configurationName: ${{ parameters.configurationName }}
+ runTestsParameters: ${{ parameters.runTestsParameters }}
+ - template: test.yml
+ parameters:
+ configurationName: ${{ parameters.configurationName }}
+ runTestsName: 'OpCache'
+ runTestsParameters: >-
+ ${{ parameters.runTestsParameters }}
+ -d zend_extension=opcache.so -d opcache.enable_cli=1
diff --git a/azure/test.yml b/azure/test.yml
index 9821010f11..3f6963c706 100644
--- a/azure/test.yml
+++ b/azure/test.yml
@@ -12,6 +12,7 @@ steps:
export TEST_PHP_JUNIT=junit.xml
export REPORT_EXIT_STATUS=no
export SKIP_IO_CAPTURE_TESTS=1
+ export MSAN_SYMBOLIZER_PATH=/usr/lib/llvm-3.8/bin/llvm-symbolizer
rm -rf junit.xml | true
php run-tests.php -P -q \
-j$(/usr/bin/nproc) \
diff --git a/ext/fileinfo/tests/cve-2014-3538-mb.phpt b/ext/fileinfo/tests/cve-2014-3538-mb.phpt
index e462093fb1..cc9084dc79 100644
--- a/ext/fileinfo/tests/cve-2014-3538-mb.phpt
+++ b/ext/fileinfo/tests/cve-2014-3538-mb.phpt
@@ -4,6 +4,9 @@ Bug #66731: file: extensive backtraking
<?php
if (!class_exists('finfo'))
die('skip no fileinfo extension');
+if (getenv('SKIP_PERF_SENSITIVE'))
+ die("skip performance sensitive test");
+?>
--FILE--
<?php
$fd = __DIR__.'/cve-2014-3538私はガラスを食べられます.data';
diff --git a/ext/fileinfo/tests/cve-2014-3538.phpt b/ext/fileinfo/tests/cve-2014-3538.phpt
index 7014629f37..718457442a 100644
--- a/ext/fileinfo/tests/cve-2014-3538.phpt
+++ b/ext/fileinfo/tests/cve-2014-3538.phpt
@@ -4,6 +4,9 @@ Bug #66731: file: extensive backtraking
<?php
if (!class_exists('finfo'))
die('skip no fileinfo extension');
+if (getenv('SKIP_PERF_SENSITIVE'))
+ die("skip performance sensitive test");
+?>
--FILE--
<?php
$fd = __DIR__.'/cve-2014-3538.data';