Bug#1053343: e2guardian: wrong default config file on 32-bit archs, fails to start

Steve Langasek steve.langasek at canonical.com
Mon Oct 2 08:55:30 BST 2023


Package: e2guardian
Version: 5.3.5-4.1
Severity: important
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu mantic ubuntu-patch

Dear maintainers,

Attempting to deploy e2guardian on an Ubuntu 20.04 armhf system, I found
that the service was failing to start with a SIGABRT when trying to spawn a
thread.  Painfully tracking this down through the code, I discovered that it
defaulted to trying to spawn 500 worker threads.

And the default config file says not to do this on 32-bit archs, because
it's too many.

Considering e2guardian.conf is generated at build-time ANYWAY, there's no
good reason not to have the default httpworkers value set to something
appropriate for the architecture the package is built on.

Please see the attached patch.

Thanks for considering,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru e2guardian-5.3.5/debian/patches/32-bit-correct-worker-count.patch e2guardian-5.3.5/debian/patches/32-bit-correct-worker-count.patch
--- e2guardian-5.3.5/debian/patches/32-bit-correct-worker-count.patch	1969-12-31 16:00:00.000000000 -0800
+++ e2guardian-5.3.5/debian/patches/32-bit-correct-worker-count.patch	2023-10-02 00:12:39.000000000 -0700
@@ -0,0 +1,44 @@
+Description: automatically set correct worker count on 32-bit archs
+ The upstream e2guardian.conf has a message telling users they need to
+ adjust the default number of http workers on 32-bit systems.  Instead
+ we should just do this automatically.
+ .
+ Ideally this would be done at runtime by the program itself, and the 
+ default value could simply be commented out.
+Author: Steve Langasek <steve.langasek at ubuntu.com>
+Forwarded: no
+Last-Update: 2023-10-02
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2037958
+
+Index: e2guardian/configs/e2guardian.conf.in
+===================================================================
+--- e2guardian.orig/configs/e2guardian.conf.in
++++ e2guardian/configs/e2guardian.conf.in
+@@ -577,7 +577,7 @@
+ # On 32-bit systems reduce this to 300 to avoid exceeding the <4GB
+ # virtual memory limit and on Linux decrease the thread stack size from
+ # 10MB to 2MB (ulimit -s 2048)
+-httpworkers = 500 
++httpworkers = @httpworkers@
+ 
+ # Process options
+ # (Change these only if you really know what you are doing).
+Index: e2guardian/configure.ac
+===================================================================
+--- e2guardian.orig/configure.ac
++++ e2guardian/configure.ac
+@@ -675,6 +675,14 @@
+ AC_FINALIZE_VAR(DGCONFFILE,"${dgsysconfdir}/${PACKAGE_NAME}.conf")
+ AC_SUBST(DGCONFFILE)
+ 
++AC_CHECK_SIZEOF([void *])
++if test $ac_cv_sizeof_void_p = 8; then
++    httpworkers=500
++else
++    httpworkers=300
++fi
++AC_SUBST(httpworkers, "$httpworkers")
++
+ AC_CONFIG_FILES([Makefile
+ data/Makefile
+ data/languages/Makefile
diff -Nru e2guardian-5.3.5/debian/patches/series e2guardian-5.3.5/debian/patches/series
--- e2guardian-5.3.5/debian/patches/series	2023-08-30 01:40:56.000000000 -0700
+++ e2guardian-5.3.5/debian/patches/series	2023-10-01 23:58:06.000000000 -0700
@@ -5,3 +5,4 @@
 0001_CVE-2021-44273_fix-hostname-validation-in-certificates.patch
 0002_uint32-ListContainer.cpp.patch
 0003_uint32-ListContainer.hpp.patch
+32-bit-correct-worker-count.patch


More information about the Debian-edu-pkg-team mailing list