[Dovecot] Segfault when deselecting virtual folder 2.2.13+ HG TIP

Colin Knox colin at theknoxes.co.uk
Fri May 16 13:33:45 UTC 2014


Hello,

I'm seeing a segfault in the imap process with the current mercurial tip 
(including changeset 17382 e99cd21e1f92) when selecting a particular 
virtual mail folder (but no other virtual mailboxes) and then selecting 
a different mail folder as in the IMAP transcript below. The same 
segfaults are triggered with IMAP clients. The situation is worse with 
the 2.2.13 which segfaults when any virtual mailbox is deselected so the 
recent patch helps partially.

Configuration summary, IMAP session in gbd including backtrace and 
virtual mailbox spec follow.

Any ideas what's causing this?

Thank you
Colin

=======
GDB SESSION INCLUDING BACKTRACE
=======
colin at xxxx [ ~ ]$ MAIL=maildir:/var/mail/colin gdb 
/usr/local/libexec/dovecot/imap
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 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-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/libexec/dovecot/imap...done.
(gdb) r
Starting program: /usr/local/libexec/dovecot/imap
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
process 21455 is executing new program: /usr/local/bin/doveconf
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
process 21455 is executing new program: /usr/local/libexec/dovecot/imap
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
* PREAUTH [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID 
ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS 
THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN 
NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH 
ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE BINARY 
MOVE SEARCH=FUZZY NOTIFY METADATA] Logged in as colin
a SELECT PERSONAL.Home
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] 
Flags permitted.
* 23 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1261140830] UIDs valid
* OK [UIDNEXT 24] Predicted next UID
* OK [HIGHESTMODSEQ 1] Highest
a OK [READ-WRITE] Select completed (0.001 secs).
a SELECT virtual.Conversations
* OK [CLOSED] Previous mailbox closed.
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] 
Flags permitted.
* 5 EXISTS
* 0 RECENT
* OK [UNSEEN 3] First unseen.
* OK [UIDVALIDITY 1400091139] UIDs valid
* OK [UIDNEXT 18] Predicted next UID
a OK [READ-WRITE] Select completed (0.017 secs).
a SELECT PERSONAL.Home

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff75f1c6c in mail_search_args_deinit_sub.30037.5970 () from 
/usr/local/lib/dovecot/libdovecot-storage.so.0
(gdb) bt full
#0  0x00007ffff75f1c6c in mail_search_args_deinit_sub.30037.5970 () from 
/usr/local/lib/dovecot/libdovecot-storage.so.0
No symbol table info available.
#1  0x00007ffff75f1d41 in mail_search_args_deinit () from 
/usr/local/lib/dovecot/libdovecot-storage.so.0
No symbol table info available.
#2  0x00007ffff6ca3adb in virtual_mailbox_close_internal.9208 () from 
/usr/local/lib/dovecot/lib20_virtual_plugin.so
No symbol table info available.
#3  0x00007ffff6ca3b39 in virtual_mailbox_close.9256 () from 
/usr/local/lib/dovecot/lib20_virtual_plugin.so
No symbol table info available.
#4  0x00007ffff761daac in mailbox_close () from 
/usr/local/lib/dovecot/libdovecot-storage.so.0
No symbol table info available.
#5  0x00007ffff75ff283 in mailbox_free () from 
/usr/local/lib/dovecot/libdovecot-storage.so.0
No symbol table info available.
#6  0x0000000000410a2e in close_selected_mailbox.part.1 
(client=client at entry=0x6577c0) at cmd-select.c:383
         box = 0x0
#7  0x0000000000410b59 in close_selected_mailbox (client=0x6577c0) at 
cmd-select.c:376
         client = 0x6577c0
#8  cmd_select_full (cmd=0x6583e0, readonly=<optimized out>) at 
cmd-select.c:427
         client = 0x6577c0
         ctx = 0x6584e0
         args = 0x65ccd8
         list_args = 0x632038
         mailbox = 0x6322a8 "PERSONAL.Home"
         error = 0x648748 ""
         __FUNCTION__ = "cmd_select_full"
         __FUNCTION__ = "cmd_select_full"
#9  0x00000000004129ac in command_exec (cmd=0x6583e0) at 
imap-commands.c:158
         hook = 0x63b5c0
         ret = <optimized out>
#10 0x00000000004178ef in client_command_input (cmd=0x6583e0) at 
imap-client.c:778
         client = 0x6577c0
         command = <optimized out>
         __FUNCTION__ = "client_command_input"
         __FUNCTION__ = "client_command_input"
#11 0x00000000004179a5 in client_command_input (cmd=0x6583e0) at 
imap-client.c:839
         client = 0x6577c0
         command = <optimized out>
         __FUNCTION__ = "client_command_input"
         __FUNCTION__ = "client_command_input"
#12 0x0000000000417c65 in client_handle_next_command 
(remove_io_r=<synthetic pointer>, client=0x6577c0) at imap-client.c:877
No locals.
#13 client_handle_input (client=client at entry=0x6577c0) at 
imap-client.c:889
         _data_stack_cur_id = 3
         remove_io = false
         handled_commands = false
         __FUNCTION__ = "client_handle_input"
         __FUNCTION__ = "client_handle_input"
#14 0x0000000000417e8f in client_input (client=0x6577c0) at 
imap-client.c:931
         cmd = 0x7ffff732abce <io_loop_context_activate+62>
         output = 0x658200
         bytes = 23
         __FUNCTION__ = "client_input"
         __FUNCTION__ = "client_input"
#15 0x00007ffff732d3ff in io_loop_call_io () from 
/usr/local/lib/dovecot/libdovecot.so.0
No symbol table info available.
#16 0x00007ffff731f407 in io_loop_handler_run_internal () from 
/usr/local/lib/dovecot/libdovecot.so.0
No symbol table info available.
#17 0x00007ffff731f4d9 in io_loop_handler_run () from 
/usr/local/lib/dovecot/libdovecot.so.0
No symbol table info available.
#18 0x00007ffff731f558 in io_loop_run () from 
/usr/local/lib/dovecot/libdovecot.so.0
No symbol table info available.
#19 0x00007ffff731f5c3 in master_service_run () from 
/usr/local/lib/dovecot/libdovecot.so.0
No symbol table info available.
#20 0x000000000040bfa0 in main (argc=1, argv=0x63a390) at main.c:400
         set_roots = {0x4274e0 <imap_setting_parser_info>, 0x0}
         login_set = {auth_socket_path = 0x0, postlogin_socket_path = 
0x0, postlogin_timeout_secs = 60, callback = 0x0, failure_callback = 
0x0, request_auth_token = 1}
         service_flags = <optimized out>
         storage_service_flags = <optimized out>
         username = 0x0
         c = <optimized out>
         set_roots = {0x4274e0 <imap_setting_parser_info>, 0x0}


=====================
DOVECONF -n
=====================
colin at xxxx [ /var/mail/colin/virtual ]$ doveconf -n
# 2.2.13: /etc/dovecot/dovecot.conf
# OS: Linux 3.14.4 x86_64 Linux From Scratch ext4
auth_socket_path = /var/run/dovecot/auth-userdb
auth_username_format = %Ln
first_valid_gid = 1000
first_valid_uid = 1000
hostname = mail.theknoxes.co.uk
imap_metadata = yes
last_valid_gid = 1100
last_valid_uid = 1100
listen = *
login_trusted_networks = 127.0.0.1
mail_attribute_dict = file:/var/mail/%n/shared_metadata
mail_location = maildir:/var/mail/%n
mail_plugins = " fts fts_solr virtual"
mail_temp_dir = /tmp/mail
mailbox_list_index = yes
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope 
encoded-character vacation subaddress comparator-i;ascii-numeric 
relational regex imap4flags copy include variables body enotify 
environment mailbox date ihave duplicate
namespace {
   location = virtual:/var/mail/%n/virtual
   prefix = virtual.
   separator = .
   subscriptions = no
}
namespace inbox {
   inbox = yes
   location =
   mailbox Drafts {
     special_use = \Drafts
   }
   mailbox Junk {
     special_use = \Junk
   }
   mailbox "Junk E-mail" {
     special_use = \Junk
   }
   mailbox Sent {
     special_use = \Sent
   }
   mailbox "Sent Messages" {
     special_use = \Sent
   }
   mailbox Trash {
     special_use = \Trash
   }
   mailbox virtual/All {
     special_use = \All
   }
   prefix =
   separator = .
}
passdb {
   driver = pam
}
plugin {
   fts = solr
   fts_autoindex = yes
   fts_decoder = decode2text
   fts_solr = url=http://localhost:8080/solr/dovecot/ break-imap-search
   sieve = ~/.dovecot.sieve
   sieve_dir = ~/sieve
}
protocols = imap lmtp sieve
sendmail_path = /usr/local/sbin/sendmail
service auth {
   unix_listener auth-client {
     group = exim
     mode = 0660
   }
}
service decode2text {
   executable = script /usr/local/libexec/dovecot/decode2text.sh
   unix_listener decode2text {
     mode = 0666
   }
   user = dovecot
}
service imap-login {
   inet_listener imap {
     port = 143
   }
   inet_listener imaps {
     port = 0
   }
}
service lmtp {
   unix_listener lmtp {
     mode = 0666
   }
}
service managesieve-login {
   inet_listener sieve {
     port = 4190
   }
}
service managesieve {
   process_limit = 1024
}
ssl = required
ssl_cert = </etc/ssl/certs/dovecot.pem
ssl_cipher_list = 
EECDH:EDH:@STRENGTH:HIGH:!MEDIUM:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!ADH:!aNULL:!eNULL
ssl_dh_parameters_length = 2048
ssl_key = </etc/ssl/private/dovecot.key
ssl_prefer_server_ciphers = yes
submission_host = localhost:25
userdb {
   driver = passwd
}
protocol imap {
   mail_max_userip_connections = 100
}
protocol lmtp {
   mail_plugins = " fts fts_solr virtual sieve"
}


===========================
VIRTUAL MAILBOX SPEC
===========================

colin at xxxx [ /var/mail/colin/virtual ]$ cat 
Conversations/dovecot-virtual
virtual.All
   inthread refs x-mailbox Inbox
===========================


More information about the dovecot mailing list