On 2014/09/21 16:06, list-openbsd-po...@jyborn.se wrote: > I get this in /var/log/maillog when I start mutt: > > Sep 21 13:21:27 xxx dovecot: imap(yyy): Fatal: > pool_system_realloc(4294967296): Out of memory > Sep 21 13:21:30 xxx dovecot: imap(yyy): Fatal: master: service(imap): child > 17371 returned error 83 (Out of memory (service imap { vsz_limit=4096 MB }, > you may need to increase it) - set CORE_OUTOFMEM=1 environment to get core > dump) > > And while mutt is trying to login, before dovecot reaches the memory > limit, the server freezes up completely with load average above 8. > > I have entered this line in /etc/dovecot/dovecot.conf, and tried > gradually increasing it from 256 M: > default_vsz_limit = 4096 M > > I also entered this in /etc/login.conf, as the pkg-readmes file states: > dovecot:\ > :openfiles-cur=4096:\ > :openfiles-max=4096:\ > :tc=daemon: > (As you can see I tried increasing those values as well.)
Dovecot's README also says : For larger servers these numbers and memory limits (e.g. datasize and stacksize) may also need to be increased. In particular, indexing emails for full-text search is likely to need an increased datasize. Are you using FTS? How are you starting Dovecot? This login.conf section will normally only be used if you are using the standard method in OpenBSD i.e. "/etc/rc.d/dovecot start" (or adding it to pkg_scripts and rebooting). Otherwise it will use whatever is applicable to the class of the user starting it. > I tried setting mmap_disable = no Don't do this, disabling mmap here is a required setting on OpenBSD, we do not have coherent mmap/read/write. > I would prefer to keep using dovecot if possible, it has been very stable in > FreeBSD. It's very stable for me on OpenBSD. I don't use vsz_limit in Dovecot config, and have this in login.conf (though you may want to reduce "infinity"). :datasize=infinity:\ :openfiles-cur=1500:\ :openfiles-max=2048:\ Ohhhh..... Just had a thought. You don't mention which versions of anything you're using (hint: it's always a good idea to include dmesg!) but if it's OpenBSD 5.5 then the diff below (or pull up getpwent.c to r1.49) might well help. Index: src/lib/libc/gen/getpwent.c diff -u src/lib/libc/gen/getpwent.c:1.48 src/lib/libc/gen/getpwent.c:1.49 --- src/lib/libc/gen/getpwent.c:1.48 Fri Nov 15 22:32:55 2013 +++ src/lib/libc/gen/getpwent.c Wed Mar 5 23:44:47 2014 @@ -1,4 +1,4 @@ -/* $OpenBSD: getpwent.c,v 1.48 2013/11/15 22:32:55 benno Exp $ */ +/* $OpenBSD: getpwent.c,v 1.49 2014/03/05 23:44:47 schwarze Exp $ */ /* * Copyright (c) 2008 Theo de Raadt * Copyright (c) 1988, 1993 @@ -708,8 +708,12 @@ { struct passwd *pwret = NULL; int flags = 0, *flagsp; + int my_errno = 0; + int saved_errno; _THREAD_PRIVATE_MUTEX_LOCK(pw); + saved_errno = errno; + errno = 0; if (!_pw_db && !__initdb()) goto fail; @@ -733,8 +737,12 @@ fail: if (pwretp) *pwretp = pwret; + if (pwret == NULL) + my_errno = errno; + if (!errno) + errno = saved_errno; _THREAD_PRIVATE_MUTEX_UNLOCK(pw); - return (pwret ? 0 : 1); + return (my_errno); } struct passwd * @@ -753,8 +761,12 @@ { struct passwd *pwret = NULL; int flags = 0, *flagsp; + int my_errno = 0; + int saved_errno; _THREAD_PRIVATE_MUTEX_LOCK(pw); + saved_errno = errno; + errno = 0; if (!_pw_db && !__initdb()) goto fail; @@ -778,8 +790,12 @@ fail: if (pwretp) *pwretp = pwret; + if (pwret == NULL) + my_errno = errno; + if (!errno) + errno = saved_errno; _THREAD_PRIVATE_MUTEX_UNLOCK(pw); - return (pwret ? 0 : 1); + return (my_errno); } struct passwd *