for FreeBSD you can add to /etc/make.conf:
WITH_DEBUG_PORTS=mail/dovecot mail/dovecot-pigeonhole

and rebuild the packages. 
(from the FreeBSD port maintainer, me).

On Mon, Feb 11, 2019 at 10:31 AM Stephan Bosch via dovecot <dovecot@dovecot.org> wrote:


Op 9-2-2019 om 19:27 schreef Giacomo via dovecot:
> I got a core file this morning.
>
> opening it with gdb I get this:
>
> (gdb) core imap.core
> Core was generated by `dovecot/imap'.
> Program terminated with signal 6, Aborted.
> #0  0x0000000011c1347a in ?? ()
> (gdb) bt
> #0  0x0000000011c1347a in ?? ()
> #1  0x0000000011c13444 in ?? ()
> #2  0x0000000000018dee in ?? ()
> #3  0x306db139575f3b0d in ?? ()
> #4  0x00007fffffffc144 in ?? ()
> #5  0x0000000000000000 in ?? ()
>
> Doesn't look clean at all.

That is not that helpful. Did you install debug symbols for Dovecot?
This is usually a separate package. It all depends on your OS. I am not
familiar with FreeBSD.

Regards,

Stephan.

>
> let me know if I should upload the file somewhere.
>
> Thanks
>
> Il giorno lun 21 gen 2019 alle ore 08:52 Giacomo
> <giacomo1989@gmail.com <mailto:giacomo1989@gmail.com>> ha scritto:
>
>     I've just enabled core dumps on the involved FreeBSD system. Let's
>     see if it dumps something..
>
>     Il giorno dom 20 gen 2019 alle ore 19:16 Stephan Bosch
>     <stephan@rename-it.nl <mailto:stephan@rename-it.nl>> ha scritto:
>
>         Hi Giacomo,
>
>         Op 21/12/2018 om 16:16 schreef Giacomo:
>         > The bug happens not very often, it might need a week to get
>         a core file.
>
>         Any luck getting a core file?
>
>         Regards,
>
>         Stephan.
>         >
>         >
>         > Il giorno ven 21 dic 2018 alle ore 15:18 Aki Tuomi
>         > <aki.tuomi@open-xchange.com
>         <mailto:aki.tuomi@open-xchange.com>
>         <mailto:aki.tuomi@open-xchange.com
>         <mailto:aki.tuomi@open-xchange.com>>> ha
>         > scritto:
>         >
>         >
>         >     On 21.12.2018 14.49, Giacomo wrote:
>         >     > I'm running the following:
>         >     >
>         >     > # 2.3.4 (0ecbaf23d): /usr/local/etc/dovecot/dovecot.conf
>         >     > # OS: FreeBSD 11.2-RELEASE-p4 amd64
>         >     > # FS: ZFS
>         >     >
>         >     > auth_mechanisms = plain login
>         >     > auth_username_format = %Ln
>         >     > listen = *
>         >     > mail_location = maildir:~/Maildir
>         >     > namespace inbox {
>         >     >   inbox = yes
>         >     >   location =
>         >     >   mailbox Drafts {
>         >     >     auto = subscribe
>         >     >     special_use = \Drafts
>         >     >   }
>         >     >   mailbox Junk {
>         >     >     auto = subscribe
>         >     >     special_use = \Junk
>         >     >   }
>         >     >   mailbox Sent {
>         >     >     special_use = \Sent
>         >     >   }
>         >     >   mailbox Trash {
>         >     >     auto = subscribe
>         >     >     special_use = \Trash
>         >     >   }
>         >     >   prefix =
>         >     > }
>         >     > passdb {
>         >     >   driver = pam
>         >     > }
>         >     > protocols = imap lmtp
>         >     > service auth {
>         >     >   unix_listener /var/spool/postfix/private/auth {
>         >     >     group = postfix
>         >     >     mode = 0666
>         >     >     user = postfix
>         >     >   }
>         >     >   user = dovecot
>         >     > }
>         >     > service imap-login {
>         >     >   inet_listener imap {
>         >     >     port = 0
>         >     >   }
>         >     > }
>         >     > service lmtp {
>         >     >   unix_listener /var/spool/postfix/private/dovecot-lmtp {
>         >     >     group = postfix
>         >     >     mode = 0600
>         >     >     user = postfix
>         >     >   }
>         >     > }
>         >     > service stats {
>         >     >   unix_listener stats-reader {
>         >     >     group =
>         >     >     mode = 0600
>         >     >     user =
>         >     >   }
>         >     >   unix_listener stats-writer {
>         >     >     group = $default_internal_group
>         >     >     mode = 0666
>         >     >     user =
>         >     >   }
>         >     >   user = $default_internal_user
>         >     > }
>         >     > ssl_cert = </root/cert.pem
>         >     > ssl_key = # hidden, use -P to show it
>         >     > userdb {
>         >     >   driver = passwd
>         >     > }
>         >     >
>         >     > dmesg shows:
>         >     >
>         >     > pid 74441 (imap), uid 1002: exited on signal 6
>         >     > pid 74784 (imap), uid 1002: exited on signal 6
>         >     > pid 21471 (imap), uid 1002: exited on signal 6
>         >     > pid 21470 (imap), uid 1002: exited on signal 6
>         >     > pid 21464 (imap), uid 1002: exited on signal 6
>         >     > pid 21731 (imap), uid 1002: exited on signal 6
>         >     >
>         >     > Sometimes the dovecot process serving an user crashes.
>         He runs
>         >     mostly
>         >     > airmail on macOS and samsung mail on Android.
>         >     >
>         >     > Happens only to that particular user.
>         >     >
>         >     > The log shows the following: (maillog)
>         >     >
>         >     > Dec 16 14:52:35 mail dovecot: imap-login: Login:
>         user=<USER>,
>         >     > method=PLAIN, rip=79.12.201.157, lip=192.168.1.28,
>         mpid=74779, TLS,
>         >     > session=<wMQI+iN9VtRPDMmd>
>         >     > Dec 16 14:52:39 mail dovecot:
>         imap(USER)<74441><nLa+7SN9+fhPDMmd>:
>         >     > Panic: file charset-iconv.c: line 83
>         (charset_to_utf8_try):
>         >     assertion
>         >     > failed: (srcleft <= CHARSET_MAX_PENDING_BUF_SIZE)
>         >     > Dec 16 14:52:39 mail dovecot:
>         imap(USER)<74441><nLa+7SN9+fhPDMmd>:
>         >     > Fatal: master: service(imap): child 74441 killed with
>         signal 6 (core
>         >     > not dumped -
>         https://dovecot.org/bugreport.html#coredumps - set
>         >     > service imap { drop_priv_before_exec=yes })
>         >     >
>         >     > I'm here if more info is needed.
>         >     >
>         >     > Thanks for taking a look.
>         >
>         >
>         >     Can you somehow get a core file and get backtrace from it?
>         >
>         >
>         >     Aki
>         >
>



--
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 214-642-9640 (c)     E-Mail: larryrtx@gmail.com
US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106