Browse Source

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
Daniel Stenberg 2 months ago
parent
commit
09f367977a
1 changed files with 9 additions and 1 deletions
  1. 9 1
      .github/workflows/linux.yml

+ 9 - 1
.github/workflows/linux.yml

@@ -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