Skip to content

Move ASAN built to GitHub actions #11898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
180 changes: 0 additions & 180 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
1 change: 1 addition & 0 deletions .github/actions/apt-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ runs:
freetds-dev \
unixodbc-dev \
llvm \
clang \
libc-client-dev \
dovecot-core \
dovecot-pop3d \
Expand Down
37 changes: 20 additions & 17 deletions .github/actions/configure-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ inputs:
configurationParameters:
default: ''
required: false
skipSlow:
default: false
required: false
runs:
using: composite
steps:
Expand All @@ -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 \
Expand All @@ -34,7 +37,7 @@ runs:
--enable-soap \
--enable-xmlreader \
--with-xsl \
--with-tidy \
${{ inputs.skipSlow == 'false' && '--with-tidy' || '' }} \
--enable-sysvsem \
--enable-sysvshm \
--enable-shmop \
Expand All @@ -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 \
Expand All @@ -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 }}
8 changes: 6 additions & 2 deletions .github/actions/install-linux/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
name: Install
inputs:
withOci:
default: true
required: false
runs:
using: composite
steps:
Expand All @@ -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' || '' }}
18 changes: 13 additions & 5 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -70,32 +72,38 @@ 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
with:
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
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' || '' }} Tracing JIT
runTestsParameters: >-
-d zend_extension=opcache.so
-d opcache.enable_cli=1
-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:
Expand Down
4 changes: 4 additions & 0 deletions Zend/tests/bug78010.phpt
Original file line number Diff line number Diff line change
@@ -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--
Expand Down
1 change: 1 addition & 0 deletions ext/mysqli/tests/mysqli_fetch_all.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mysqli_fetch_all()
mysqli
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
require_once 'skipifconnectfailure.inc';
?>
--FILE--
Expand Down
1 change: 1 addition & 0 deletions ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mysqli_fetch_array()
mysqli
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
require_once 'skipifconnectfailure.inc';
?>
--FILE--
Expand Down
1 change: 1 addition & 0 deletions ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
1 change: 1 addition & 0 deletions ext/mysqli/tests/mysqli_stmt_bind_limits.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Bind limits
mysqli
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
require_once 'skipifconnectfailure.inc';
?>
--CONFLICTS--
Expand Down
1 change: 1 addition & 0 deletions ext/mysqli/tests/mysqli_stmt_send_long_data.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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--
Expand Down
Loading