Skip to content

Commit c171e69

Browse files
committed
Test ASAN on Ubuntu 22.04 in nightly by increasing swap
See ef6bbaa. We previously ran into crashes that are apprently related to a decrease in memory on never runners. The crash can be avoided by increasing the swap file.
1 parent 8eb740b commit c171e69

File tree

2 files changed

+90
-2
lines changed

2 files changed

+90
-2
lines changed

.github/workflows/nightly.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,18 @@ jobs:
6060
zts: [true, false]
6161
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.matrix-include) }}
6262
name: "${{ matrix.branch.name }}_LINUX_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
63-
runs-on: ubuntu-${{ ((matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && !matrix.asan) && '22.04' || '20.04' }}
63+
runs-on: ubuntu-${{ (matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && '22.04' || '20.04' }}
6464
steps:
65+
# https://stackoverflow.com/a/76921482/1320374
66+
- name: Increase swapfile
67+
if: matrix.asan
68+
run: |
69+
sudo swapoff -a
70+
sudo fallocate -l 8G /swapfile
71+
sudo chmod 600 /swapfile
72+
sudo mkswap /swapfile
73+
sudo swapon /swapfile
74+
sudo swapon --show
6575
- name: git checkout
6676
uses: actions/checkout@v4
6777
with:

.github/workflows/push.yml

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ env:
4343
CXX: ccache g++
4444
jobs:
4545
LINUX_X64:
46+
if: false
4647
services:
4748
mysql:
4849
image: mysql:8
@@ -135,6 +136,7 @@ jobs:
135136
if: ${{ !matrix.asan }}
136137
uses: ./.github/actions/verify-generated-files
137138
MACOS_DEBUG_NTS:
139+
if: false
138140
runs-on: macos-12
139141
steps:
140142
- name: git checkout
@@ -168,6 +170,7 @@ jobs:
168170
- name: Verify generated files are up to date
169171
uses: ./.github/actions/verify-generated-files
170172
WINDOWS:
173+
if: false
171174
name: WINDOWS_X64_ZTS
172175
runs-on: windows-2019
173176
env:
@@ -194,7 +197,8 @@ jobs:
194197
run: .github/scripts/windows/test.bat
195198
BENCHMARKING:
196199
name: BENCHMARKING
197-
if: github.repository_owner == 'php' || github.event_name == 'pull_request'
200+
# if: github.repository_owner == 'php' || github.event_name == 'pull_request'
201+
if: false
198202
runs-on: ubuntu-22.04
199203
steps:
200204
- name: git checkout
@@ -288,3 +292,77 @@ jobs:
288292
${{ github.sha }} \
289293
$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.sha }}) \
290294
> $GITHUB_STEP_SUMMARY
295+
ASAN_TEST:
296+
services:
297+
postgres:
298+
image: postgres
299+
env:
300+
POSTGRES_USER: postgres
301+
POSTGRES_PASSWORD: postgres
302+
POSTGRES_DB: test
303+
name: ASAN_TEST
304+
runs-on: ubuntu-22.04
305+
steps:
306+
# https://stackoverflow.com/a/76921482/1320374
307+
- name: Increase swapfile
308+
run: |
309+
sudo swapoff -a
310+
sudo fallocate -l 8G /swapfile
311+
sudo chmod 600 /swapfile
312+
sudo mkswap /swapfile
313+
sudo swapon /swapfile
314+
sudo swapon --show
315+
- name: git checkout
316+
uses: actions/checkout@v4
317+
- name: Create MSSQL container
318+
uses: ./.github/actions/setup-mssql
319+
- name: Create Oracle container
320+
uses: ./.github/actions/setup-oracle
321+
- name: apt
322+
uses: ./.github/actions/apt-x64
323+
- name: System info
324+
run: |
325+
echo "::group::Show host CPU info"
326+
lscpu
327+
echo "::endgroup::"
328+
echo "::group::Show installed package versions"
329+
dpkg -l
330+
echo "::endgroup::"
331+
- name: ./configure
332+
uses: ./.github/actions/configure-x64
333+
with:
334+
configurationParameters: >-
335+
CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address'
336+
--enable-debug
337+
--enable-zts
338+
- name: config.log
339+
if: always()
340+
run: cat config.log
341+
- name: make
342+
run: make -j$(/usr/bin/nproc) >/dev/null
343+
- name: make install
344+
uses: ./.github/actions/install-linux
345+
- name: Setup
346+
uses: ./.github/actions/setup-x64
347+
- name: Test
348+
uses: ./.github/actions/test-linux
349+
with:
350+
runTestsParameters: >-
351+
--asan
352+
- name: Test Tracing JIT
353+
uses: ./.github/actions/test-linux
354+
with:
355+
runTestsParameters: >-
356+
--asan
357+
-d zend_extension=opcache.so
358+
-d opcache.enable_cli=1
359+
-d opcache.jit_buffer_size=16M
360+
- name: Test OpCache
361+
uses: ./.github/actions/test-linux
362+
with:
363+
runTestsParameters: >-
364+
--asan
365+
-d zend_extension=opcache.so
366+
-d opcache.enable_cli=1
367+
- name: Verify generated files are up to date
368+
uses: ./.github/actions/verify-generated-files

0 commit comments

Comments
 (0)