[Dovecot] SIGBART/SIGSEGV while SELECTing virtual folder
Lars Noschinski
lars at public.noschinski.de
Sat Oct 25 21:38:31 EEST 2008
Hello Timo,
thanks for your swift response!
* Timo Sirainen <tss at iki.fi> [08-10-25 20:22]:
>I couldn't reproduce this, but this should fix it anyway:
>http://hg.dovecot.org/dovecot-1.2/rev/0738739a8152
[...]
>Fixed: ttp://hg.dovecot.org/dovecot-1.2/rev/ba6ec21af651
Thanks! I was just looking at the repository, while you were committing
these fixes ;) But these fixes uncovered another bug. I can SELECT now,
but FETCH fails:
--------------------------------------------------------------------
% ./sbin/dovecot --exec-mail ext /usr/bin/gdb ./libexec/dovecot/imap
GNU gdb 6.8-debian
Copyright (C) 2008 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"...
(gdb) run
Starting program: /tmp/dd/libexec/dovecot/imap
* PREAUTH [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT THREAD=REFERENCES MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH SEARCHRES WITHIN CONTEXT=SEARCH] Logged in as lars
. SELECT virtual/all
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft Old)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft Old \*)] Flags permitted.
* 74142 EXISTS
* 0 RECENT
* OK [UNSEEN 10841] First unseen.
* OK [UIDVALIDITY 1224958382] UIDs valid
* OK [UIDNEXT 74143] Predicted next UID
* OK [HIGHESTMODSEQ 1]
. OK [READ-WRITE] Select completed.
a0060 FETCH 1:74142 (UID FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS (DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL)])
Program received signal SIGABRT, Aborted.
0xb7ed8556 in raise () from /lib/libc.so.6
(gdb) bt full
#0 0xb7ed8556 in raise () from /lib/libc.so.6
No symbol table info available.
#1 0xb7ed9d78 in abort () from /lib/libc.so.6
No symbol table info available.
#2 0x080eade5 in default_fatal_finish (type=<value optimized out>, status=0) at failures.c:150
backtrace = 0x99356c0 "/tmp/dd/libexec/dovecot/imap [0x80eadd1] -> /tmp/dd/libexec/dovecot/imap(i_syslog_fatal_handler+0x34) [0x80eaea4] -> /tmp/dd/libexec/dovecot/imap [0x80ea7e9] -> /tmp/dd/libexec/dovecot/imap [0x80d5e93"...
#3 0x080eaea4 in i_syslog_fatal_handler (type=LOG_TYPE_PANIC, status=0,
fmt=0x80fff0c "file %s: line %d (%s): assertion failed: (%s)", args=0xbfa23ef4 "g�020\bP") at failures.c:308
No locals.
#4 0x080ea7e9 in i_panic (format=0x80fff0c "file %s: line %d (%s): assertion failed: (%s)") at failures.c:197
No locals.
#5 0x080d5e93 in mail_cache_decision_state_update (view=0x9bc5ff0, seq=9, field=12) at mail-cache-decisions.c:80
cache = (struct mail_cache *) 0x9c5f750
hdr = <value optimized out>
uid = <value optimized out>
__PRETTY_FUNCTION__ = "mail_cache_decision_state_update"
#6 0x080b6f47 in mail_cache_lookup_headers (view=0x9bc5ff0, dest=0xa024320, seq=9, field_idxs=0x9fee430,
fields_count=14) at mail-cache-lookup.c:479
_data_stack_cur_id = 5
ret = <value optimized out>
#7 0x080a1bd1 in index_mail_get_header_stream (_mail=0x9f85ff0, _headers=0x9fee418, stream_r=0x99417cc)
at index-mail-headers.c:740
input = (struct istream *) 0x1
dest = (string_t *) 0xa024320
#8 0xb7ff9a71 in virtual_mail_get_header_stream (mail=0xa029540, headers=0x9fee418, stream_r=0x99417cc)
at virtual-mail.c:209
No locals.
#9 0x0806c6f1 in fetch_body_header_fields (ctx=0x9941778, mail=0x6, body=0x9941a98) at imap-fetch-body.c:451
size = {physical_size = 578317383981219944, virtual_size = 167833648, lines = 89}
old_offset = <value optimized out>
#10 0x08069c55 in imap_fetch_more (ctx=0x9941778) at imap-fetch.c:479
ret = <value optimized out>
__PRETTY_FUNCTION__ = "imap_fetch_more"
#11 0x080611b3 in cmd_fetch (cmd=0x9941730) at cmd-fetch.c:218
client = (struct client *) 0x99414b0
ctx = (struct imap_fetch_context *) 0x9941778
args = (const struct imap_arg *) 0x99467b0
search_args = (struct mail_search_args *) 0xa04e7f8
messageset = <value optimized out>
ret = <value optimized out>
#12 0x0806758c in client_command_input (cmd=0x9941730) at client.c:592
client = (struct client *) 0x99414b0
command = <value optimized out>
__PRETTY_FUNCTION__ = "client_command_input"
#13 0x08067629 in client_command_input (cmd=0x9941730) at client.c:641
client = (struct client *) 0x99414b0
command = <value optimized out>
__PRETTY_FUNCTION__ = "client_command_input"
#14 0x08067c2d in client_handle_input (client=0x99414b0) at client.c:682
_data_stack_cur_id = 3
ret = <value optimized out>
remove_io = <value optimized out>
handled_commands = false
#15 0x080680e3 in client_input (client=0x99414b0) at client.c:737
cmd = <value optimized out>
output = (struct ostream *) 0x994165c
bytes = <value optimized out>
__PRETTY_FUNCTION__ = "client_input"
#16 0x080f32d0 in io_loop_handler_run (ioloop=0x993dab8) at ioloop-epoll.c:203
ctx = (struct ioloop_handler_context *) 0x993dbb0
event = (const struct epoll_event *) 0x993dbf0
list = (struct io_list *) 0x99416d8
io = (struct io_file *) 0x99416b8
tv = {tv_sec = 1799, tv_usec = 995813}
t_id = 2
msecs = <value optimized out>
ret = 1
i = 0
j = 0
call = <value optimized out>
#17 0x080f2760 in io_loop_run (ioloop=0x993dab8) at ioloop.c:320
No locals.
#18 0x0806f58d in main (argc=Cannot access memory at address 0x2f25
) at main.c:309
No locals.
--------------------------------------------------------------------
Oct 25 20:19:40 vertikal EXT(lars): : Panic: file
mail-cache-decisions.c: line 80 (mail_cache_decision_state_update):
assertion failed: (field < cache->fields_count)
Oct 25 20:19:40 vertikal EXT(lars): : Raw backtrace:
/tmp/dd/libexec/dovecot/imap [0x80eadd1] ->
/tmp/dd/libexec/dovecot/imap(i_syslog_fatal_handler+0x34) [0x80eaea4] ->
/tmp/dd/libexec/dovecot/imap [0x80ea7e9] -> /tmp/dd/libexec/dovecot/imap
[0x80d5e93] ->
/tmp/dd/libexec/dovecot/imap(mail_cache_lookup_headers+0x57) [0x80b6f47]
-> /tmp/dd/libexec/dovecot/imap(index_mail_get_header_stream+0x61)
[0x80a1bd1] -> /tmp/dd/lib/dovecot/imap/lib20_virtual_plugin.so
[0xb7ff9a71] -> /tmp/dd/libexec/dovecot/imap [0x806c6f1] ->
/tmp/dd/libexec/dovecot/imap(imap_fetch_more+0x145) [0x8069c55] ->
/tmp/dd/libexec/dovecot/imap(cmd_fetch+0x343) [0x80611b3] ->
/tmp/dd/libexec/dovecot/imap [0x806758c] -> /tmp/dd/libexec/dovecot/imap
[0x8067629] -> /tmp/dd/libexec/dovecot/imap(client_handle_input+0x1d)
[0x8067c2d] -> /tmp/dd/libexec/dovecot/imap(client_input+0x63)
[0x80680e3] -> /tmp/dd/libexec/dovecot/imap(io_loop_handler_run+0xe0)
[0x80f32d0] -> /tmp/dd/libexec/dovecot/imap(io_loop_run+0x20)
[0x80f2760] -> /tmp/dd/libexec/dovecot/
--------------------------------------------------------------------
>> On an unrelated note, given the above configuration file, using a
>> dovecot-virtual file like
>>
>> | mbox/*
>> | all
>>
>> causes dovecot to complain:
>>
>> Oct 20 13:56:59 vertikal EXT(lars): : Connection closed bytes=22/350
>> Oct 20 13:57:03 vertikal EXT(lars): : /home/lars/Mailbox/virtual/test/dovecot-virtual: No mailboxes defined
>
>Fixed: http://hg.dovecot.org/dovecot-1.2/rev/3f6fa7862843
Thanks. This works now, with a minor glitch. The directory backing the
"mbox" namespace looks like this:
Archiv/list1
Archiv/list2
foo1
foo2
As "Archiv" is a directory, it is not selectable (of course). Using the
above dovecot-virtual file, I get "NO Mailbox isn't selectable: Archiv"
if I try to select the virtual mbox.
This message does not occur, if use "*" instead of "mbox/*" as mailbox
pattern.
BTW: I really like dovecot's easy-to-reach debugging facilities.
- Lars.
More information about the dovecot
mailing list