[Dovecot] Dovecot crashes on large search result sets in virtual folders when using fts-solr

Steffen Templin steffen.templin at open-xchange.com
Wed Mar 19 06:30:00 UTC 2014


Hi Devs,

I experience reproducible crashes when searching in a virtual folder with
fts-solr activated. The crashes occur only, if the folder contains a large
number of mails and the result set of the search is also large. If the result
set is small, no crash occurs. This happens on Debian Wheezy with versions 2.1.7
and 2.2.9.

My goal was it to setup the possibility for cross-folder fulltext search.
Therefore dovecot was setup with fts-solr, which seems to work fine in most
cases. A virtual folder "test" in a namespace "virtual" was created and
configured to return all mails from all mailboxes in the default namespace (with
empty prefix). It was configured like this:

/etc/dovecot/virtual/test/dovecot-virtual:
*
  all

It's also reproducible with:
INBOX
   all

The test user only has the standard mail folders (Sent, Drafts, Trash) beside
the INBOX and of course the folder "virtual.test". INBOX contains about 10.000
mails, the other folders are empty. "virtual.test" correctly referrs to all
mails of the INBOX. Searching within the INBOX returns the desired results
without any problems. Performing the same search within "virtual.test" fails and
dovecot crashes. However, if the result set is small, no crash occurs. My test
mails are imported from the ubuntu mailing list. Therefore the term "ubuntu"
produces a large result set. See attachments for further details, they all refer
to the same crash, reproduced with version 2.2.9 (from the Debian Backports
repository):
  - config.txt:          dovecot -n
  - gdb_backtrace.txt:   The gdb backtrace of the attached core dump
  - log.txt:             A logfile extract from the crash
  - protocol_output.txt: The telnet session that caused the crash

Don't hesitate to ask for further details.

Thanks and best regards,
Steffen

-------------- next part --------------
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN] Dovecot ready.
. login steffen at dovecot.devel.open-xchange.com secret
. 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 SPECIAL-USE BINARY MOVE SEARCH=FUZZY] Logged in
. select virtual.test
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $cl_0)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft $cl_0 \*)] Flags permitted.
* 10004 EXISTS
* 0 RECENT
* OK [UNSEEN 3] First unseen.
* OK [UIDVALIDITY 1395144608] UIDs valid
* OK [UIDNEXT 30025] Predicted next UID
* OK [NOMODSEQ] No permanent modsequences
. OK [READ-WRITE] Select completed (0.025 secs).
. search text steffen
* SEARCH 1 2 3 4 5 6 7 9
. OK Search completed (0.008 secs).
. search text ubuntu
closed

-------------- next part --------------
Mar 18 16:50:40 imap(steffen at dovecot.devel.open-xchange.com): Panic: file fts-search.c: line 79 (level_scores_add_vuids): assertion failed: (array_count(&vuids_arr) == array_count(&br->scores))
Mar 18 16:50:40 imap(steffen at dovecot.devel.open-xchange.com): Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(+0x68adf) [0xb75c5adf] -> /usr/lib/dovecot/libdovecot.so.0(+0x68b61) [0xb75c5b61] -> /usr/lib/dovecot/libdovecot.so.0(i_fatal+0) [0xb75786f9] -> /usr/lib/dovecot/modules/lib20_fts_plugin.so(+0x9aca) [0xb73c2aca] -> /usr/lib/dovecot/modules/lib20_fts_plugin.so(fts_search_lookup+0xce) [0xb73c2b9e] -> /usr/lib/dovecot/modules/lib20_fts_plugin.so(+0xba19) [0xb73c4a19] -> /usr/lib/dovecot/libdovecot-storage.so.0(mailbox_search_init+0x5f) [0xb76aea7f] -> dovecot/imap(imap_search_start+0x74) [0xb778e304] -> dovecot/imap(cmd_search+0xfe) [0xb778147e] -> dovecot/imap(command_exec+0x3a) [0xb7787cca] -> dovecot/imap(+0x16b36) [0xb7786b36] -> dovecot/imap(+0x16c79) [0xb7786c79] -> dovecot/imap(client_handle_input+0x11d) [0xb7786ead] -> dovecot/imap(client_input+0x81) [0xb77872b1] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x44) [0xb75d86a4] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0xee) [0xb75d972e] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_run+0x48) [0xb75d8138] -> /usr/lib/dovecot/libdovecot.so.0(master_service_run+0x2e) [0xb757e4ae] -> dovecot/imap(main+0x2f8) [0xb7779d08] -> /lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0xb7408e46] -> dovecot/imap(+0x9eb9) [0xb7779eb9]
Mar 18 16:50:40 imap(steffen at dovecot.devel.open-xchange.com): Fatal: master: service(imap): child 8142 killed with signal 6 (core dumped)
-------------- next part --------------
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 "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/lib/dovecot/imap...(no debugging symbols found)...done.
[New LWP 8142]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/i686/cmov/libthread_db.so.1".
Core was generated by `dovecot/imap'.
Program terminated with signal 6, Aborted.
#0  0xb7751424 in __kernel_vsyscall ()
(gdb) bt full
#0  0xb7751424 in __kernel_vsyscall ()
No symbol table info available.
#1  0xb741c941 in raise () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
No symbol table info available.
#2  0xb741fd72 in abort () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
No symbol table info available.
#3  0xb75c5b09 in ?? () from /usr/lib/dovecot/libdovecot.so.0
No symbol table info available.
#4  0xb75c5b61 in ?? () from /usr/lib/dovecot/libdovecot.so.0
No symbol table info available.
#5  0xb75786f9 in i_panic () from /usr/lib/dovecot/libdovecot.so.0
No symbol table info available.
#6  0xb73c2aca in ?? () from /usr/lib/dovecot/modules/lib20_fts_plugin.so
No symbol table info available.
#7  0xb73c2b9e in fts_search_lookup () from /usr/lib/dovecot/modules/lib20_fts_plugin.so
No symbol table info available.
#8  0xb73c4a19 in ?? () from /usr/lib/dovecot/modules/lib20_fts_plugin.so
No symbol table info available.
#9  0xb76aea7f in mailbox_search_init () from /usr/lib/dovecot/libdovecot-storage.so.0
No symbol table info available.
#10 0xb778e304 in imap_search_start ()
No symbol table info available.
#11 0xb778147e in cmd_search ()
No symbol table info available.
#12 0xb7787cca in command_exec ()
No symbol table info available.
#13 0xb7786b36 in ?? ()
No symbol table info available.
#14 0xb7786c79 in ?? ()
No symbol table info available.
#15 0xb7786ead in client_handle_input ()
No symbol table info available.
#16 0xb77872b1 in client_input ()
No symbol table info available.
#17 0xb75d86a4 in io_loop_call_io () from /usr/lib/dovecot/libdovecot.so.0
No symbol table info available.
#18 0xb75d972e in io_loop_handler_run () from /usr/lib/dovecot/libdovecot.so.0
No symbol table info available.
#19 0xb75d8138 in io_loop_run () from /usr/lib/dovecot/libdovecot.so.0
No symbol table info available.
#20 0xb757e4ae in master_service_run () from /usr/lib/dovecot/libdovecot.so.0
No symbol table info available.
#21 0xb7779d08 in main ()
No symbol table info available.

-------------- next part --------------
# 2.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-4-686-pae i686 Debian 7.4 ext4
first_valid_gid = 1337
first_valid_uid = 1337
info_log_path = /var/log/dovecot-info.log
log_path = /var/log/dovecot.log
mail_location = maildir:/home/vmail/%d/%n
mail_plugins = fts fts_solr virtual
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 = 
}
namespace virtual {
  location = virtual:/etc/dovecot/virtual:INDEX=~/virtual
  mailbox test {
    auto = subscribe
    special_use = \All
  }
  prefix = virtual.
  separator = .
}
passdb {
  args = scheme=SHA1 /etc/dovecot/passwd
  driver = passwd-file
}
plugin {
  fts = solr
  fts_solr = break-imap-search url=http://localhost:8080/solr/
}
protocols = " imap pop3"
ssl_cert = </etc/dovecot/dovecot.pem
ssl_key = </etc/dovecot/private/dovecot.pem
userdb {
  args = uid=vmail gid=vmail home=/home/vmail/%d/%n
  driver = static
}
protocol imap {
  mail_plugins = fts fts_solr virtual
}


More information about the dovecot mailing list