1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

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
This commit is contained in:
Ilija Tovilo
2023-08-07 12:44:53 +02:00
parent db4dba6702
commit fc9266a5fc
21 changed files with 91 additions and 206 deletions

View File

@@ -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:

View File

@@ -46,6 +46,7 @@ runs:
freetds-dev \
unixodbc-dev \
llvm \
clang \
libc-client-dev \
dovecot-core \
dovecot-pop3d \

View File

@@ -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 }}

View File

@@ -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' || '' }}

View File

@@ -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:

View File

@@ -1,5 +1,9 @@
--TEST--
Bug #78010: Segmentation fault during GC
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
?>
--INI--
memory_limit=2G
--FILE--

View File

@@ -4,6 +4,7 @@ mysqli_fetch_all()
mysqli
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
require_once 'skipifconnectfailure.inc';
?>
--FILE--

View File

@@ -4,6 +4,7 @@ mysqli_fetch_array()
mysqli
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
require_once 'skipifconnectfailure.inc';
?>
--FILE--

View File

@@ -4,6 +4,7 @@ mysqlnd.net_read_timeout > default_socket_timeout
mysqli
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
require_once 'connect.inc';
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {

View File

@@ -4,6 +4,7 @@ Bind limits
mysqli
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
require_once 'skipifconnectfailure.inc';
?>
--CONFLICTS--

View File

@@ -4,6 +4,7 @@ mysqli_stmt_send_long_data()
mysqli
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
require_once 'skipifconnectfailure.inc';
?>
--FILE--

View File

@@ -4,6 +4,10 @@ Phar front controller other
phar.cache_list={PWD}/frontcontroller1.php [cache_list]
--EXTENSIONS--
phar
--SKIPIF--
<?php
if (getenv('SKIP_ASAN')) die('xleak LSan crashes for this test');
?>
--ENV--
SCRIPT_NAME=/frontcontroller1.php
REQUEST_URI=/frontcontroller1.php/a.jpg

View File

@@ -6,6 +6,10 @@ phar.cache_list={PWD}/frontcontroller21.php
cgi.fix_pathinfo=1
--EXTENSIONS--
phar
--SKIPIF--
<?php
if (getenv('SKIP_ASAN')) die('xleak LSan crashes for this test');
?>
--ENV--
SCRIPT_NAME=/frontcontroller21.php
REQUEST_URI=/frontcontroller21.php/index.php?test=hi

View File

@@ -5,6 +5,10 @@ default_charset=UTF-8
phar.cache_list={PWD}/frontcontroller22.phpt
--EXTENSIONS--
phar
--SKIPIF--
<?php
if (getenv('SKIP_ASAN')) die('xleak LSan crashes for this test');
?>
--ENV--
SCRIPT_NAME=/frontcontroller22.php
REQUEST_URI=/frontcontroller22.php/index.php

View File

@@ -5,6 +5,10 @@ default_charset=UTF-8
phar.cache_list={PWD}/frontcontroller23.php
--EXTENSIONS--
phar
--SKIPIF--
<?php
if (getenv('SKIP_ASAN')) die('xleak LSan crashes for this test');
?>
--ENV--
SCRIPT_NAME=/frontcontroller23.php
REQUEST_URI=/frontcontroller23.php/hi/there

View File

@@ -5,6 +5,10 @@ default_charset=UTF-8
phar.cache_list={PWD}/frontcontroller31.php
--EXTENSIONS--
phar
--SKIPIF--
<?php
if (getenv('SKIP_ASAN')) die('xleak LSan crashes for this test');
?>
--ENV--
SCRIPT_NAME=/frontcontroller31.php
REQUEST_URI=/frontcontroller31.php

View File

@@ -5,6 +5,10 @@ default_charset=UTF-8
phar.cache_list={PWD}/frontcontroller32.php
--EXTENSIONS--
phar
--SKIPIF--
<?php
if (getenv('SKIP_ASAN')) die('xleak LSan crashes for this test');
?>
--ENV--
SCRIPT_NAME=/frontcontroller32.php
REQUEST_URI=/frontcontroller32.php

View File

@@ -5,6 +5,10 @@ default_charset=UTF-8
phar.cache_list={PWD}/frontcontroller33.php
--EXTENSIONS--
phar
--SKIPIF--
<?php
if (getenv('SKIP_ASAN')) die('xleak LSan crashes for this test');
?>
--ENV--
SCRIPT_NAME=/frontcontroller33.php
REQUEST_URI=/frontcontroller33.php

View File

@@ -5,6 +5,10 @@ default_charset=UTF-8
phar.cache_list={PWD}/frontcontroller34.php
--EXTENSIONS--
phar
--SKIPIF--
<?php
if (getenv('SKIP_ASAN')) die('xleak LSan crashes for this test');
?>
--ENV--
SCRIPT_NAME=/frontcontroller34.php
REQUEST_URI=/frontcontroller34.php/start/index.php

View File

@@ -1,5 +1,9 @@
--TEST--
Bug #22414 (passthru() does not read data correctly)
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
?>
--INI--
output_handler=
--FILE--

View File

@@ -2,6 +2,10 @@
Bug #67724 (chained zlib filters silently fail with large amounts of data)
--EXTENSIONS--
zlib
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
?>
--FILE--
<?php
echo "Test\n";