Skip to content

Commit 563db69

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 563db69

File tree

2 files changed

+92
-2
lines changed

2 files changed

+92
-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: 81 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,79 @@ 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: ccache
316+
uses: hendrikmuhs/ccache-action@v1.2
317+
- name: git checkout
318+
uses: actions/checkout@v4
319+
- name: Create MSSQL container
320+
uses: ./.github/actions/setup-mssql
321+
- name: Create Oracle container
322+
uses: ./.github/actions/setup-oracle
323+
- name: apt
324+
uses: ./.github/actions/apt-x64
325+
- name: System info
326+
run: |
327+
echo "::group::Show host CPU info"
328+
lscpu
329+
echo "::endgroup::"
330+
echo "::group::Show installed package versions"
331+
dpkg -l
332+
echo "::endgroup::"
333+
- name: ./configure
334+
uses: ./.github/actions/configure-x64
335+
with:
336+
configurationParameters: >-
337+
CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address'
338+
--enable-debug
339+
--enable-zts
340+
# - name: config.log
341+
# if: always()
342+
# run: cat config.log
343+
- name: make
344+
run: make -j$(/usr/bin/nproc) >/dev/null
345+
- name: make install
346+
uses: ./.github/actions/install-linux
347+
- name: Setup
348+
uses: ./.github/actions/setup-x64
349+
- name: Test
350+
uses: ./.github/actions/test-linux
351+
with:
352+
runTestsParameters: >-
353+
--asan
354+
- name: Test Tracing JIT
355+
uses: ./.github/actions/test-linux
356+
with:
357+
runTestsParameters: >-
358+
--asan
359+
-d zend_extension=opcache.so
360+
-d opcache.enable_cli=1
361+
-d opcache.jit_buffer_size=16M
362+
- name: Test OpCache
363+
uses: ./.github/actions/test-linux
364+
with:
365+
runTestsParameters: >-
366+
--asan
367+
-d zend_extension=opcache.so
368+
-d opcache.enable_cli=1
369+
- name: Verify generated files are up to date
370+
uses: ./.github/actions/verify-generated-files

0 commit comments

Comments
 (0)