@@ -63,53 +63,72 @@ jobs:
6363 fail-fast : false
6464 matrix :
6565 include :
66- - debug : true
67- zts : false
6866 - debug : false
67+ zts : false
68+ asan : false
69+ - debug : true
6970 zts : true
70- name : " LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
71- runs-on : ubuntu-20.04
71+ asan : true
72+ name : " LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}"
73+ runs-on : ubuntu-${{ !matrix.asan && '22' || '24' }}.04
7274 steps :
7375 - name : git checkout
7476 uses : actions/checkout@v4
77+ - name : apt
78+ uses : ./.github/actions/apt-x64
79+ - name : System info
80+ run : |
81+ echo "::group::Show host CPU info"
82+ lscpu
83+ echo "::endgroup::"
84+ echo "::group::Show installed package versions"
85+ dpkg -l
86+ echo "::endgroup::"
7587 - name : Create MSSQL container
88+ if : ${{ !matrix.asan }}
7689 uses : ./.github/actions/setup-mssql
7790 - name : Create Oracle container
91+ if : ${{ !matrix.asan }}
7892 uses : ./.github/actions/setup-oracle
7993 - name : Setup Caddy server
8094 uses : ./.github/actions/setup-caddy
81- - name : apt
82- uses : ./.github/actions/apt-x64
8395 - name : ccache
8496 uses :
hendrikmuhs/[email protected] 8597 with :
8698 # This duplicates the "job.name" expression above because
8799 # GitHub has no way to query the job name (github.job is the
88100 # job id, not the job name)
89- key : " LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}-${{hashFiles('main/php_version.h')}}"
101+ key : " LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }} -${{hashFiles('main/php_version.h')}}"
90102 append-timestamp : false
103+ save : ${{ github.event_name != 'pull_request' }}
91104 - name : ./configure
92105 uses : ./.github/actions/configure-x64
93106 with :
94107 configurationParameters : >-
95108 --${{ matrix.debug && 'enable' || 'disable' }}-debug
96109 --${{ matrix.zts && 'enable' || 'disable' }}-zts
110+ ${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function" CC=clang CXX=clang++ --disable-opcache-jit' || '' }}
111+ skipSlow : ${{ matrix.asan }}
97112 - name : make
98113 run : make -j$(/usr/bin/nproc) >/dev/null
99114 - name : make install
100115 uses : ./.github/actions/install-linux
101116 - name : Setup
117+ if : ${{ !matrix.asan }}
102118 uses : ./.github/actions/setup-x64
103119 - name : Test
120+ if : matrix.asan == false
104121 uses : ./.github/actions/test-linux
105- - name : Test Tracing JIT
122+ - name : Test ${{ matrix.asan && 'OpCache' || ' Tracing JIT' }}
106123 uses : ./.github/actions/test-linux
107124 with :
108- jitType : tracing
125+ jitType : ${{ matrix.asan && 'disable' || ' tracing' }}
109126 runTestsParameters : >-
110127 -d zend_extension=opcache.so
111128 -d opcache.enable_cli=1
129+ ${{ matrix.asan && '--asan -x' || '' }}
112130 - name : Verify generated files are up to date
131+ if : ${{ !matrix.asan }}
113132 uses : ./.github/actions/verify-generated-files
114133 MACOS_DEBUG_NTS :
115134 if : github.repository == 'php/php-src' || github.event_name == 'pull_request'
0 commit comments