Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f82262b

Browse files
authored
Run address sanitiser in the GitHub CI (GH-26640)
1 parent ac867f1 commit f82262b

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,46 @@ jobs:
218218
run: make pythoninfo
219219
- name: SSL tests
220220
run: ./python Lib/test/ssltests.py
221+
222+
223+
build_asan:
224+
name: 'Address sanitizer'
225+
runs-on: ubuntu-20.04
226+
needs: check_source
227+
if: needs.check_source.outputs.run_tests == 'true'
228+
env:
229+
OPENSSL_VER: 1.1.1k
230+
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
231+
steps:
232+
- uses: actions/checkout@v2
233+
- name: Register gcc problem matcher
234+
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
235+
- name: Install Dependencies
236+
run: sudo ./.github/workflows/posix-deps-apt.sh
237+
- name: Configure OpenSSL env vars
238+
run: |
239+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
240+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
241+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
242+
- name: 'Restore OpenSSL build'
243+
id: cache-openssl
244+
uses: actions/[email protected]
245+
with:
246+
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
247+
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
248+
- name: Install OpenSSL
249+
if: steps.cache-openssl.outputs.cache-hit != 'true'
250+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
251+
- name: Add ccache to PATH
252+
run: |
253+
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
254+
- name: Configure ccache action
255+
uses: hendrikmuhs/ccache-action@v1
256+
- name: Configure CPython
257+
run: ./configure --with-address-sanitizer --without-pymalloc
258+
- name: Build CPython
259+
run: make -j4
260+
- name: Display build info
261+
run: make pythoninfo
262+
- name: Tests
263+
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu -x test_ctypes test_crypt test_decimal test_faulthandler test_interpreters test___all__ test_idle test_tix test_tk test_ttk_guionly test_ttk_textonly"

0 commit comments

Comments
 (0)