Imap process crashes when search in virtual mailbox
Hi,
When searching in a virtual mailbox imap process crashes if the virtual mailbox has a lot of physical mailboxes behind (more than 80 - 100 mailboxes).
Dovecot 2.2.18 build from sources ./configure --prefix=/opt/dovecot2 --with-mysql --with-sqlite --with-solr --with-ssl --disable-rpath --disable-static. Debian Wheezy 3.2.63-2 x86_64. Filesystem is ZFS.
docecot -n : # 2.2.18: /services/dovecot1/etc/dovecot.conf # OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.7 auth_master_user_separator = * auth_mechanisms = plain login base_dir = /services/dovecot1/var/run default_client_limit = 10240 default_login_user = dovecot dict { quotadict = mysql:/services/dovecot1/etc/quota.conf } disable_plaintext_auth = no log_path = login_log_format_elements = user=%u session=%{session} mpid=%e rip=%r rrip=%{real_rip} mail_location = mdbox:~/mails mail_log_prefix = "store107: %s(%u): %{session}: " mail_max_userip_connections = 0 mail_plugins = quota virtual fts fts_solr notify mail_log mailbox_list_index = yes mdbox_rotate_size = 256 k mmap_disable = yes namespace inbox { inbox = yes location = mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Junk { auto = subscribe special_use = \Junk } mailbox Sent { auto = subscribe special_use = \Sent } mailbox Trash { auto = subscribe special_use = \Trash } prefix = separator = / } namespace virtual { hidden = yes list = no location = virtual:/services/dovecot1/etc/virtual:INDEX=~/mails/virtual mailbox all { auto = create special_use = \All } mailbox unseen { auto = create } prefix = virtual/ separator = / } passdb { args = /services/dovecot1/etc/passwd.masterusers driver = passwd-file master = yes pass = yes } passdb { args = /services/dovecot1/etc/mysql.conf driver = sql } plugin { fts = solr fts_solr = break-imap-search url=http://10.78.18.127:8080/solr/ mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename flag_change save mailbox_create mail_log_fields = uid box msgid flags quota = dict:user::proxy::quotadict quota_rule = *:storage=1GB quota_rule2 = Trash:storage=+152M quota_rule3 = Trash:messages=+5 } protocols = imap service auth { unix_listener auth-client { mode = 0666 } unix_listener auth-master { group = nogroup mode = 0660 } } service dict { process_limit = 400 unix_listener dict { mode = 0600 user = nobody } } service imap-login { chroot = login client_limit = 2048 inet_listener imap { address = 10.78.18.127 port = 143 } process_limit = 1024 service_count = 0 } service imap { process_limit = 10240 vsz_limit = 320 M } service indexer-worker { process_limit = 4 process_min_avail = 2 service_count = 1 vsz_limit = 1 G } shutdown_clients = no ssl = no syslog_facility = local3 userdb { args = /services/dovecot1/etc/mysql.conf driver = sql } protocol imap { mail_plugins = quota virtual fts fts_solr notify mail_log imap_quota } protocol lda { auth_socket_path = /services/dovecot1/var/run/auth-master mail_plugins = quota virtual fts fts_solr notify mail_log sieve event_broker submission_host = osmtp:8090 }
/services/dovecot1/etc/virtual/all/dovecot-virtual : * -Trash -Junk all
Error log: 2015-06-16T12:49:25.502864+02:00 sr-be-store07 dovecot: store107: imap( mihaiush@sunrise.ch): hCdxU6AY/wAKThJr: Panic: file mail-index-map.c: line 547 (mail_index_map_lookup_seq_range): assertion failed: (first_uid > 0) 2015-06-16T12:49:25.503429+02:00 sr-be-store07 dovecot: store107: imap( mihaiush@sunrise.ch): hCdxU6AY/wAKThJr: Error: Raw backtrace: /opt/dovecot2/lib/dovecot/libdovecot.so.0(+0x7c13f) [0x7fe2e433713f] -> /opt/dovecot2/lib/dovecot/libdovecot.so.0(+0x7c19e) [0x7fe2e433719e] -> /opt/dovecot2/lib/dovecot/libdovecot.so.0(i_fatal+0) [0x7fe2e42e5555] -> /opt/dovecot2/lib/dovecot/libdovecot-storage.so.0(+0xc4d32) [0x7fe2e466fd32] -> /opt/dovecot2/lib/dovecot/libdovecot-storage.so.0(mail_index_lookup_seq_range+0xa) [0x7fe2e46817fa] -> /opt/dovecot2/lib/dovecot/lib20_fts_plugin.so(+0xd0b1) [0x7fe2e30c40b1] -> /opt/dovecot2/lib/dovecot/lib20_fts_plugin.so(+0xd963) [0x7fe2e30c4963] -> /opt/dovecot2/lib/dovecot/lib20_fts_plugin.so(fts_search_lookup+0xa6) [0x7fe2e30c4c36] -> /opt/dovecot2/lib/dovecot/lib20_fts_plugin.so(+0xfdef) [0x7fe2e30c6def] -> dovecot/imap(imap_search_start+0x70) [0x41dec0] -> dovecot/imap(cmd_sort+0x205) [0x414565] -> dovecot/imap(command_exec+0x4c) [0x418aec] -> dovecot/imap() [0x417ad0] -> dovecot/imap() [0x417b64] -> dovecot/imap(client_handle_input+0x115) [0x417e45] -> dovecot/imap(client_input+0x72) [0x418212] -> /opt/dovecot2/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x5b) [0x7fe2e43494fb] -> /opt/dovecot2/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xbb) [0x7fe2e434a54b] -> /opt/dovecot2/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x9) [0x7fe2e4349589] -> /opt/dovecot2/lib/dovecot/libdovecot.so.0(io_loop_run+0x38) [0x7fe2e4349608] -> /opt/dovecot2/lib/dovecot/libdovecot.so.0(master_service_run+0x13) [0x7fe2e42eabc3] -> dovecot/imap(main+0x27b) [0x40c60b] -> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) [0x7fe2e3f4eead] -> dovecot/imap() [0x40c769] 2015-06-16T12:49:25.552150+02:00 sr-be-store07 dovecot: store107: imap( mihaiush@sunrise.ch): hCdxU6AY/wAKThJr: Fatal: master: service(imap): child 3923 killed with signal 6 (core dumped)
IMAP session: # telnet store107 143 Escape character is '^]'.
- OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot ready. x login mihaiush@sunrise.ch XXX x OK [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 BINARY MOVE SEARCH=FUZZY NOTIFY SPECIAL-USE QUOTA] Logged in x select virtual/all
- FLAGS (\Answered \Flagged \Deleted \Seen \Draft $Label3 $Label2 $Label5 $Label1 $Label4 parsed attachment)
- OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft $Label3 $Label2 $Label5 $Label1 $Label4 parsed attachment \*)] Flags permitted.
- 1963 EXISTS
- 1256 RECENT
- OK [UNSEEN 2] First unseen.
- OK [UIDVALIDITY 1434024437] UIDs valid
- OK [UIDNEXT 2677] Predicted next UID
- OK [HIGHESTMODSEQ 76] Highest x OK [READ-WRITE] Select completed (0.087 secs). x sort (reverse arrival) utf-8 text vpopmail Connection closed by foreign host.
GDB: # gdb /opt/dovecot2/libexec/dovecot/imap /services/dovecot1/var/data/ sunrise.ch/m/mihaiush/core GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 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-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /opt/dovecot2/libexec/dovecot/imap...done. [New LWP 3923]
warning: Can't read pathname for load map: Input/output error. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `dovecot/imap'. Program terminated with signal 6, Aborted. #0 0x00007fe2e3f62165 in raise () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) (gdb) bt full #0 0x00007fe2e3f62165 in raise () from /lib/x86_64-linux-gnu/libc.so.6 No symbol table info available. #1 0x00007fe2e3f653e0 in abort () from /lib/x86_64-linux-gnu/libc.so.6 No symbol table info available. #2 0x00007fe2e4337135 in default_fatal_finish (type=<optimized out>, status=status@entry=0) at failures.c:202 backtrace = 0x2166c38 "/opt/dovecot2/lib/dovecot/libdovecot.so.0(+0x7c13f) [0x7fe2e433713f] -> /opt/dovecot2/lib/dovecot/libdovecot.so.0(+0x7c19e) [0x7fe2e433719e] -> /opt/dovecot2/lib/dovecot/libdovecot.so.0(i_fatal+0) [0x"... #3 0x00007fe2e433719e in i_internal_fatal_handler (ctx=0x7fffa5660ea0, format=<optimized out>, args=<optimized out>) at failures.c:671 status = 0 #4 0x00007fe2e42e5555 in i_panic (format=format@entry=0x7fe2e468d068 "file %s: line %d (%s): assertion failed: (%s)") at failures.c:276 ctx = {type = LOG_TYPE_PANIC, exit_status = 0, timestamp = 0x0, timestamp_usecs = 0} args = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 0x7fffa5660f90, reg_save_area = 0x7fffa5660ed0}} #5 0x00007fe2e466fd32 in mail_index_map_lookup_seq_range (map=<optimized out>, first_uid=0, last_uid=<optimized out>, first_seq_r=<optimized out>, last_seq_r=<optimized out>) at mail-index-map.c:547 __FUNCTION__ = "mail_index_map_lookup_seq_range" #6 0x00007fe2e46817fa in mail_index_lookup_seq_range (view=<optimized out>, first_uid=<optimized out>, last_uid=<optimized out>, first_seq_r=first_seq_r@entry=0x7fffa5660fe8, last_seq_r=last_seq_r@entry =0x7fffa5660fec) at mail-index-view.c:513 No locals. #7 0x00007fe2e45f819c in mailbox_get_seq_range (box=<optimized out>, uid1=<optimized out>, uid2=<optimized out>, seq1_r=seq1_r@entry=0x7fffa5660fe8, seq2_r=seq2_r@entry=0x7fffa5660fec) at mailbox-get.c:11 No locals. #8 0x00007fe2e30c40b1 in uid_range_to_seqs (uid_range=uid_range@entry=0x7fffa56610b0, seq_range=seq_range@entry=0x25e4840, fctx=<error reading variable: Unhandled dwarf expression opcode 0xfa>, fctx=<error reading variable: Unhandled dwarf expression opcode 0xfa>) at fts-search.c:28 range = 0x2166738 i = <optimized out> count = <optimized out> seq1 = 41023456 seq2 = 0 #9 0x00007fe2e30c4963 in multi_add_lookup_result (args=0x2363d50, level=0x25e4840, fctx=0x23637e0, result=<optimized out>) at fts-search.c:138 br = 0x271f7e0 vuids = {arr = {buffer = 0x2166700, element_size = 8}, v = 0x2166700, v_modifiable = 0x2166700} orig_size = <optimized out> i = <optimized out> vbox = 0x2197c70 #10 fts_search_lookup_level_multi (and_args=<optimized out>, args=0x2363d50, fctx=0x23637e0) at fts-search.c:198 flags = FTS_LOOKUP_FLAG_AND_ARGS mailboxes_arr = {arr = {buffer = 0x2717670, element_size = 8}, v = 0x2717670, v_modifiable = 0x2717670} backend = <optimized out> j = 69 vbox = <optimized out> mailboxes = 0x27176a8 level = 0x25e4840 result = {pool = 0x2717650, box_results = 0x271f7a0} i = <optimized out> mailbox_count = 69 #11 fts_search_lookup_level (fctx=fctx@entry=0x23637e0, args=0x2363d50, and_args=and_args@entry=true) at fts-search.c:212 _data_stack_cur_id = 4 ret = <optimized out> #12 0x00007fe2e30c4c36 in fts_search_lookup (fctx=fctx@entry=0x23637e0) at fts-search.c:358 last_uid = 2676 seq1 = 0 seq2 = 0 __FUNCTION__ = "fts_search_lookup" #13 0x00007fe2e30c6def in fts_mailbox_search_init (t=<optimized out>, args=0x2363c90, sort_program=0x7fffa5661250, wanted_fields=<optimized out>, wanted_headers=<optimized out>) at fts-storage.c:240 ft = 0x23908a0 fbox = <optimized out> flist = <optimized out> ctx = 0x2695dc0 fctx = 0x23637e0 #14 0x000000000041dec0 in imap_search_start (ctx=ctx@entry=0x2195590, sargs=0x2363c90, sort_program=sort_program@entry=0x7fffa5661250) at imap-search.c:587 cmd = 0x2195450 __FUNCTION__ = "imap_search_start" #15 0x0000000000414565 in cmd_sort (cmd=0x2195450) at cmd-sort.c:141 ctx = 0x2195590 sargs = 0x2363c90 sort_program = {4097, MAIL_SORT_END, 56, MAIL_SORT_END, 3831136736, 32738, 35045104, MAIL_SORT_END, MAIL_SORT_ARRIVAL, MAIL_SORT_END, MAIL_SORT_ARRIVAL, MAIL_SORT_END} args = 0x216cb98 list_args = 0x216ccd0 charset = 0x216ce30 "utf-8" ret = <optimized out> #16 0x0000000000418aec in command_exec (cmd=cmd@entry=0x2195450) at imap-commands.c:167 hook = 0x216a120 diff = <optimized out> ---Type <return> to continue, or q <return> to quit--- finished = <optimized out> #17 0x0000000000417ad0 in client_command_input (cmd=cmd@entry=0x2195450) at imap-client.c:814 client = 0x2194850 command = <optimized out> __FUNCTION__ = "client_command_input" #18 0x0000000000417b64 in client_command_input (cmd=0x2195450) at imap-client.c:874 client = 0x2194850 command = <optimized out> __FUNCTION__ = "client_command_input" #19 0x0000000000417e45 in client_handle_next_command (remove_io_r=<synthetic pointer>, client=0x2194850) at imap-client.c:912 No locals. #20 client_handle_input (client=client@entry=0x2194850) at imap-client.c:924 _data_stack_cur_id = 3 ret = 2 remove_io = false handled_commands = false __FUNCTION__ = "client_handle_input" #21 0x0000000000418212 in client_input (client=0x2194850) at imap-client.c:966 cmd = <optimized out> output = 0x2195270 bytes = 46 __FUNCTION__ = "client_input" #22 0x00007fe2e43494fb in io_loop_call_io (io=0x2195360) at ioloop.c:501 ioloop = 0x2169760 t_id = 2 __FUNCTION__ = "io_loop_call_io" #23 0x00007fe2e434a54b in io_loop_handler_run_internal (ioloop=ioloop@entry=0x2169760) at ioloop-epoll.c:220 ctx = 0x216a490 events = 0xf53 event = 0x216b300 list = 0x216bef0 io = <optimized out> tv = {tv_sec = 1799, tv_usec = 999663} events_count = <optimized out> msecs = <optimized out> ret = 1 i = <optimized out> call = <optimized out> __FUNCTION__ = "io_loop_handler_run_internal" #24 0x00007fe2e4349589 in io_loop_handler_run (ioloop=ioloop@entry=0x2169760) at ioloop.c:548 No locals. #25 0x00007fe2e4349608 in io_loop_run (ioloop=0x2169760) at ioloop.c:525 __FUNCTION__ = "io_loop_run" #26 0x00007fe2e42eabc3 in master_service_run (service=0x21695f0, callback=callback@entry=0x421140 <client_connected>) at master-service.c:581 No locals. #27 0x000000000040c60b in main (argc=1, argv=0x2169390) at main.c:431 set_roots = {0x428c20, 0x0} login_set = {auth_socket_path = 0x2161060 "\210\020\026\002", postlogin_socket_path = 0x0, postlogin_timeout_secs = 60, callback = 0x420f80 <login_client_connected>, failure_callback = 0x4210f0 <login_client_failed>, request_auth_token = 1} service_flags = <optimized out> storage_service_flags = <optimized out> username = 0x0 c = <optimized out> (gdb)
If necessary I can provide the mailbox, it has 7MB.
On 16 Jun 2015, at 15:17, mihaiush <mihaiush@gmail.com> wrote:
Hi,
When searching in a virtual mailbox imap process crashes if the virtual mailbox has a lot of physical mailboxes behind (more than 80 - 100 mailboxes).
2015-06-16T12:49:25.502864+02:00 sr-be-store07 dovecot: store107: imap( mihaiush@sunrise.ch): hCdxU6AY/wAKThJr: Panic: file mail-index-map.c: line 547 (mail_index_map_lookup_seq_range): assertion failed: (first_uid > 0)
participants (2)
-
mihaiush
-
Timo Sirainen