]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CI: vtest: show coredumps if any
authorIlya Shipitsin <chipitsine@gmail.com>
Wed, 27 Mar 2024 15:49:54 +0000 (16:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 2 Apr 2024 05:29:08 +0000 (07:29 +0200)
if any coredump is found, it is passed to gdb with
'thread apply all bt full'

.github/workflows/vtest.yml

index 8c461385f8e1404f8f86bc7151248a1b88a7f138..a704c92dc21b953531c513a7475fc4f10103fe2e 100644 (file)
@@ -49,6 +49,13 @@ jobs:
     - uses: actions/checkout@v4
       with:
         fetch-depth: 100
+
+    - name: Setup coredumps
+      if: ${{ startsWith(matrix.os, 'ubuntu-') }}
+      run: |
+        sudo sysctl -w fs.suid_dumpable=1
+        sudo sysctl kernel.core_pattern=/tmp/core.%h.%e.%t
+
 #
 # Github Action cache key cannot contain comma, so we calculate it based on job name
 #
@@ -92,7 +99,8 @@ jobs:
           libpcre2-dev \
           libsystemd-dev \
           ninja-build \
-          socat
+          socat \
+          gdb
     - name: Install brew dependencies
       if: ${{ startsWith(matrix.os, 'macos-') }}
       run: |
@@ -150,6 +158,7 @@ jobs:
         # This is required for macOS which does not actually allow to increase
         # the '-n' soft limit to the hard limit, thus failing to run.
         ulimit -n 65536
+        ulimit -c unlimited
         make reg-tests HAPROXY_ARGS="-dI" VTEST_PROGRAM=../vtest/vtest REGTESTS_TYPES=default,bug,devel
     - name: Config syntax check memleak smoke testing
       if: ${{ contains(matrix.name, 'ASAN') }}
@@ -175,3 +184,18 @@ jobs:
           echo "::endgroup::"
         done
         exit 1
+
+    - name: Show coredumps
+      if: ${{ failure() && steps.vtest.outcome == 'failure' }}
+      run: |
+        failed=false
+        shopt -s nullglob
+        for file in /tmp/core.*; do
+          failed=true
+          printf "::group::"
+          gdb -ex 'thread apply all bt full' ./haproxy $file
+          echo "::endgroup::"
+        done
+        if [ "$failed" = true ]; then
+          exit 1;
+        fi