Skip to content
  • Stefan Wagner's avatar
    testing/libmilter: set default pthread stack size to 8 MB · 95724d1b
    Stefan Wagner authored and Jakub Jirutka's avatar Jakub Jirutka committed
    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.
    
    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.
    
    I know this patch is kind of ugly, a better solution may be to file
    a request for opendkim to allocate large blocks of memory on the heap.
    But as libmilter/opendkim are fairly unusable at the moment, I suggest
    to apply this patch as long as these packages are in testing.
    
    Fixes https://bugs.alpinelinux.org/issues/6360
    95724d1b