From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C035C158020 for ; Tue, 15 Nov 2022 00:56:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 564ACE08CA; Tue, 15 Nov 2022 00:56:42 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2AB00E08CA for ; Tue, 15 Nov 2022 00:56:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 04252340C15 for ; Tue, 15 Nov 2022 00:56:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5D5B6738 for ; Tue, 15 Nov 2022 00:56:39 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1668473779.1d2bf9e530d455d9d2e4b318d33c411ffb9e36f5.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/, mail-filter/rspamd/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: mail-filter/rspamd/files/rspamd-3.4-hyperscan-page-alignment.patch mail-filter/rspamd/rspamd-3.4-r1.ebuild mail-filter/rspamd/rspamd-3.4.ebuild X-VCS-Directories: mail-filter/rspamd/files/ mail-filter/rspamd/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 1d2bf9e530d455d9d2e4b318d33c411ffb9e36f5 X-VCS-Branch: master Date: Tue, 15 Nov 2022 00:56:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 86b71adb-857d-49c6-ac63-c13b1cddef9d X-Archives-Hash: c730a8c9a89761acaf6cd8b3626a8c03 commit: 1d2bf9e530d455d9d2e4b318d33c411ffb9e36f5 Author: Petr Vaněk atlas cz> AuthorDate: Mon Nov 14 14:05:09 2022 +0000 Commit: Sam James gentoo org> CommitDate: Tue Nov 15 00:56:19 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d2bf9e5 mail-filter/rspamd: fix page-alignment of .unser files This revision applies patch taken from upstream [1] which fixes page-alignment issue of .unser files causing segfaults. The issue affects only those who already started rspamd-3.4. All .unser files will be automatically removed in postinstall phase for those who are updating from 3.4 to 3.4-r1. [1] https://github.com/rspamd/rspamd/issues/4329 Signed-off-by: Petr Vaněk atlas.cz> Closes: https://github.com/gentoo/gentoo/pull/28263 Signed-off-by: Sam James gentoo.org> .../rspamd-3.4-hyperscan-page-alignment.patch | 28 ++++++++++++++++++++++ .../{rspamd-3.4.ebuild => rspamd-3.4-r1.ebuild} | 13 ++++++++++ 2 files changed, 41 insertions(+) diff --git a/mail-filter/rspamd/files/rspamd-3.4-hyperscan-page-alignment.patch b/mail-filter/rspamd/files/rspamd-3.4-hyperscan-page-alignment.patch new file mode 100644 index 000000000000..913f1f7ecd4d --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-3.4-hyperscan-page-alignment.patch @@ -0,0 +1,28 @@ +Fix for hyperscan page alignment issues. + +Upstream-Issue: https://github.com/rspamd/rspamd/issues/4329 + +diff --git a/src/libserver/hyperscan_tools.cxx b/src/libserver/hyperscan_tools.cxx +index 6187208a9..96366067d 100644 +--- a/src/libserver/hyperscan_tools.cxx ++++ b/src/libserver/hyperscan_tools.cxx +@@ -306,7 +306,15 @@ auto load_cached_hs_file(const char *fname, std::int64_t offset = 0) -> tl::expe + msg_debug_hyperscan_lambda("multipattern: create new database in %s; %Hz size", + tmpfile_pattern.data(), unserialized_size); + void *buf; +- posix_memalign(&buf, 16, unserialized_size); ++#ifdef HAVE_GETPAGESIZE ++ auto page_size = getpagesize(); ++#else ++ auto page_size = sysconf(_SC_PAGESIZE); ++#endif ++ if (page_size == -1) { ++ page_size = 4096; ++ } ++ posix_memalign(&buf, page_size, unserialized_size); + if (buf == nullptr) { + return tl::make_unexpected(error {"Cannot allocate memory", errno, error_category::CRITICAL }); + } +-- +2.37.4 + diff --git a/mail-filter/rspamd/rspamd-3.4.ebuild b/mail-filter/rspamd/rspamd-3.4-r1.ebuild similarity index 83% rename from mail-filter/rspamd/rspamd-3.4.ebuild rename to mail-filter/rspamd/rspamd-3.4-r1.ebuild index cb1d4e71df63..fc1664f05a6d 100644 --- a/mail-filter/rspamd/rspamd-3.4.ebuild +++ b/mail-filter/rspamd/rspamd-3.4-r1.ebuild @@ -71,6 +71,7 @@ PATCHES=( "${FILESDIR}/${PN}-3.2-unbundle-lua.patch" "${FILESDIR}/${PN}-2.5-unbundle-snowball.patch" "${FILESDIR}/${PN}-3.3-remove-test-case.patch" + "${FILESDIR}/${PN}-3.4-hyperscan-page-alignment.patch" ) src_prepare() { @@ -133,4 +134,16 @@ src_install() { pkg_postinst() { tmpfiles_process "${PN}.conf" + + for ver in ${REPLACING_VERSIONS}; do + if ver_test "${ver}" -eq "3.4"; then + elog "rspamd-3.4 is known to segfault when it is updated from older version due" + elog "to a page-alignment of hyperscan .unser files. The issue is patched in this" + elog "ebuild revision rspamd-3.4-r1. All possibly broken .unser files will be" + elog "automaticaly removed. See https://github.com/rspamd/rspamd/issues/4329 for" + elog "more information." + + find "${EROOT}/var/lib/rspamd" -type f -name '*.unser' -delete + fi + done }