]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Test] ci: build and test the jemalloc configuration 6155/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 27 Jul 2026 11:12:30 +0000 (12:12 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 27 Jul 2026 11:12:30 +0000 (12:12 +0100)
rspamd ships jemalloc-enabled packages -- debian/rules turns it on for
every architecture but arm64, rpm/rspamd.spec turns it on everywhere --
yet no workflow ever passed -DENABLE_JEMALLOC. The only mention under
.github was openbsd_build.yml setting it OFF. jemalloc replaces the
allocator for the whole process, so that is a large untested surface,
and #6153 is what it let through: a startup segfault reachable only in
a jemalloc build.

Add an enable_jemalloc input to both reusable workflows and set it
explicitly per job so each one states which package it mirrors.

ubuntu_amd64 turns it on. That is the shipped Debian/Ubuntu amd64
configuration and the only job running the functional suite, and the
binary it uploads is what webui-e2e-playwright then exercises.
ubuntu-focal turns it on too, covering the gcc-10 floor. Neither needs
an image change: rspamd-build-docker installs libjemalloc-dev in the
amd64 branch of both Dockerfiles.

ubuntu_arm64 stays off deliberately, matching debian/rules, which also
disables jemalloc there; the arm64 image takes the vectorscan branch
and skips libjemalloc-dev anyway.

fedora and centos-8/9 stay off for now with a note. Their packages do
build with jemalloc, but the images install the runtime library only
(centos) or nothing at all (fedora), so enabling them needs
jemalloc-devel added in rspamd/rspamd-build-docker first.

Issue: #6153

.github/workflows/ci.yml
.github/workflows/ci_rspamd.yml
.github/workflows/ci_rspamd_build.yml

index 8434cb2f9c45245b6b0bfad328a9bb7bb83b5674..bc00c270aa5da96af9b6b8d16888c3b3f48978ef 100644 (file)
@@ -45,6 +45,10 @@ jobs:
       image: ghcr.io/rspamd/rspamd-build-docker:fedora-ci
       name: fedora-ci
       enable_luajit: 'OFF'
+      # rpm/rspamd.spec builds with jemalloc, but the fedora-ci image installs
+      # neither jemalloc nor jemalloc-devel. Flip this on once the image carries
+      # jemalloc-devel (rspamd/rspamd-build-docker).
+      enable_jemalloc: 'OFF'
 
   ubuntu_amd64:
     if: |
@@ -55,6 +59,11 @@ jobs:
     with:
       image: ghcr.io/rspamd/rspamd-build-docker:ubuntu-ci
       name: ubuntu-ci-amd64
+      # The shipped configuration: debian/rules enables jemalloc everywhere
+      # except arm64, and the amd64 image carries libjemalloc-dev. This is the
+      # only job that runs the functional suite against it, and the binary it
+      # uploads is what webui-e2e-playwright then exercises.
+      enable_jemalloc: 'ON'
 
   ubuntu_arm64:
     if: |
@@ -68,6 +77,9 @@ jobs:
       image: ghcr.io/rspamd/rspamd-build-docker:ubuntu-ci
       name: ubuntu-ci-arm64
       runner: ${{ vars.ARM_RUNNER || 'ubuntu-24.04-arm' }}
+      # Deliberately off: debian/rules also disables jemalloc on arm64, and the
+      # arm64 image takes the vectorscan branch which skips libjemalloc-dev.
+      enable_jemalloc: 'OFF'
 
   ubuntu-focal:
     if: |
@@ -78,6 +90,9 @@ jobs:
     with:
       image: ghcr.io/rspamd/rspamd-build-docker:ubuntu-focal
       name: ubuntu-focal
+      # amd64 runner, and the focal image carries libjemalloc-dev; this covers
+      # the jemalloc build on the gcc-10 floor.
+      enable_jemalloc: 'ON'
 
   centos-8:
     if: |
@@ -88,6 +103,9 @@ jobs:
     with:
       image: ghcr.io/rspamd/rspamd-build-docker:centos-8
       name: centos-8
+      # rpm/rspamd.spec builds with jemalloc, but the image installs only the
+      # runtime `jemalloc`, not `jemalloc-devel`. Flip on once the image has it.
+      enable_jemalloc: 'OFF'
 
   centos-9:
     if: |
@@ -98,6 +116,8 @@ jobs:
     with:
       image: ghcr.io/rspamd/rspamd-build-docker:centos-9
       name: centos-9
+      # As centos-8: image has runtime `jemalloc` only, no `jemalloc-devel`.
+      enable_jemalloc: 'OFF'
 
   webui-e2e-playwright:
     needs: ubuntu_amd64
index 061ec53864f4eba784e07761afecf4ce2bd88715..2d382ecc99d16b2b8ae7024a5ccbcd632d263225 100644 (file)
@@ -15,6 +15,15 @@ on:
       enable_luajit:
         type: string
         default: 'ON'
+      # rspamd ships jemalloc-enabled packages (debian/rules on everything but
+      # arm64, rpm/rspamd.spec everywhere), and jemalloc changes how the whole
+      # process allocates, so that configuration has to be built and tested and
+      # not just assumed to work. Opt-in rather than default-on because only the
+      # amd64 ubuntu images carry libjemalloc-dev; see the per-job comments in
+      # ci.yml for who is still missing it.
+      enable_jemalloc:
+        type: string
+        default: 'OFF'
 
 env:
   CTEST_OUTPUT_ON_FAILURE: 1
@@ -57,7 +66,7 @@ jobs:
         run: |
           mkdir ${GITHUB_WORKSPACE}/build
           cd ${GITHUB_WORKSPACE}/build
-          cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_COVERAGE=ON -DENABLE_LIBUNWIND=ON -DENABLE_HYPERSCAN=ON -DENABLE_LUAJIT=${{ inputs.enable_luajit }} ${{ env.HYPERSCAN_ALTROOT }} -GNinja ${GITHUB_WORKSPACE}/src
+          cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_COVERAGE=ON -DENABLE_LIBUNWIND=ON -DENABLE_HYPERSCAN=ON -DENABLE_LUAJIT=${{ inputs.enable_luajit }} -DENABLE_JEMALLOC=${{ inputs.enable_jemalloc }} ${{ env.HYPERSCAN_ALTROOT }} -GNinja ${GITHUB_WORKSPACE}/src
 
       - name: Build rspamd
         run: |
index 9503f1974f78170e1689d47b1405e78950beaaf9..b98f0003a7182612ed1953a603cc58a71022577e 100644 (file)
@@ -9,6 +9,11 @@ on:
       name:
         required: true
         type: string
+      # See the matching input in ci_rspamd.yml: the shipped packages enable
+      # jemalloc, so at least one job has to build with it.
+      enable_jemalloc:
+        type: string
+        default: 'OFF'
 
 jobs:
   test:
@@ -34,12 +39,12 @@ jobs:
         run: |
           mkdir ${GITHUB_WORKSPACE}/build
           cd ${GITHUB_WORKSPACE}/build
-          if [[ -f /opt/rh/gcc-toolset-10/enable ]] ; then source /opt/rh/gcc-toolset-10/enable ; fi 
-          cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_COVERAGE=ON -DENABLE_LIBUNWIND=ON  -DENABLE_LUAJIT=ON -DLUA_ROOT=/luajit-build -DENABLE_HYPERSCAN=ON ${{ env.HYPERSCAN_ALTROOT }} ${GITHUB_WORKSPACE}/src
+          if [[ -f /opt/rh/gcc-toolset-10/enable ]] ; then source /opt/rh/gcc-toolset-10/enable ; fi
+          cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_COVERAGE=ON -DENABLE_LIBUNWIND=ON  -DENABLE_LUAJIT=ON -DLUA_ROOT=/luajit-build -DENABLE_HYPERSCAN=ON -DENABLE_JEMALLOC=${{ inputs.enable_jemalloc }} ${{ env.HYPERSCAN_ALTROOT }} ${GITHUB_WORKSPACE}/src
 
       - name: Build rspamd
         run: |
-          if [[ -f /opt/rh/gcc-toolset-10/enable ]] ; then source /opt/rh/gcc-toolset-10/enable ; fi 
+          if [[ -f /opt/rh/gcc-toolset-10/enable ]] ; then source /opt/rh/gcc-toolset-10/enable ; fi
           cd ${GITHUB_WORKSPACE}/build
           ncpu=$(getconf _NPROCESSORS_ONLN)
           make -j $ncpu install