From fc9266a5fc6cbae6c2157300c8cf1d9185d491dd Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 7 Aug 2023 12:44:53 +0200 Subject: [PATCH] Move ASAN built to GitHub actions Cirrus will no longer offer unlimited free builds starting next month. We don't have an alternative for FreeBSD and ARM, so move what we can for now. Closes GH-11898 --- .cirrus.yml | 180 ------------------ .github/actions/apt-x64/action.yml | 1 + .github/actions/configure-x64/action.yml | 37 ++-- .github/actions/install-linux/action.yml | 8 +- .github/workflows/push.yml | 22 ++- Zend/tests/bug78010.phpt | 4 + ext/mysqli/tests/mysqli_fetch_all.phpt | 1 + .../tests/mysqli_fetch_array_many_rows.phpt | 1 + .../mysqli_mysqlnd_read_timeout_long.phpt | 1 + ext/mysqli/tests/mysqli_stmt_bind_limits.phpt | 1 + .../tests/mysqli_stmt_send_long_data.phpt | 1 + .../tests/cache_list/frontcontroller1.phpt | 4 + .../tests/cache_list/frontcontroller21.phpt | 4 + .../tests/cache_list/frontcontroller22.phpt | 4 + .../tests/cache_list/frontcontroller23.phpt | 4 + .../tests/cache_list/frontcontroller31.phpt | 4 + .../tests/cache_list/frontcontroller32.phpt | 4 + .../tests/cache_list/frontcontroller33.phpt | 4 + .../tests/cache_list/frontcontroller34.phpt | 4 + ext/standard/tests/file/bug22414.phpt | 4 + ext/zlib/tests/bug67724.phpt | 4 + 21 files changed, 91 insertions(+), 206 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 28c0a825912..a5910b78213 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,186 +1,6 @@ env: CIRRUS_CLONE_DEPTH: 1 -asan_task: - name: ASAN_DEBUG_NTS - container: - image: gcc:latest - additional_containers: - - name: mysql - image: mysql:8 - port: 3306 - cpu: 1.0 - memory: 1G - env: - MYSQL_ROOT_PASSWORD: "root" - MYSQL_DATABASE: "test" - install_script: - - apt-get update -y - - >- - apt-get install -y - bison - re2c - locales - locales-all - `#ldap-utils` - openssl - `slapd` - libgmp-dev - libicu-dev - `#libtidy-dev` - `#libenchant-dev` - libaspell-dev - libpspell-dev - libsasl2-dev - libxpm-dev - libzip-dev - `#libsqlite3-dev` - libwebp-dev - libonig-dev - libkrb5-dev - libgssapi-krb5-2 - libcurl4-openssl-dev - libxml2-dev - libxslt1-dev - libpq-dev - libreadline-dev - `#libldap2-dev` - libsodium-dev - libargon2-0-dev - libmm-dev - `#libsnmp-dev` - `#postgresql` - `#postgresql-contrib` - `#snmpd` - `#snmp-mibs-downloader` - `#freetds-dev` - `#unixodbc-dev` - llvm - clang - libc-client-dev - dovecot-core - dovecot-pop3d - dovecot-imapd - `#sendmail` - `#firebird-dev` - liblmdb-dev - libtokyocabinet-dev - libdb-dev - libqdbm-dev - libjpeg-dev - libpng-dev - libfreetype6-dev - build_script: - - ./buildconf -f - - >- - ./configure - --enable-debug - --enable-zts - --enable-option-checking=fatal - --prefix=/usr - --enable-phpdbg - --enable-fpm - --enable-opcache - --disable-opcache-jit - --with-pdo-mysql=mysqlnd - --with-mysqli=mysqlnd - `#--with-pgsql` - `#--with-pdo-pgsql` - `#--with-pdo-sqlite` - --enable-intl - --without-pear - --enable-gd - --with-jpeg - --with-webp - --with-freetype - --with-xpm - --enable-exif - --with-zip - --with-zlib - --with-zlib-dir=/usr - --enable-soap - --enable-xmlreader - --with-xsl - `#--with-tidy` - --enable-sysvsem - --enable-sysvshm - --enable-shmop - --enable-pcntl - --with-readline - --enable-mbstring - --with-curl - --with-gettext - --enable-sockets - --with-bz2 - --with-openssl - --with-gmp - --enable-bcmath - --enable-calendar - --enable-ftp - --with-pspell=/usr - `#--with-enchant=/usr` - --with-kerberos - --enable-sysvmsg - --with-ffi - --enable-zend-test - `#--enable-dl-test=shared` - `#--with-ldap` - `#--with-ldap-sasl` - --with-password-argon2 - --with-mhash - --with-sodium - --enable-dba - --with-cdb - --enable-flatfile - --enable-inifile - --with-tcadb - --with-lmdb - --with-qdbm - `#--with-snmp` - `#--with-unixODBC` - `#--with-imap` - --with-kerberos - --with-imap-ssl - `#--with-pdo-odbc=unixODBC,/usr` - `#--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient` - `#--with-oci8=shared,instantclient,/opt/oracle/instantclient` - --with-config-file-path=/etc - --with-config-file-scan-dir=/etc/php.d - `#--with-pdo-firebird` - `#--with-pdo-dblib` - --enable-werror - CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address' - CC=clang - CXX=clang++ - - make -j2 - - make install - - mkdir -p /etc/php.d - - echo opcache.enable_cli=1 > /etc/php.d/opcache.ini - - echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini - # Specify opcache.preload_user as we're running as root. - - echo opcache.preload_user=root >> /etc/php.d/opcache.ini - tests_script: - - export SKIP_IO_CAPTURE_TESTS=1 - - export CI_NO_IPV6=1 - - export MYSQL_TEST_HOST=127.0.0.1 - - export MYSQL_TEST_USER=root - - export MYSQL_TEST_PASSWD=root - - export PDO_MYSQL_TEST_DSN="mysql:host=127.0.0.1;dbname=test" - - export PDO_MYSQL_TEST_USER=root - - export PDO_MYSQL_TEST_PASS=root - - >- - sapi/cli/php run-tests.php - -P -q -x -j2 - -g FAIL,BORK,LEAK,XLEAK - --no-progress - --offline - --show-diff - --show-slow 1000 - --set-timeout 120 - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - --asan - freebsd_task: name: FREEBSD_DEBUG_NTS freebsd_instance: diff --git a/.github/actions/apt-x64/action.yml b/.github/actions/apt-x64/action.yml index 621b18532e0..704388fee8c 100644 --- a/.github/actions/apt-x64/action.yml +++ b/.github/actions/apt-x64/action.yml @@ -46,6 +46,7 @@ runs: freetds-dev \ unixodbc-dev \ llvm \ + clang \ libc-client-dev \ dovecot-core \ dovecot-pop3d \ diff --git a/.github/actions/configure-x64/action.yml b/.github/actions/configure-x64/action.yml index ee802334490..6011a87e487 100644 --- a/.github/actions/configure-x64/action.yml +++ b/.github/actions/configure-x64/action.yml @@ -3,6 +3,9 @@ inputs: configurationParameters: default: '' required: false + skipSlow: + default: false + required: false runs: using: composite steps: @@ -17,9 +20,9 @@ runs: --enable-fpm \ --with-pdo-mysql=mysqlnd \ --with-mysqli=mysqlnd \ - --with-pgsql \ - --with-pdo-pgsql \ - --with-pdo-sqlite \ + ${{ inputs.skipSlow == 'false' && '--with-pgsql' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-pgsql' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-sqlite' || '' }} \ --enable-intl \ --without-pear \ --enable-gd \ @@ -34,7 +37,7 @@ runs: --enable-soap \ --enable-xmlreader \ --with-xsl \ - --with-tidy \ + ${{ inputs.skipSlow == 'false' && '--with-tidy' || '' }} \ --enable-sysvsem \ --enable-sysvshm \ --enable-shmop \ @@ -51,14 +54,14 @@ runs: --enable-calendar \ --enable-ftp \ --with-pspell=/usr \ - --with-enchant=/usr \ + ${{ inputs.skipSlow == 'false' && '--with-enchant=/usr' || '' }} \ --with-kerberos \ --enable-sysvmsg \ --with-ffi \ --enable-zend-test \ - --enable-dl-test=shared \ - --with-ldap \ - --with-ldap-sasl \ + ${{ inputs.skipSlow == 'false' && '--enable-dl-test=shared' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-ldap' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-ldap-sasl' || '' }} \ --with-password-argon2 \ --with-mhash \ --with-sodium \ @@ -69,16 +72,16 @@ runs: --with-tcadb \ --with-lmdb \ --with-qdbm \ - --with-snmp \ - --with-unixODBC \ - --with-imap \ - --with-imap-ssl \ - --with-pdo-odbc=unixODBC,/usr \ - --with-pdo-oci=shared,instantclient,/opt/oracle/instantclient \ - --with-oci8=shared,instantclient,/opt/oracle/instantclient \ + ${{ inputs.skipSlow == 'false' && '--with-snmp' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-unixODBC' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-imap' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-imap-ssl' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-oci8=shared,instantclient,/opt/oracle/instantclient' || '' }} \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ - --with-pdo-firebird \ - --with-pdo-dblib \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-firebird' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-dblib' || '' }} \ --enable-werror \ ${{ inputs.configurationParameters }} diff --git a/.github/actions/install-linux/action.yml b/.github/actions/install-linux/action.yml index 7ac2ae4c4fc..d2f7ea23b2e 100644 --- a/.github/actions/install-linux/action.yml +++ b/.github/actions/install-linux/action.yml @@ -1,4 +1,8 @@ name: Install +inputs: + withOci: + default: true + required: false runs: using: composite steps: @@ -10,5 +14,5 @@ runs: 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 - echo extension=oci8.so > /etc/php.d/oci8.ini - echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini + ${{ inputs.withOci == 'true' && 'echo extension=oci8.so > /etc/php.d/oci8.ini' || '' }} + ${{ inputs.withOci == 'true' && 'echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini' || '' }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 99430f97e62..a8edf9c1126 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -47,11 +47,13 @@ jobs: fail-fast: false matrix: include: - - debug: true - zts: false - debug: false + zts: false + asan: false + - debug: true zts: true - name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" + asan: true + name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}" runs-on: ubuntu-22.04 steps: - name: git checkout @@ -70,7 +72,7 @@ jobs: # This duplicates the "job.name" expression above because # GitHub has no way to query the job name (github.job is the # job id, not the job name) - key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}-${{hashFiles('main/php_version.h')}}" + key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}" append-timestamp: false - name: ./configure uses: ./.github/actions/configure-x64 @@ -78,24 +80,30 @@ jobs: configurationParameters: >- --${{ matrix.debug && 'enable' || 'disable' }}-debug --${{ matrix.zts && 'enable' || 'disable' }}-zts + ${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address" CC=clang CXX=clang++ --disable-opcache-jit' || '' }} + skipSlow: ${{ matrix.asan }} - name: make run: make -j$(/usr/bin/nproc) >/dev/null - name: make install uses: ./.github/actions/install-linux + with: + withOci: ${{ !matrix.asan }} - name: Setup uses: ./.github/actions/setup-x64 - name: Test + if: matrix.asan == false uses: ./.github/actions/test-linux with: testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} - - name: Test Tracing JIT + - name: Test ${{ matrix.asan && 'OpCache' || 'Tracing JIT' }} uses: ./.github/actions/test-linux with: - testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT + testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}_${{ matrix.asan && 'OpCache' || 'Tracing JIT' }} runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 - -d opcache.jit_buffer_size=16M + ${{ !matrix.asan && '-d opcache.jit_buffer_size=16M' || '' }} + ${{ matrix.asan && '--asan -x' || '' }} - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files LINUX_X32: diff --git a/Zend/tests/bug78010.phpt b/Zend/tests/bug78010.phpt index 82334e78a25..6b266b77b66 100644 --- a/Zend/tests/bug78010.phpt +++ b/Zend/tests/bug78010.phpt @@ -1,5 +1,9 @@ --TEST-- Bug #78010: Segmentation fault during GC +--SKIPIF-- + --INI-- memory_limit=2G --FILE-- diff --git a/ext/mysqli/tests/mysqli_fetch_all.phpt b/ext/mysqli/tests/mysqli_fetch_all.phpt index 0ab9585e1c1..75d26f617b4 100644 --- a/ext/mysqli/tests/mysqli_fetch_all.phpt +++ b/ext/mysqli/tests/mysqli_fetch_all.phpt @@ -4,6 +4,7 @@ mysqli_fetch_all() mysqli --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt b/ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt index ebdf30d439b..4650475e733 100644 --- a/ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt +++ b/ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt @@ -4,6 +4,7 @@ mysqli_fetch_array() mysqli --SKIPIF-- --FILE-- diff --git a/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt b/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt index 0af0cb7a0ce..f568941b57f 100644 --- a/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt +++ b/ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt @@ -4,6 +4,7 @@ mysqlnd.net_read_timeout > default_socket_timeout mysqli --SKIPIF-- --CONFLICTS-- diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt index da6572d5b8f..cc4a9272709 100644 --- a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt +++ b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt @@ -4,6 +4,7 @@ mysqli_stmt_send_long_data() mysqli --SKIPIF-- --FILE-- diff --git a/ext/phar/tests/cache_list/frontcontroller1.phpt b/ext/phar/tests/cache_list/frontcontroller1.phpt index e912362205d..fc8ec38f127 100644 --- a/ext/phar/tests/cache_list/frontcontroller1.phpt +++ b/ext/phar/tests/cache_list/frontcontroller1.phpt @@ -4,6 +4,10 @@ Phar front controller other phar.cache_list={PWD}/frontcontroller1.php [cache_list] --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller1.php REQUEST_URI=/frontcontroller1.php/a.jpg diff --git a/ext/phar/tests/cache_list/frontcontroller21.phpt b/ext/phar/tests/cache_list/frontcontroller21.phpt index c86e8a741e6..5b212747fb7 100644 --- a/ext/phar/tests/cache_list/frontcontroller21.phpt +++ b/ext/phar/tests/cache_list/frontcontroller21.phpt @@ -6,6 +6,10 @@ phar.cache_list={PWD}/frontcontroller21.php cgi.fix_pathinfo=1 --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller21.php REQUEST_URI=/frontcontroller21.php/index.php?test=hi diff --git a/ext/phar/tests/cache_list/frontcontroller22.phpt b/ext/phar/tests/cache_list/frontcontroller22.phpt index 520ecb3c4af..6747da6dc79 100644 --- a/ext/phar/tests/cache_list/frontcontroller22.phpt +++ b/ext/phar/tests/cache_list/frontcontroller22.phpt @@ -5,6 +5,10 @@ default_charset=UTF-8 phar.cache_list={PWD}/frontcontroller22.phpt --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller22.php REQUEST_URI=/frontcontroller22.php/index.php diff --git a/ext/phar/tests/cache_list/frontcontroller23.phpt b/ext/phar/tests/cache_list/frontcontroller23.phpt index 5a6ce18f403..85f78a49800 100644 --- a/ext/phar/tests/cache_list/frontcontroller23.phpt +++ b/ext/phar/tests/cache_list/frontcontroller23.phpt @@ -5,6 +5,10 @@ default_charset=UTF-8 phar.cache_list={PWD}/frontcontroller23.php --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller23.php REQUEST_URI=/frontcontroller23.php/hi/there diff --git a/ext/phar/tests/cache_list/frontcontroller31.phpt b/ext/phar/tests/cache_list/frontcontroller31.phpt index 106ad17db75..9feed05344e 100644 --- a/ext/phar/tests/cache_list/frontcontroller31.phpt +++ b/ext/phar/tests/cache_list/frontcontroller31.phpt @@ -5,6 +5,10 @@ default_charset=UTF-8 phar.cache_list={PWD}/frontcontroller31.php --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller31.php REQUEST_URI=/frontcontroller31.php diff --git a/ext/phar/tests/cache_list/frontcontroller32.phpt b/ext/phar/tests/cache_list/frontcontroller32.phpt index 6db3573041d..a61c91e1be2 100644 --- a/ext/phar/tests/cache_list/frontcontroller32.phpt +++ b/ext/phar/tests/cache_list/frontcontroller32.phpt @@ -5,6 +5,10 @@ default_charset=UTF-8 phar.cache_list={PWD}/frontcontroller32.php --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller32.php REQUEST_URI=/frontcontroller32.php diff --git a/ext/phar/tests/cache_list/frontcontroller33.phpt b/ext/phar/tests/cache_list/frontcontroller33.phpt index 1036fc2c46a..1b0684bc2fc 100644 --- a/ext/phar/tests/cache_list/frontcontroller33.phpt +++ b/ext/phar/tests/cache_list/frontcontroller33.phpt @@ -5,6 +5,10 @@ default_charset=UTF-8 phar.cache_list={PWD}/frontcontroller33.php --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller33.php REQUEST_URI=/frontcontroller33.php diff --git a/ext/phar/tests/cache_list/frontcontroller34.phpt b/ext/phar/tests/cache_list/frontcontroller34.phpt index b4916f17618..d3c02214b2e 100644 --- a/ext/phar/tests/cache_list/frontcontroller34.phpt +++ b/ext/phar/tests/cache_list/frontcontroller34.phpt @@ -5,6 +5,10 @@ default_charset=UTF-8 phar.cache_list={PWD}/frontcontroller34.php --EXTENSIONS-- phar +--SKIPIF-- + --ENV-- SCRIPT_NAME=/frontcontroller34.php REQUEST_URI=/frontcontroller34.php/start/index.php diff --git a/ext/standard/tests/file/bug22414.phpt b/ext/standard/tests/file/bug22414.phpt index 49ac237f1ab..c0369eef17e 100644 --- a/ext/standard/tests/file/bug22414.phpt +++ b/ext/standard/tests/file/bug22414.phpt @@ -1,5 +1,9 @@ --TEST-- Bug #22414 (passthru() does not read data correctly) +--SKIPIF-- + --INI-- output_handler= --FILE-- diff --git a/ext/zlib/tests/bug67724.phpt b/ext/zlib/tests/bug67724.phpt index 23e27ec6995..7367cb615d8 100644 --- a/ext/zlib/tests/bug67724.phpt +++ b/ext/zlib/tests/bug67724.phpt @@ -2,6 +2,10 @@ Bug #67724 (chained zlib filters silently fail with large amounts of data) --EXTENSIONS-- zlib +--SKIPIF-- + --FILE--