Hello.

After upgrade from FreeBSD 11 to FreeBSD 12 and Dovecot 2.2 to Dovecot 2.3 hanged auth when user connected to imap:

Jan 10 15:53:46 master: Info: Dovecot v2.3.4 (0ecbaf23d) starting up for imap, pop3
Jan 10 15:54:09 auth-worker: Fatal: master: service(auth-worker): child 56308 killed with signal 11 (core dumped)
Jan 10 15:54:09 master: Error: service(auth-worker): command startup failed, throttling for 2 secs
Jan 10 15:54:09 auth: Error: auth worker: Aborted PASSV request for roman@host.ru: Worker process died unexpectedly
Jan 10 15:54:11 imap-login: Info: Disconnected (auth service reported temporary failure): user=<roman@host.ru>, method=PLAIN, rip=xxx.xxx.xxx.xxx, lip=yyy.yyy.yyy.yyy, TLS: Connection closed, session=<MKjHEhp/afAl666T>

dump:

user@host:/var # gdb /usr/local/libexec/dovecot/auth /var/coredumps/auth.core
GNU gdb (GDB) 8.2 [GDB v8.2 for FreeBSD]
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd12.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/libexec/dovecot/auth...done.
[New LWP 100153]
Core was generated by `dovecot/auth -w'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  strcmp () at /usr/src/lib/libc/amd64/string/strcmp.S:46
46              movq    8(%rdi),%rax
(gdb) bt full
#0  strcmp () at /usr/src/lib/libc/amd64/string/strcmp.S:46
No locals.
#1  0x0000000011a0c5dd in lh_insert () from /usr/local/lib/libcrypto.so.9
No symbol table info available.
#2  0x000000001192d92e in OBJ_NAME_add () from /usr/local/lib/libcrypto.so.9
No symbol table info available.
#3  0x0000000012306c4d in openssl_add_all_ciphers_int () at /usr/src/crypto/openssl/crypto/evp/c_allc.c:83
No locals.
#4  0x0000000012306579 in ossl_init_add_all_ciphers () at /usr/src/crypto/openssl/crypto/init.c:216
No locals.
#5  ossl_init_add_all_ciphers_ossl_ () at /usr/src/crypto/openssl/crypto/init.c:205
No locals.
#6  0x0000000011bfde28 in _pthread_once (once_control=0x123863b0, init_routine=0x12306570 <ossl_init_add_all_ciphers_ossl_>) at /usr/src/lib/libthr/thread/thr_once.c:97
        __cup = <optimized out>
        curthread = 0x1250d000
        state = <optimized out>
#7  0x0000000012305c29 in CRYPTO_THREAD_run_once (once=0xfffffffffffffff8, init=0xfffffffffffffff8) at /usr/src/crypto/openssl/crypto/threads_pthread.c:113
No locals.
#8  0x0000000012306027 in OPENSSL_init_crypto (opts=76, settings=0x0) at /usr/src/crypto/openssl/crypto/init.c:611
        ret = <optimized out>
#9  0x000000001207db7d in OPENSSL_init_ssl (opts=0, settings=0xfffffffffffffff8) at /usr/src/crypto/openssl/ssl/ssl_init.c:197
        stoperrset = <error reading variable stoperrset (Cannot access memory at address 0x0)>
#10 0x000000001173525f in ssl_start () from /usr/local/lib/mysql/libmysqlclient.so.20
No symbol table info available.
#11 0x00000000116f112f in mysql_server_init () from /usr/local/lib/mysql/libmysqlclient.so.20
No symbol table info available.
#12 0x000000001171a607 in mysql_init () from /usr/local/lib/mysql/libmysqlclient.so.20
No symbol table info available.
#13 0x00000000010a25eb in driver_mysql_connect (_db=0x12540048) at driver-mysql.c:93
        db = 0x12540048
        unix_socket = 0x0
        host = 0x5c3746e5 <error: Cannot access memory at address 0x5c3746e5>
        client_flags = 0
        secs_used = 0
        start_time = 140737488349440
        failed = false
#14 0x000000000109d851 in sql_connect (db=0x12540048) at sql-api.c:149
        now = 1547126501
#15 0x00000000010a011f in driver_sqlpool_connect (_db=0x12590000) at driver-sqlpool.c:575
        conn__foreach_end = 0x1252d290
        db = 0x12590000
        conn = 0x1252d280
        ret = -1
        ret2 = 0
#16 0x000000000109d851 in sql_connect (db=0x12590000) at sql-api.c:149
        now = 1547126501
#17 0x0000000001087349 in db_sql_connect (conn=0x1253fc48) at db-sql.c:140
No locals.
#18 0x0000000001086249 in passdb_sql_init (_module=0x125609d0) at passdb-sql.c:286
        module = 0x125609d0
        flags = (SQL_DB_FLAG_BLOCKING | SQL_DB_FLAG_POOLED)
#19 0x0000000001079c57 in passdb_init (passdb=0x125609d0) at passdb.c:248
No locals.
#20 0x0000000001050b19 in auth_passdb_init (passdb=0x125608f0) at auth.c:306
No locals.
#21 0x000000000104feec in auth_init (auth=0x125608b8) at auth.c:320
        passdb = 0x125608f0
        userdb = 0x106bf42 <array_create_i+66>
#22 0x000000000104fe6c in auths_init () at auth.c:425
        auth__foreach_end = 0x12532148
        auth = 0x12532140
#23 0x000000000104e832 in main_init () at main.c:245
No locals.
#24 0x000000000104e563 in main (argc=2, argv=0x7fffffffeb60) at main.c:394
        c = -1
(gdb)

Configuration:

user@host:~ # dovecot -n
# 2.3.4 (0ecbaf23d): /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 12.0-STABLE amd64
# Hostname: host.ru
auth_mechanisms = plain login
base_dir = /var/run/dovecot/
first_valid_uid = 1
last_valid_gid = 5000
last_valid_uid = 5000
log_path = /var/log/dovecot.log
mail_gid = 90
mail_location = maildir:~/Maildir
mail_uid = 90
namespace inbox {
  inbox = yes
  location =
  prefix =
}
passdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocols = imap pop3
service auth-worker {
  drop_priv_before_exec = yes
}
service imap-login {
  inet_listener imap {
    port = 0
  }
}
service pop3-login {
  inet_listener pop3 {
    port = 0
  }
}
ssl_cert = </usr/local/etc/ssl/host.ru/certs/fullchain.pem
ssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
userdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocol imap {
  mail_plugins = quota imap_quota
}
protocol pop3 {
  mail_plugins = quota
}
user@host:~ #

user@host:~ # openssl version
OpenSSL 1.1.1a-freebsd  20 Nov 2018
user@host:~ #

Why this can be?