GHA/linux: add sysctl trick to work-around GitHub runner issue

The GitHub image runner update from 20240304.1.0 to 20240310.1
introduces a problem for clang-14. The issue is caused by
incompatibility between llvm 14 provided in ubuntu-22.04 image and the
much newer kernel configured with high-entropy ASLR.

As a work-around, we issue a sysctl command to lower the entropy and get
clang-14 to work again.

URL: https://github.com/actions/runner-images/issues/9491

Closes #13124
This commit is contained in:
Daniel Stenberg 2024-03-14 12:56:39 +01:00
parent fb3c251ef7
commit 09f367977a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -139,7 +139,7 @@ jobs:
CFLAGS="-fsanitize=memory -Wformat -Werror=format-security -Werror=array-bounds -g"
LDFLAGS="-fsanitize=memory"
LIBS="-ldl"
--without-ssl --without-zlib --without-brotli --without-zstd --without-libpsl --without-nghttp2 --enable-debug --enable-websocketsx
--without-ssl --without-zlib --without-brotli --without-zstd --without-libpsl --without-nghttp2 --enable-debug --enable-websockets
singleuse: --unit
- name: event-based
@ -197,6 +197,14 @@ jobs:
- uses: actions/checkout@v4
- name: Fix kernel mmap rnd bits
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
# See https://github.com/actions/runner-images/issues/9491
continue-on-error: true
run: sudo sysctl vm.mmap_rnd_bits=28
- if: contains(matrix.build.install_steps, 'gcc-11')
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa