@@ -24,14 +24,22 @@ jobs:
2424 timeout-minutes : 30
2525 env :
2626 MPI4PY_TEST_SPAWN : true
27+ # ASAN needs to come first
28+ # LD_PRELOAD: /usr/lib/x86_64-linux-gnu/libasan.so.8
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
3240 - name : Install depencencies
3341 run : sudo apt-get install -y -q
34- libnuma-dev
42+ libnuma-dev libasan8
3543 if : ${{ runner.os == 'Linux' }}
3644
3745 - name : Checkout Open MPI
5967 --disable-oshmem
6068 --disable-silent-rules
6169 --prefix=/opt/openmpi
62- LDFLAGS=-Wl,-rpath,/opt/openmpi/lib
70+ CFLAGS="-fno-omit-frame-pointer -g -O1 -fsanitize=address"
71+ LDFLAGS="-Wl,-rpath,/opt/openmpi/lib -fsanitize=address"
6372 working-directory : mpi-build
6473
6574 - name : Build MPI
@@ -145,6 +154,28 @@ jobs:
145154 if : ${{ true }}
146155 timeout-minutes : 10
147156
157+ - name : Setting up ASAN environment
158+ run : |
159+ echo LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.8 >> $GITHUB_ENV
160+ echo ASAN_OPTIONS=detect_odr_violation=0,abort_on_error=1 >> $GITHUB_ENV
161+ echo LSAN_OPTIONS=detect_leaks=1,exitcode=0 >> $GITHUB_ENV
162+
163+ - name : Test mpi4py ASAN (np=1)
164+ run : mpiexec -n 1 python test/main.py -v -x TestExcErrhandlerNull
165+ if : ${{ true }}
166+ timeout-minutes : 10
167+
168+ - name : Test mpi4py ASAN (np=4)
169+ run : mpiexec -n 4 python test/main.py -v -f -x TestExcErrhandlerNull
170+ if : ${{ true }}
171+ timeout-minutes : 10
172+
173+ - name : Disabling ASAN environment
174+ run : |
175+ echo LD_PRELOAD= >> $GITHUB_ENV
176+ echo ASAN_OPTIONS=verify_asan_link_order=0,detect_odr_violation=0,abort_on_error=0 >> $GITHUB_ENV
177+ echo LSAN_OPTIONS=detect_leaks=0,exitcode=0 >> $GITHUB_ENV
178+
148179 - name : Relocate Open MPI installation
149180 run : mv /opt/openmpi /opt/ompi
150181 - name : Update PATH and set OPAL_PREFIX and LD_LIBRARY_PATH
@@ -157,4 +188,3 @@ jobs:
157188 run : python test/main.py -v -x TestExcErrhandlerNull
158189 if : ${{ true }}
159190 timeout-minutes : 10
160-
0 commit comments