[Dovecot] Dovecot 2.0beta3: mdbox crash on corrupted mail (backtrace included)

Thomas Leuxner tlx at leuxner.net
Tue Mar 9 15:05:53 EET 2010


Hi,

captured a crash on mdbox with latest mercurial:

Mar  9 13:56:28 spectre dovecot: imap(tlx at leuxner.net): Corrupted dbox file /var/vmail/leuxner.net/tlx/mdbox/storage/m.59 (around offset=1438073): msg header has bad magic value
Mar  9 13:56:28 spectre dovecot: imap(tlx at leuxner.net): Corrupted dbox file /var/vmail/leuxner.net/tlx/mdbox/storage/m.59 (around offset=1438073): uid=4831 points to broken data at offset=1438073
Mar  9 13:56:28 spectre dovecot: imap(tlx at leuxner.net): Corrupted dbox file /var/vmail/leuxner.net/tlx/mdbox/storage/m.59 (around offset=1438073): msg header has bad magic value
Mar  9 13:56:28 spectre dovecot: imap(tlx at leuxner.net): Corrupted dbox file /var/vmail/leuxner.net/tlx/mdbox/storage/m.59 (around offset=1438073): uid=4831 points to broken data at offset=1438073
Mar  9 13:56:28 spectre dovecot: imap(tlx at leuxner.net): Disconnected: Internal error occurred. Refer to server log for more information. [2010-03-09 13:56:28] bytes=74358/28147042
Mar  9 13:56:28 spectre dovecot: imap(tlx at leuxner.net): dbox /var/vmail/leuxner.net/tlx/mdbox/storage: rebuilding indexes
Mar  9 13:56:28 spectre dovecot: imap(tlx at leuxner.net): Corrupted dbox file /var/vmail/leuxner.net/tlx/mdbox/storage/m.59 (around offset=2075210): msg header has bad magic value
Mar  9 13:56:28 spectre dovecot: imap(tlx at leuxner.net): dbox: Copy of the broken file saved to /var/vmail/leuxner.net/tlx/mdbox/storage/m.59.broken
Mar  9 13:56:29 spectre dovecot: imap(tlx at leuxner.net): Panic: file index-sync.c: line 40 (index_mailbox_set_recent_uid): assertion failed: (seq_range_exists(&ibox->recent_flags, uid))
Mar  9 13:56:29 spectre dovecot: imap(tlx at leuxner.net): Raw backtrace: /usr/lib/dovecot/libdovecot.so.0 [0x7f184c7d92b2] -> /usr/lib/dovecot/libdovecot.so.0 [0x7f184c7d931a] -> /usr/lib/dovecot/libdovecot.so.0(i_error+0) [0x7f184c7d96c3] -> /usr/lib/dovecot/libdovecot-storage.so.0(index_mailbox_set_recent_seq+0) [0x7f184ca84010] -> /usr/lib/dovecot/libdovecot-storage.so.0(index_mailbox_set_recent_seq+0x3c) [0x7f184ca8404c] -> /usr/lib/dovecot/libdovecot-storage.so.0(mdbox_sync_begin+0x37b) [0x7f184caafddb] -> /usr/lib/dovecot/libdovecot-storage.so.0(mdbox_sync+0x12) [0x7f184cab00c2] -> /usr/lib/dovecot/libdovecot-storage.so.0(mdbox_storage_sync_init+0x43) [0x7f184cab0133] -> /usr/lib/dovecot/libdovecot-storage.so.0(mailbox_sync_init+0x31) [0x7f184ca414e1] -> dovecot/imap [tlx at leuxner.net 80.187.100.24 IDLE](imap_sync_init+0x68) [0x417db8] -> dovecot/imap [tlx at leuxner.net 80.187.100.24 IDLE] [0x40ab5e] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handle_timeouts+0x9b) [0x7f184c7e342b] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x6f) [0x7f184c7e3f8f] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_run+0x18) [0x7f184c7e3168] -> /usr/lib/dovecot/libdovecot.so.0(master_service_run+0x13) [0x7f184c7d3143] -> dovecot/imap [tlx at leuxner.net 80.187.100.24 IDLE](main+0x191) [0x418681] -> /lib/libc.so.6(__libc_start_main+0xe6) [0x7f184c0601a6] -> dovecot/imap [tlx at leuxner.net 80.187.100.24 IDLE] [0x4084e9]
Mar  9 13:56:29 spectre dovecot: master: service(imap): child 32643 killed with signal 6 (core dumped)

[14:02] root spectre:/# gdb /usr/lib/dovecot/imap /var/vmail/leuxner.net/tlx/core
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 "x86_64-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /usr/lib/dovecot/libdovecot-storage.so.0...Reading symbols from /usr/lib/debug/usr/lib/dovecot/libdovecot-storage.so.0.0.0...done.
done.
Loaded symbols for /usr/lib/dovecot/libdovecot-storage.so.0
Reading symbols from /usr/lib/dovecot/libdovecot.so.0...Reading symbols from /usr/lib/debug/usr/lib/dovecot/libdovecot.so.0.0.0...done.
done.
Loaded symbols for /usr/lib/dovecot/libdovecot.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/librt.so.1...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /usr/lib/dovecot/modules/lib01_acl_plugin.so...Reading symbols from /usr/lib/debug/usr/lib/dovecot/modules/lib01_acl_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib01_acl_plugin.so
Reading symbols from /usr/lib/dovecot/modules/lib02_imap_acl_plugin.so...Reading symbols from /usr/lib/debug/usr/lib/dovecot/modules/lib02_imap_acl_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib02_imap_acl_plugin.so
Reading symbols from /usr/lib/dovecot/modules/lib10_quota_plugin.so...Reading symbols from /usr/lib/debug/usr/lib/dovecot/modules/lib10_quota_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib10_quota_plugin.so
Reading symbols from /usr/lib/dovecot/modules/lib11_imap_quota_plugin.so...Reading symbols from /usr/lib/debug/usr/lib/dovecot/modules/lib11_imap_quota_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib11_imap_quota_plugin.so
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Core was generated by `dovecot/imap'.
Program terminated with signal 6, Aborted.
[New process 32643]
#0  0x00007f184c073ed5 in raise () from /lib/libc.so.6
(gdb) bt full
#0  0x00007f184c073ed5 in raise () from /lib/libc.so.6
No symbol table info available.
#1  0x00007f184c0753f3 in abort () from /lib/libc.so.6
No symbol table info available.
#2  0x00007f184c7d92c5 in default_fatal_finish (type=<value optimized out>, status=0) at failures.c:164
        backtrace = 0x61f0e8 "/usr/lib/dovecot/libdovecot.so.0 [0x7f184c7d92b2] -> /usr/lib/dovecot/libdovecot.so.0 [0x7f184c7d931a] -> /usr/lib/dovecot/libdovecot.so.0(i_error+0) [0x7f184c7d96c3] -> /usr/lib/dovecot/libdovecot-st"...
#3  0x00007f184c7d931a in i_internal_fatal_handler (type=LOG_TYPE_PANIC, status=0, fmt=<value optimized out>, args=<value optimized out>) at failures.c:592
No locals.
#4  0x00007f184c7d96c3 in i_panic (format=<value optimized out>) at failures.c:230
        args = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 0x7fffffffcd00, reg_save_area = 0x7fffffffcc40}}
#5  0x00007f184ca84010 in index_mailbox_set_recent_uid (box=<value optimized out>, uid=4722) at index-sync.c:40
        ibox = (struct index_mailbox_context *) 0x654890
        __PRETTY_FUNCTION__ = "index_mailbox_set_recent_uid"
#6  0x00007f184ca8404c in index_mailbox_set_recent_seq (box=0x654508, view=0x665040, seq1=2, seq2=44) at index-sync.c:57
        uid = 4722
#7  0x00007f184caafddb in mdbox_sync_begin (mbox=0x654508, flags=<value optimized out>, ctx_r=0x7fffffffcea8) at mdbox-sync.c:141
        storage = (struct mail_storage *) 0x648c78
        ctx = (struct mdbox_sync_context *) 0x657260
        sync_flags = <value optimized out>
        ret = 1
        storage_rebuilt = false
#8  0x00007f184cab00c2 in mdbox_sync (mbox=0x7f83, flags=32643) at mdbox-sync.c:286
        sync_ctx = (struct mdbox_sync_context *) 0x654508
#9  0x00007f184cab0133 in mdbox_storage_sync_init (box=0x654508, flags=0) at mdbox-sync.c:310
        mdbox_sync_flags = 32643
#10 0x00007f184ca414e1 in mailbox_sync_init (box=0x654508, flags=0) at mail-storage.c:848
        _data_stack_cur_id = 0
        ctx = <value optimized out>
#11 0x0000000000417db8 in imap_sync_init (client=0x64f9d8, box=<value optimized out>, imap_flags=0, flags=0) at imap-sync.c:142
        ctx = <value optimized out>
        __PRETTY_FUNCTION__ = "imap_sync_init"
#12 0x000000000040ab5e in idle_sync_now (box=<value optimized out>, ctx=0x650228) at cmd-idle.c:122
        __PRETTY_FUNCTION__ = "idle_sync_now"
#13 0x00007f184c7e342b in io_loop_handle_timeouts (ioloop=0x6275c0) at ioloop.c:328
        _data_stack_cur_id = 2
#14 0x00007f184c7e3f8f in io_loop_handler_run (ioloop=0x6275c0) at ioloop-epoll.c:180
        ctx = (struct ioloop_handler_context *) 0x6277d0
        event = <value optimized out>
        list = <value optimized out>
        io = <value optimized out>
        tv = {tv_sec = 0, tv_usec = 499327}
        t_id = <value optimized out>
        msecs = 500
        ret = 0
        call = <value optimized out>
#15 0x00007f184c7e3168 in io_loop_run (ioloop=0x6275c0) at ioloop.c:350
No locals.
#16 0x00007f184c7d3143 in master_service_run (service=0x627490, callback=0x7f83) at master-service.c:478
No locals.
#17 0x0000000000418681 in main (argc=1, argv=0x627370) at main.c:313
        service_flags = <value optimized out>
        storage_service_flags = <value optimized out>
        postlogin_socket_path = 0x0
        set_roots = {0x41b980, 0x0}
(gdb)

Regards
Thomas


More information about the dovecot mailing list