@@ -20,18 +20,33 @@ permissions:
2020
2121jobs :
2222 test :
23- runs-on : ubuntu-22.04
23+ # We need Unbuntu 24.04 (over 22.04) due to a kernel bug,
24+ # see https://github.com/google/sanitizers/issues/856.
25+ runs-on : ubuntu-24.04
2426 timeout-minutes : 30
2527 env :
2628 MPI4PY_TEST_SPAWN : true
29+ # disable ODR violation detection until #13469 is fixed
30+ # and don't abort on error by default
31+ ASAN_OPTIONS : verify_asan_link_order=0,detect_odr_violation=0,abort_on_error=0
32+ # disable leak detection and make sure we do not fail on leaks
33+ LSAN_OPTIONS : detect_leaks=0,exitcode=0
34+
2735 steps :
2836 - name : Configure hostname
2937 run : echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null
3038 if : ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
3139
40+ - name : Print kernel version
41+ run : uname -a
42+
43+ - name : Disable ASLR
44+ run : sudo sysctl -w kernel.randomize_va_space=0
45+ if : ${{ runner.os == 'Linux' }}
46+
3247 - name : Install depencencies
33- run : sudo apt-get install -y -q
34- libnuma-dev
48+ run : sudo apt update && sudo apt -get install -y -q
49+ libnuma-dev libasan8
3550 if : ${{ runner.os == 'Linux' }}
3651
3752 - name : Checkout Open MPI
5974 --disable-oshmem
6075 --disable-silent-rules
6176 --prefix=/opt/openmpi
62- LDFLAGS=-Wl,-rpath,/opt/openmpi/lib
77+ CFLAGS="-fno-omit-frame-pointer -g -O1 -fsanitize=address"
78+ LDFLAGS="-Wl,-rpath,/opt/openmpi/lib -fsanitize=address"
6379 working-directory : mpi-build
6480
6581 - name : Build MPI
@@ -145,6 +161,35 @@ jobs:
145161 if : ${{ true }}
146162 timeout-minutes : 10
147163
164+ - name : Setting up ASAN environment
165+ # LD_PRELOAD is needed to make sure ASAN is the first thing loaded
166+ # as it will otherwise complain
167+ # Leak detection is currently disabled because of the size of the report.
168+ # The patcher is disabled because ASAN fails if code mmaps data at fixed
169+ # memory addresses, see https://github.com/open-mpi/ompi/issues/12819
170+ # ODR violation detection is disabled until #13469 is fixed
171+ run : |
172+ echo LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.8 >> $GITHUB_ENV
173+ echo ASAN_OPTIONS=detect_odr_violation=0,abort_on_error=1 >> $GITHUB_ENV
174+ echo LSAN_OPTIONS=detect_leaks=0,exitcode=0 >> $GITHUB_ENV
175+ echo OMPI_MCA_memory=^patcher >> $GITHUB_ENV
176+
177+ - name : Test mpi4py ASAN (np=1)
178+ run : mpiexec -n 1 python test/main.py -v -x TestExcErrhandlerNull
179+ if : ${{ true }}
180+ timeout-minutes : 10
181+
182+ - name : Test mpi4py ASAN (np=4)
183+ run : mpiexec -n 4 python test/main.py -v -f -x TestExcErrhandlerNull
184+ if : ${{ true }}
185+ timeout-minutes : 10
186+
187+ - name : Disabling ASAN environment
188+ run : |
189+ echo LD_PRELOAD= >> $GITHUB_ENV
190+ echo ASAN_OPTIONS=verify_asan_link_order=0,detect_odr_violation=0,abort_on_error=0 >> $GITHUB_ENV
191+ echo LSAN_OPTIONS=detect_leaks=0,exitcode=0 >> $GITHUB_ENV
192+
148193 - name : Relocate Open MPI installation
149194 run : mv /opt/openmpi /opt/ompi
150195 - name : Update PATH and set OPAL_PREFIX and LD_LIBRARY_PATH
@@ -157,4 +202,3 @@ jobs:
157202 run : python test/main.py -v -x TestExcErrhandlerNull
158203 if : ${{ true }}
159204 timeout-minutes : 10
160-
0 commit comments