Burak Seydioglu
2016-Apr-26 01:04 UTC
doveadm-server segfaults when searching or expunging with the -A flag
Hello, I have an openldap backend that contains a large number of users and serves passdb and userdb requests. I was trying to work around the pop3 deletion issue that I had reported earlier (http://www.dovecot.org/list/dovecot/2016-April/103973.html) with the pop3_deleted_flag setting so I updated my configuration and created some background jobs to expunge deleted emails. However, doveadm-server segfaults when running search or expunge commands with the -A flag: doveadm search mailbox INBOX KEYWORD '$Pop3Deleted' -A doveadm expunge mailbox INBOX KEYWORD '$Pop3Deleted' -A ###################################### gdb /usr/libexec/dovecot/doveadm-server /var/crash/core-doveadm-server-11-0-0-2589-1461628665 #0 o_stream_cork (stream=0x0) at ostream.c:141 #1 0x0000000000430193 in server_connection_output (conn=0xfe10e0) at server-connection.c:126 #2 0x00007fcde9fc80c7 in plain_flush_callback (sstream=0xfdacf0) at ostream-openssl.c:180 #3 0x00007fcdeb6f9929 in stream_send_io (fstream=0xfe65e0) at ostream-file.c:482 #4 0x00007fcdeb6ebceb in io_loop_call_io (io=0xfdb110) at ioloop.c:564 #5 0x00007fcdeb6ed2e7 in io_loop_handler_run_internal (ioloop=<value optimized out>) at ioloop-epoll.c:220 #6 0x00007fcdeb6ebd95 in io_loop_handler_run (ioloop=0xfdf4b0) at ioloop.c:612 #7 0x00007fcdeb6ebf38 in io_loop_run (ioloop=0xfdf4b0) at ioloop.c:588 #8 0x000000000041f542 in dsync_connect_tcp (ctx=0xfc7d70, mail_set=<value optimized out>, target=<value optimized out>, ssl=true, error_r=0x7ffde6127020) at doveadm-dsync.c:806 #9 0x000000000041ff95 in parse_location (_ctx=0xfc7d70, service_user=<value optimized out>, error_r=0x7ffde6127020) at doveadm-dsync.c:837 #10 cmd_dsync_prerun (_ctx=0xfc7d70, service_user=<value optimized out>, error_r=0x7ffde6127020) at doveadm-dsync.c:903 #11 0x00000000004205f2 in doveadm_mail_next_user (ctx=0xfc7d70, cctx=<value optimized out>, error_r=0x7ffde6127020) at doveadm-mail.c:383 #12 0x000000000043151f in doveadm_mail_cmd_server_run (conn=0xfc3950) at client-connection.c:183 #13 doveadm_cmd_handle (conn=0xfc3950) at client-connection.c:266 #14 client_handle_command (conn=0xfc3950) at client-connection.c:330 #15 client_connection_input (conn=0xfc3950) at client-connection.c:444 #16 0x00007fcdeb6ebceb in io_loop_call_io (io=0xfc34f0) at ioloop.c:564 #17 0x00007fcdeb6ed2e7 in io_loop_handler_run_internal (ioloop=<value optimized out>) at ioloop-epoll.c:220 #18 0x00007fcdeb6ebd95 in io_loop_handler_run (ioloop=0xf90780) at ioloop.c:612 #19 0x00007fcdeb6ebf38 in io_loop_run (ioloop=0xf90780) at ioloop.c:588 #20 0x00007fcdeb684753 in master_service_run (service=0xf90620, callback=<value optimized out>) at master-service.c:640 #21 0x0000000000433897 in main (argc=1, argv=0xf903a0) at main.c:126 ###################################### Dovecot version ###################################### dovecot --version 2.2.23 (806d709) ###################################### doveconf -n ###################################### # 2.2.23 (806d709): /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-573.22.1.el6.x86_64 x86_64 CentOS release 6.7 (Final) auth_debug = yes auth_mechanisms = plain login auth_verbose = yes base_dir = /var/run/dovecot/ disable_plaintext_auth = no doveadm_password = # hidden, use -P to show it first_valid_uid = 89 last_valid_uid = 89 login_greeting = Dovecot ready on mda01.dc1.domain.com. login_trusted_networks = 127.0.0.1 mail_debug = yes mail_gid = 89 mail_plugins = " notify replication" mail_uid = 89 mbox_write_locks = fcntl namespace inbox { inbox = yes location mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { special_use = \Trash } prefix } passdb { args = /etc/dovecot/conf.d/dovecot-ldap-passdb.conf.ext driver = ldap } plugin { mail_replica = tcps:mdareplica:12345 } pop3_deleted_flag = $POP3Deleted protocols = pop3 lmtp replication_full_sync_interval = 3 hours replication_max_conns = 20 service aggregator { fifo_listener replication-notify-fifo { group = postfix mode = 0640 user = postfix } unix_listener replication-notify { group = postfix mode = 0640 user = postfix } } service auth { unix_listener auth { mode = 0660 } } service doveadm { inet_listener { port = 12345 ssl = yes } } service lmtp { process_min_avail = 10 unix_listener lmtp { group = postfix mode = 0640 user = postfix } } service replicator { process_min_avail = 1 unix_listener replicator-doveadm { group = postfix mode = 0640 user = postfix } } ssl_cert = </etc/pki/tls/certs/dovecot.crt ssl_client_ca_file = /etc/pki/tls/CA/dovecot.bundle ssl_key = </etc/pki/tls/private/dovecot.key ssl_prefer_server_ciphers = yes userdb { driver = prefetch } userdb { args = /etc/dovecot/conf.d/dovecot-ldap-userdb.conf.ext driver = ldap } protocol lmtp { mail_plugins = " notify replication" } ###################################### LDAP configuration ###################################### cat /etc/dovecot/conf.d/dovecot-ldap-userdb.conf.ext hosts = localhost dn = cn=dovecot,dc=csi,dc=domain,dc=com dnpass = xxx ldap_version = 3 base = ou=instances,dc=csi,dc=domain,dc=com deref = never scope = subtree user_attrs = \ =home=/glide/mail/spool/%{ldap:uid}, \ =mail=maildir:/glide/mail/spool/%{ldap:maildrop} user_filter = (&(objectClass=mailUser)(uid=%n)) iterate_attrs = uid=user iterate_filter = (objectClass=mailUser) cat /etc/dovecot/conf.d/dovecot-ldap-passdb.conf.ext hosts = localhost dn = cn=dovecot,dc=csi,dc=domain,dc=com dnpass = xxx ldap_version = 3 base = ou=instances,dc=csi,dc=domain,dc=com deref = never scope = subtree pass_attrs = uid=user,userPassword=password, \ =userdb_home=/glide/mail/spool/%{ldap:uid}, \ =userdb_mail=maildir:/glide/mail/spool/%{ldap:maildrop} pass_filter = (&(objectClass=inetLocalMailRecipient)(uid=%n)) ###################################### Only interesting thing from the debug logs is a prefetch related entry: ###################################### Apr 25 17:31:22 mda01 dovecot: auth: Debug: master in: USER#01119118#011dev13654#011service=doveadm Apr 25 17:31:22 mda01 dovecot: auth: Debug: prefetch(dev13654): passdb didn't return userdb entries, trying the next userdb Apr 25 17:31:22 mda01 dovecot: auth: Debug: ldap(dev13654): user search: base=ou=instances,dc=csi,dc=domain,dc=com scope=subtree filter=(&(objectClass=mailUser)(uid=dev13654)) fields=uid,maildrop Apr 25 17:31:22 mda01 dovecot: auth: Debug: ldap(dev13654): result: uid=dev13654 maildrop=dev13654/maildir/; maildrop,uid unused Apr 25 17:31:22 mda01 dovecot: auth: Debug: ldap(dev13654): result: uid=dev13654 maildrop=dev13654/maildir/ Apr 25 17:31:22 mda01 dovecot: auth: Debug: userdb out: USER#01119118#011dev13654#011home=/glide/mail/spool/dev13654#011mail=maildir:/glide/mail/spool/dev13654/maildir/ ######################################