Crash on FreeBSD 14.4 with dovecot 2.4.5
Hi,
On a daily basis I see a anvil crash in my logs for dovecot 2.4.5 on FreeBSD. Not sure if this is a FreeBSD specific issue, a dovecot issue, or a configuration issue (this is the first system converted from 2.3 configuration syntax):
Sep 9 03:20:00 mail dovecot[53730]: anvil: Panic: file
anvil-connection.c: line 837: unreached
Sep 8 16:40:00 mail dovecot[53730]: anvil: Panic: file
anvil-connection.c: line 837: unreached
Sep 7 20:47:28 mail dovecot[6215]: anvil: Panic: file
anvil-connection.c: line 838 (anvil_connection_destroy): assertion
failed: (hash_conn == conn)
Sep 6 17:07:24 mail dovecot[96610]: anvil: Panic: file
anvil-connection.c: line 837: unreached
Sep 6 20:40:01 mail dovecot[96610]: anvil: Panic: file
anvil-connection.c: line 837: unreached
Sep 6 21:53:59 mail dovecot[96610]: anvil: Panic: file
anvil-connection.c: line 837: unreached
The "assertion failed" only happened once, but the "unreached" happen on a daily basis. About 20 minutes (more or less) after each crash I see also the following message:
Sep 8 16:56:32 mail dovecot[53730]: anvil: Error: connect limit: disconnection for unknown (pid=59834, user=xxxx, service=imap, ip=x.x.x.x, conn_guid=7925eb292e15a06abae9000050df13ba)
Can somebody please give me some pointers on how to solve or troubleshoot this?
Kind regards,
Frank
Hi,
On a daily basis I see a anvil crash in my logs for dovecot 2.4.5 on FreeBSD. Not sure if this is a FreeBSD specific issue, a dovecot issue, or a configuration issue (this is the first system converted from 2.3 configuration syntax):
Sep 9 03:20:00 mail dovecot[53730]: anvil: Panic: file
anvil-connection.c: line 837: unreached
Sep 8 16:40:00 mail dovecot[53730]: anvil: Panic: file
anvil-connection.c: line 837: unreached
Sep 7 20:47:28 mail dovecot[6215]: anvil: Panic: file
anvil-connection.c: line 838 (anvil_connection_destroy): assertion
failed: (hash_conn == conn)
Sep 6 17:07:24 mail dovecot[96610]: anvil: Panic: file
anvil-connection.c: line 837: unreached
Sep 6 20:40:01 mail dovecot[96610]: anvil: Panic: file
anvil-connection.c: line 837: unreached
Sep 6 21:53:59 mail dovecot[96610]: anvil: Panic: file
anvil-connection.c: line 837: unreached
The "assertion failed" only happened once, but the "unreached" happen on a daily basis. About 20 minutes (more or less) after each crash I see also the following message:
Sep 8 16:56:32 mail dovecot[53730]: anvil: Error: connect limit:
disconnection for unknown (pid=59834, user=xxxx, service=imap, ip=x.x.x.x, conn_guid=7925eb292e15a06abae9000050df13ba)
Can somebody please give me some pointers on how to solve or troubleshoot this?
Kind regards,
Frank
On a daily basis I see a anvil crash in my logs for dovecot 2.4.5 on > FreeBSD. Not sure if this is a FreeBSD specific issue, a dovecot > issue, or a configuration issue (this is the first system converted > from 2.3 configuration syntax): > Sep 9 03:20:00 mail dovecot[53730]: anvil: Panic: file > anvil-connection.c: line 837: unreached I just encountered this as well, as I noticed anvil had crashed in dmesg: pid 65360 (anvil), jid 0, uid 0: exited on signal 6 (no core dump - bad address) I am also running FreeBSD 14.4 and recently upgraded to 2.4 when the port became available. I do not believe this to be a configuration issue as I started with fresh configuration and applied options necessary to match my previous configuration.
Try the recent patch that was on the list. I reported an issue with it also. I have committed the patch to midnightbsd mports. https://github.com/MidnightBSD/mports/blob/master/mail/dovecot24/files/patch...
You could try grabbing it and building from freebsd ports with it added to files/
On 9/23/26 8:15 AM, Matthew Horan via dovecot wrote:
> On a daily basis I see a anvil crash in my logs for dovecot 2.4.5 on > FreeBSD. Not sure if this is a FreeBSD specific issue, a dovecot > issue, or a configuration issue (this is the first system converted > from 2.3 configuration syntax): > Sep 9 03:20:00 mail dovecot[53730]: anvil: Panic: file > anvil-connection.c: line 837: unreached I just encountered this as well, as I noticed anvil had crashed in dmesg: pid 65360 (anvil), jid 0, uid 0: exited on signal 6 (no core dump - bad address) I am also running FreeBSD 14.4 and recently upgraded to 2.4 when the port became available. I do not believe this to be a configuration issue as I started with fresh configuration and applied options necessary to match my previous configuration.
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
-- Lucas Holt Luke@FoolishGames.com
MidnightBSD.org (Free OS) JustJournal.com (Free blogging)
On Wed, Sep 23, 2026 at 09:36:39AM -0400, Lucas Holt wrote:
Try the recent patch that was on the list. I reported an issue with it also. I have committed the patch to midnightbsd mports. https://github.com/MidnightBSD/mports/blob/master/mail/dovecot24/files/patch...
You could try grabbing it and building from freebsd ports with it added to files/
Thanks! I just applied this and will keep an eye on things. My mail server is very low volume but this seems to have been happening every few days, so should know soon. Will prepare a patch for the ports tree as well.
Hi,
With the mentioned patch, the crashes stop happening. Let's hope the match makes it into the next dovecot release.
Kind regards,
Frank
Op 23-9-2026 om 15:36 schreef Lucas Holt via dovecot:
Try the recent patch that was on the list. I reported an issue with it also. I have committed the patch to midnightbsd mports. https://github.com/MidnightBSD/mports/blob/master/mail/dovecot24/files/patch...
You could try grabbing it and building from freebsd ports with it added to files/
On 9/23/26 8:15 AM, Matthew Horan via dovecot wrote:
> On a daily basis I see a anvil crash in my logs for dovecot 2.4.5 on > FreeBSD. Not sure if this is a FreeBSD specific issue, a dovecot
issue, or a configuration issue (this is the first system converted > from 2.3 configuration syntax): > Sep 9 03:20:00 mail dovecot[53730]: anvil: Panic: file > anvil-connection.c: line 837: unreached I just encountered this as well, as I noticed anvil had crashed in dmesg: pid 65360 (anvil), jid 0, uid 0: exited on signal 6 (no core dump - bad address) I am also running FreeBSD 14.4 and recently upgraded to 2.4 when the port became available. I do not believe this to be a configuration issue as I started with fresh configuration and applied options necessary to match my previous configuration.
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
With the mentioned patch, the crashes stop happening. Let's hope the match makes it into the next dovecot release.
As I went to prepare a patch to the FreeBSD port, I came across https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298769. This imports an upstream (Dovecot) patch that may also resolve the issue. I applied the patch and have no crashes in 24 hours.
Looking at the two patches, they both seem to address the crash (though the upstream Dovecot patch was originally prepared for another issue.) It seems the problem is with the net_getunixcred() differences across operating systems.
The previously mentioned patch makes net_getunixcred() work for FreeBSD whereas the committed patch bypasses net_getunixcred() to get the connection PID (which was the source of the anvil crash.)
There is other data in net_getunixcred() that will presumably be NULL but I'm not sure if that is an issue.
participants (4)
-
Frank Volf
-
Lucas Holt
-
Matt Horan
-
Matthew Horan