From 6387713ad008bcc015c49a27318a75124403d32f Mon Sep 17 00:00:00 2001 From: Vincent PARRES-GACON Date: Thu, 6 Feb 2025 09:56:39 +0100 Subject: [PATCH 1/3] Fixed "core" Docker image to allow x86_32 building, updated documentation for SSE4.2 requirement. - "core" Docker image : Switched from uname -m architecture detection to apk --print-arch to better reflect the binary distribution architecture instead of the current Kernel architecture. This allows building a i686 linux image on a amd64 machine. - "core" Docker image : Adding rust toolchain in dependancies to allow python modules to build properly on uncommonly supported architectures (like i686) - Documentation : Updated setup requirement to mention SSE4.2 requirement - Documentation : Updated faq with the full explanation for the SSE4.2 requirement and the reference to the mailu issue. --- core/base/Dockerfile | 6 +++--- docs/faq.rst | 13 +++++++++++++ docs/setup.rst | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/core/base/Dockerfile b/core/base/Dockerfile index 892faa9b..66462e18 100644 --- a/core/base/Dockerfile +++ b/core/base/Dockerfile @@ -15,7 +15,7 @@ RUN set -euxo pipefail \ ; addgroup -Sg ${MAILU_GID} mailu \ ; adduser -Sg ${MAILU_UID} -G mailu -h /app -g "mailu app" -s /bin/bash mailu \ ; apk add --no-cache bash ca-certificates curl python3 tzdata \ - ; ! [[ "$(uname -m)" == x86_64 ]] \ + ; ! [[ "$(apk --print-arch)" == x86_64 ]] \ || apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing hardened-malloc WORKDIR /app @@ -52,10 +52,10 @@ ENV \ SNUFFLEUPAGUS_URL="https://github.com/jvoisin/snuffleupagus/archive/refs/tags/v${SNUFFLEUPAGUS_VERSION}.tar.gz" RUN set -euxo pipefail \ - ; machine="$(uname -m)" \ + ; machine="$(apk --print-arch)" \ ; deps="build-base gcc libffi-dev python3-dev mariadb-dev" \ ; [[ "${machine}" != x86_64 ]] && \ - deps="${deps} cargo git libretls-dev mariadb-connector-c-dev postgresql-dev" \ + deps="${deps} rust cargo git libretls-dev mariadb-connector-c-dev postgresql-dev" \ ; apk add --virtual .build-deps ${deps} \ ; [[ "${machine}" == armv7* ]] && \ mkdir -p /root/.cargo/registry/index && \ diff --git a/docs/faq.rst b/docs/faq.rst index 5b4c153f..d0d2703b 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -996,3 +996,16 @@ If the admin container is `unable to connect to an external MariaDB database due MariaDB has no support for utf8mb4_0900_ai_ci which is the new default since MySQL version 8.0. .. _`unable to connect to an external MariaDB database due to incompatible collation`: https://github.com/Mailu/Mailu/issues/3449 + +Why is Rspamd giving me an "Illegal instruction" error ? +````````````````````````````````````````````````````````` + +On Linux amd64 (x84_64), if the antispam container is crashing and gives you an `Illegal instruction` error, you may have a CPU that lacks support of the ``SSE4.2`` instruction set. +The more modern and FOSS ``vectorscan`` library used by rspamd superseeded the now closed source Intel ``hyperscan`` library in Alpine Linux, and since August 2024 it requires the ``SSE4.2`` instruction set to work properly. + +Pre-2013 Intel Atom CPUs (Like N2800 or D425), Intel pre-Nehalem architectures and AMD pre-Bulldozer architectures does not support ``SSE4.2``. + +A workaround to this issue is to use a x86_32 (or i686) version of rspamd, because the ``vectorscan`` library is only used on 64-bit capable systems. +Note that this may stop working in the future, as 32-bit software support is being progressively dropped. + +*Issue reference:* `3713`_. diff --git a/docs/setup.rst b/docs/setup.rst index d8df0baa..8b3d7c42 100644 --- a/docs/setup.rst +++ b/docs/setup.rst @@ -22,6 +22,9 @@ linux/arm64v8 or linux/armv7 hardware, so it should run on pretty much any cloud server as long as enough power is provided. +On x86_64, check that your processor supports the ``SSE4.2`` instruction set. +For example, pre-2013 Intel Atom CPUs lacks ``SSE4.2`` support. See :ref:`faq`. + You should also have at least a DNS hostname and a DNS name for receiving emails. Some instructions are provided on the matter in the article :ref:`dns_setup`. From 12df485d3927711784504638130b74cdf9abed8f Mon Sep 17 00:00:00 2001 From: Vincent PARRES-GACON Date: Thu, 6 Feb 2025 11:44:57 +0100 Subject: [PATCH 2/3] Fix : Forgot issue reference link in faq.rst --- docs/faq.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/faq.rst b/docs/faq.rst index d0d2703b..9a47c6ad 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -1000,7 +1000,7 @@ MariaDB has no support for utf8mb4_0900_ai_ci which is the new default since MyS Why is Rspamd giving me an "Illegal instruction" error ? ````````````````````````````````````````````````````````` -On Linux amd64 (x84_64), if the antispam container is crashing and gives you an `Illegal instruction` error, you may have a CPU that lacks support of the ``SSE4.2`` instruction set. +On Linux amd64 (x84_64), if the antispam container is crashing and gives you an ``Illegal instruction`` error, you may have a CPU that lacks support of the ``SSE4.2`` instruction set. The more modern and FOSS ``vectorscan`` library used by rspamd superseeded the now closed source Intel ``hyperscan`` library in Alpine Linux, and since August 2024 it requires the ``SSE4.2`` instruction set to work properly. Pre-2013 Intel Atom CPUs (Like N2800 or D425), Intel pre-Nehalem architectures and AMD pre-Bulldozer architectures does not support ``SSE4.2``. @@ -1009,3 +1009,5 @@ A workaround to this issue is to use a x86_32 (or i686) version of rspamd, becau Note that this may stop working in the future, as 32-bit software support is being progressively dropped. *Issue reference:* `3713`_. + +.. _`3713`: https://github.com/Mailu/Mailu/issues/3713 From 45c4dd12a934f3901bc917b13e74ae5bae6971d5 Mon Sep 17 00:00:00 2001 From: Vincent PARRES-GACON Date: Mon, 10 Feb 2025 10:44:53 +0100 Subject: [PATCH 3/3] FAQ : Add a one liner command to help checking if platform is SSE4.2 capable --- docs/faq.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/faq.rst b/docs/faq.rst index 9a47c6ad..423cfc80 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -1003,7 +1003,10 @@ Why is Rspamd giving me an "Illegal instruction" error ? On Linux amd64 (x84_64), if the antispam container is crashing and gives you an ``Illegal instruction`` error, you may have a CPU that lacks support of the ``SSE4.2`` instruction set. The more modern and FOSS ``vectorscan`` library used by rspamd superseeded the now closed source Intel ``hyperscan`` library in Alpine Linux, and since August 2024 it requires the ``SSE4.2`` instruction set to work properly. -Pre-2013 Intel Atom CPUs (Like N2800 or D425), Intel pre-Nehalem architectures and AMD pre-Bulldozer architectures does not support ``SSE4.2``. +Pre-2013 Intel Atom CPUs (Like N2800 or D425), Intel pre-Nehalem architectures and AMD pre-Bulldozer architectures do not support ``SSE4.2``. +To check if your CPU supports ``SSE4.2`` you can use this one liner command: + +``if grep -q sse4_2 /proc/cpuinfo; then echo "CPU is SSE4.2 Capable"; else echo "CPU is NOT SSE4.2 capable"; fi`` A workaround to this issue is to use a x86_32 (or i686) version of rspamd, because the ``vectorscan`` library is only used on 64-bit capable systems. Note that this may stop working in the future, as 32-bit software support is being progressively dropped.