From: Nikita Popov Date: Thu, 20 Jun 2019 14:51:14 +0000 (+0200) Subject: Set up asan+ubsan scheduled build on azure X-Git-Tag: php-7.4.0alpha3~135 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54dd762f596d4b0ea97d6d10e9d0c96e0f33e76e;p=php Set up asan+ubsan scheduled build on azure Also adds an --asan flag to run-tests.php to setup all the necessary environment variables. Some tests are marked as skipped because they are incompatible with asan or too slow. I'm basing this on the DEBUG_ZTS build, which seems to give us the most mileage. --- diff --git a/Zend/tests/concat_003.phpt b/Zend/tests/concat_003.phpt index 13c6fdc087..dc22bae1a7 100644 --- a/Zend/tests/concat_003.phpt +++ b/Zend/tests/concat_003.phpt @@ -1,7 +1,10 @@ --TEST-- Concatenating many small strings should not slowdown allocations --SKIPIF-- - + --FILE-- - + --enable-debug --enable-maintainer-zts + CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC' + LDFLAGS='-fsanitize=undefined,address' + runTestsParameters: --asan + timeoutInMinutes: 120 diff --git a/azure/job.yml b/azure/job.yml index a7267f11c3..646faed755 100644 --- a/azure/job.yml +++ b/azure/job.yml @@ -1,9 +1,12 @@ parameters: configurationName: '' configurationParameters: '' + runTestsParameters: '' + timeoutInMinutes: 60 jobs: - job: ${{ parameters.configurationName }} + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} pool: vmImage: 'ubuntu-latest' steps: @@ -80,8 +83,11 @@ jobs: - template: test.yml parameters: configurationName: ${{ parameters.configurationName }} + runTestsParameters: ${{ parameters.runTestsParameters }} - template: test.yml parameters: configurationName: ${{ parameters.configurationName }} runTestsName: 'OpCache' - runTestsParameters: -d zend_extension=opcache.so -d opcache.enable_cli=1 + runTestsParameters: >- + ${{ parameters.runTestsParameters }} + -d zend_extension=opcache.so -d opcache.enable_cli=1 diff --git a/azure/lsan-suppressions.txt b/azure/lsan-suppressions.txt new file mode 100644 index 0000000000..5c2ee76e46 --- /dev/null +++ b/azure/lsan-suppressions.txt @@ -0,0 +1 @@ +leak:acommon::DictInfoList::elements diff --git a/ext/fileinfo/tests/cve-2014-3538-nojit.phpt b/ext/fileinfo/tests/cve-2014-3538-nojit.phpt index 2dc5ddbc5e..0072ab2047 100644 --- a/ext/fileinfo/tests/cve-2014-3538-nojit.phpt +++ b/ext/fileinfo/tests/cve-2014-3538-nojit.phpt @@ -4,6 +4,8 @@ Bug #66731: file: extensive backtraking, with pcre.jit=0 diff --git a/ext/opcache/tests/log_verbosity_bug.phpt b/ext/opcache/tests/log_verbosity_bug.phpt index e23bb8758f..a2c2f4f30a 100644 --- a/ext/opcache/tests/log_verbosity_bug.phpt +++ b/ext/opcache/tests/log_verbosity_bug.phpt @@ -12,7 +12,10 @@ opcache.file_cache_fallback=0 opcache.memory_consumption=999999999 opcache.log_verbosity_level=-1 --SKIPIF-- - + --FILE-- + --FILE-- --FILE-- --FILE-- --FILE-- + --FILE-- --FILE-- --FILE-- --INI-- opcache.optimization_level=0 diff --git a/sapi/phpdbg/tests/watch_002.phpt b/sapi/phpdbg/tests/watch_002.phpt index 52336c08d0..ba2cad1abe 100644 --- a/sapi/phpdbg/tests/watch_002.phpt +++ b/sapi/phpdbg/tests/watch_002.phpt @@ -5,6 +5,9 @@ Test simple array watchpoint with replace if (PHP_INT_SIZE == 4) { die("xfail There may be flaws in the implementation of watchpoints that cause failures"); } +if (getenv('SKIP_ASAN')) { + die("skip intentionally causes segfaults"); +} ?> --PHPDBG-- b 6 diff --git a/sapi/phpdbg/tests/watch_003.phpt b/sapi/phpdbg/tests/watch_003.phpt index e054b6f324..ab6dc317a8 100644 --- a/sapi/phpdbg/tests/watch_003.phpt +++ b/sapi/phpdbg/tests/watch_003.phpt @@ -5,6 +5,9 @@ Test simple watchpoint with replace if (PHP_INT_SIZE == 4) { die("xfail There may be flaws in the implementation of watchpoints that cause failures"); } +if (getenv('SKIP_ASAN')) { + die("skip intentionally causes segfaults"); +} ?> --PHPDBG-- b 6 diff --git a/sapi/phpdbg/tests/watch_004.phpt b/sapi/phpdbg/tests/watch_004.phpt index dcb37a4959..42e3fd3b26 100644 --- a/sapi/phpdbg/tests/watch_004.phpt +++ b/sapi/phpdbg/tests/watch_004.phpt @@ -5,6 +5,9 @@ Test detection of inline string manipulations on zval watch if (PHP_INT_SIZE == 4) { die("xfail There may be flaws in the implementation of watchpoints that cause failures"); } +if (getenv('SKIP_ASAN')) { + die("skip intentionally causes segfaults"); +} ?> --INI-- opcache.optimization_level=0 diff --git a/sapi/phpdbg/tests/watch_005.phpt b/sapi/phpdbg/tests/watch_005.phpt index 0bd44c9a01..aacc158f61 100644 --- a/sapi/phpdbg/tests/watch_005.phpt +++ b/sapi/phpdbg/tests/watch_005.phpt @@ -5,6 +5,9 @@ Test proper watch comparisons when having multiple levels of indirection from a if (PHP_INT_SIZE == 4) { die("xfail There may be flaws in the implementation of watchpoints that cause failures"); } +if (getenv('SKIP_ASAN')) { + die("skip intentionally causes segfaults"); +} ?> --PHPDBG-- b 3 diff --git a/sapi/phpdbg/tests/watch_006.phpt b/sapi/phpdbg/tests/watch_006.phpt index fa292005a4..5b5ca9ee57 100644 --- a/sapi/phpdbg/tests/watch_006.phpt +++ b/sapi/phpdbg/tests/watch_006.phpt @@ -5,6 +5,9 @@ Test multiple watch elements pointing to the same watchpoint if (PHP_INT_SIZE == 4) { die("xfail There may be flaws in the implementation of watchpoints that cause failures"); } +if (getenv('SKIP_ASAN')) { + die("skip intentionally causes segfaults"); +} ?> --PHPDBG-- b 4