aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libmilter/default-pthread-stacksize.patch
diff options
context:
space:
mode:
authorStefan Wagner <stw@bit-strickerei.de>2016-11-07 12:06:52 +0100
committerJakub Jirutka <jakub@jirutka.cz>2016-11-07 13:55:48 +0100
commit2139016e4dd63047a251a0b252e43d79dcffcd64 (patch)
tree93b9da4b35b12d12d271c4e0411ed5a4381621b6 /testing/libmilter/default-pthread-stacksize.patch
parent76bd1baf8e87c784714de73e9c61725ca4b7ccb0 (diff)
downloadaports-2139016e4dd63047a251a0b252e43d79dcffcd64.tar.bz2
aports-2139016e4dd63047a251a0b252e43d79dcffcd64.tar.xz
testing/libmilter: set default pthread stack size to 256 KB
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);
+}