aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libmilter/default-pthread-stacksize.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/libmilter/default-pthread-stacksize.patch')
-rw-r--r--testing/libmilter/default-pthread-stacksize.patch20
1 files changed, 9 insertions, 11 deletions
diff --git a/testing/libmilter/default-pthread-stacksize.patch b/testing/libmilter/default-pthread-stacksize.patch
index 4e3524c230..9993adfece 100644
--- a/testing/libmilter/default-pthread-stacksize.patch
+++ b/testing/libmilter/default-pthread-stacksize.patch
@@ -1,15 +1,13 @@
-Set default pthread stack size to 8 MB
+Set default pthread stack size to 256 KB
-This patch tries to fix various crashes for applications depending on
-libmilter by setting the stack size for pthreads to 8 MB. The default
-stack size for musl libc is set to 80 KB whereas glibc has it set
-to 8 MB. This causes problems when a large amount of memory is
-allocated on the stack.
+This patch tries to fix various crashes for applications depending on libmilter
+by setting the stack size for pthreads to 256 KB. The default stack size for
+musl libc is set to 80 KB whereas glibc has it set to 8 MB. This causes problems
+when a large amount of memory is allocated on the stack.
-For example, opendkim allocates blocks of 64 KB multiple times, which
-causes libmilter (and therefore opendkim) to crash.
-Maybe a stack size of 1 MB or 2 MB would be sufficient, but as opendkim
-depends on the default glibc behavior, 8 MB should be safe.
+For example, opendkim allocates blocks of 64 KB multiple times, which causes
+libmilter (and therefore opendkim) to crash. For now, a stack size of 256 KB
+looks sufficient and makes opendkim stop crashing.
Fixes https://bugs.alpinelinux.org/issues/6360
@@ -37,7 +35,7 @@ Fixes https://bugs.alpinelinux.org/issues/6360
+int thread_create(pthread_t *ptid, void *(*wr) (void *), void *arg) {
+ pthread_attr_t attr;
+ pthread_attr_init(&attr);
-+ pthread_attr_setstacksize(&attr,8*1024*1024);
++ pthread_attr_setstacksize(&attr,256*1024);
+ return pthread_create(ptid, &attr, wr, arg);
+}