[Dovecot] beta8: cores on corrupted index file

Jeff A. Earickson jaearick at colby.edu
Mon May 22 17:22:17 EEST 2006


Timo,

I saw a couple of these cores over the weekend.  The syslog says:

May 21 19:04:48 emerald dovecot: [ID 107833 mail.error] IMAP(user): Corrupted index cache file /home/students/s/user/.imap/sent-mail-apr-2004/dovecot.index.cache: indexid changed

With a resulting core file from imap at this time.  I also discovered
a remaining lock file on the person's imap file:

-rw-------   1 user  user  3088940 May 10  2004 sent-mail-apr-2004
-rw-------   1 user  user       13 May 21 19:04 sent-mail-apr-2004.lock

The lockfile contains the pid of the process that cores:

May 21 19:04:48 emerald dovecot: [ID 684838 mail.error] child 17480 (imap) killed with signal 11

The gdb output of the core file is attached.

Jeff Earickson
Colby College
-------------- next part --------------
Script started on Mon May 22 10:08:02 2006
%gdb imap core.senagel
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.9"...

warning: exec file is newer than core file.
Core was generated by `imap'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libdl.so.1...done.
Loaded symbols for /usr/lib/libdl.so.1
Reading symbols from /usr/lib/libsocket.so.1...done.
Loaded symbols for /usr/lib/libsocket.so.1
Reading symbols from /usr/lib/libnsl.so.1...done.
Loaded symbols for /usr/lib/libnsl.so.1
Reading symbols from /usr/lib/librt.so.1...done.
Loaded symbols for /usr/lib/librt.so.1
Reading symbols from /usr/lib/libsendfile.so.1...done.
Loaded symbols for /usr/lib/libsendfile.so.1
Reading symbols from /usr/lib/libc.so.1...done.
Loaded symbols for /usr/lib/libc.so.1
Reading symbols from /usr/lib/libmp.so.2...done.
Loaded symbols for /usr/lib/libmp.so.2
Reading symbols from /usr/lib/libaio.so.1...done.
Loaded symbols for /usr/lib/libaio.so.1
Reading symbols from /usr/lib/libmd5.so.1...done.
Loaded symbols for /usr/lib/libmd5.so.1
Reading symbols from /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1...done.
Loaded symbols for /usr/platform/SUNW,Ultra-60/lib/libc_psr.so.1
#0  0x0004f17c in mail_cache_map (cache=0x0, offset=757584, size=4290769392)
    at mail-cache.c:244
244                     cache->need_compress_file_seq =
(gdb) backtrace
#0  0x0004f17c in mail_cache_map (cache=0x0, offset=757584, size=4290769392)
    at mail-cache.c:244
#1  0x0004f324 in mail_cache_reopen (cache=0xb8f38) at mail-cache.c:95
#2  0x00062c50 in mail_cache_compress_locked (cache=0xb8f38, view=0xffbff320)
    at mail-cache-compress.c:305
#3  0x000631d0 in mail_cache_compress (cache=0x0, view=0xbc460)
    at mail-cache-compress.c:367
#4  0x00059958 in mail_index_sync_commit (_ctx=0x0) at mail-index-sync.c:671
#5  0x0003c3e0 in mbox_sync (mbox=0x0, flags=4290770300) at mbox-sync.c:1717
#6  0x0003c710 in mbox_storage_sync_init (box=0x1,
    flags=MAILBOX_SYNC_FLAG_NO_EXPUNGES) at mbox-sync.c:1780
#7  0x00065b48 in mailbox_sync_init (box=Variable "box" is not available.
) at mail-storage.c:387
#8  0x00028370 in imap_sync_nonselected (box=0xbb3d0,
    flags=MAILBOX_SYNC_FLAG_FULL_READ) at imap-sync.c:195
#9  0x000205ec in _cmd_select_full (cmd=0x0, readonly=true) at cmd-select.c:39
#10 0x00020760 in cmd_select (cmd=0x1) at cmd-select.c:92
#11 0x00022150 in _client_input (context=Variable "context" is not available.
) at client.c:375
#12 0x00079718 in io_loop_handler_run (ioloop=0xb1b40) at ioloop-poll.c:203
#13 0x00078f94 in io_loop_run (ioloop=0xaf440) at ioloop.c:274
#14 0x0002a560 in main (argc=717888, argv=0x1, envp=Variable "envp" is not available.
) at main.c:271
(gdb) print *cache
Cannot access memory at address 0x0
(gdb) up
#1  0x0004f324 in mail_cache_reopen (cache=0xb8f38) at mail-cache.c:95
95              if (mail_cache_map(cache, 0, 0) < 0)
(gdb) print *cache
$1 = {index = 0xb7fc8, ext_id = 1,
  filepath = 0xb8fc8 "/home/students/s/senagel/.imap/sent-mail-apr-2004/dovecot.index.cache", fd = 9, mmap_base = 0xfefa0000, data = 0xfefa0000,
  mmap_length = 316416, file_cache = 0x0, dotlock_settings = {
    temp_prefix = 0x0, lock_suffix = 0x0, timeout = 120, stale_timeout = 60,
    callback = 0, context = 0x0, use_excl_lock = 0}, dotlock = 0x0, hdr = 0x0,
  hdr_copy = {version = 0 '\0', compat_sizeof_uoff_t = 0 '\0',
    compat_sizeof_time_t = 0 '\0', unused = 0 '\0', indexid = 0, file_seq = 0,
    continued_record_count = 0, hole_offset = 0, used_file_size = 0,
    deleted_space = 0, field_header_offset = 0}, field_pool = 0xbb7a8,
  fields = 0xbc188, field_file_map = 0xb9018, fields_count = 9,
  field_name_hash = 0xb8388, need_compress_file_seq = 0, file_field_map = 0x0,
  file_fields_count = 0, locked = 0, hdr_modified = 1,
  field_header_write_pending = 0}
(gdb) print *view
Variable "view" is not available.
(gdb) up
#2  0x00062c50 in mail_cache_compress_locked (cache=0xb8f38, view=0xffbff320)
    at mail-cache-compress.c:305
305                     return mail_cache_reopen(cache);
(gdb) print *view
$2 = {refcount = 0, methods = {close = 0,
    get_messages_count = 0x8e400 <__PRETTY_FUNCTION__.5370+16>,
    get_header = 0x8e400 <__PRETTY_FUNCTION__.5370+16>, lookup_full = 0,
    lookup_uid = 0xbc494, lookup_uid_range = 0xffbff3d0,
    lookup_first = 0x59934 <mail_index_sync_commit+184>, lookup_ext_full = 0,
    get_header_ext = 0xbde9c}, index = 0xbc460, log_view = 0x0, indexid = 4,
  map = 0xbde9c, sync_new_map = 0xbcb18, map_refs = {buffer = 0xbdeb4,
    element_size = 757560}, hdr = {major_version = 0 '\0',
    minor_version = 12 '\f', base_header_size = 15224, header_size = 801664,
    record_size = 753608, compat_flags = 68 'D', unused = "o??", indexid = 1,
    flags = 0, uid_validity = 0, next_uid = 771168, messages_count = 582656,
    recent_messages_count = 582656, seen_messages_count = 0,
    deleted_messages_count = 771220, first_recent_uid_lowwater = 4290769872,
    first_unseen_uid_lowwater = 366928, first_deleted_uid_lowwater = 771168,
    log_file_seq = 0, log_file_int_offset = 0, log_file_ext_offset = 0,
    sync_size = 4, sync_stamp = 1, day_stamp = 0, day_first_uid = {0, 0,
      753608, 4290770460, 753608, 771112, 4290770460, 0}},
  log_file_seq = 777360, log_file_offset = 1799591297024, log_syncs = {
    buffer = 0x0, element_size = 4290770300}, transactions = -4197008,
  lock_id = 0, inconsistent = 0, syncing = 0, broken_counters = 0}
(gdb) up
#3  0x000631d0 in mail_cache_compress (cache=0x0, view=0xbc460)
    at mail-cache-compress.c:367
367                     return mail_cache_compress_locked(cache, view);
(gdb) print *view
$3 = {refcount = 1, methods = {close = 0x5d078 <_view_close>,
    get_messages_count = 0x5c30c <_view_get_messages_count>,
    get_header = 0x5c7e4 <_view_get_header>,
    lookup_full = 0x5ce00 <_view_lookup_full>,
    lookup_uid = 0x5cce8 <_view_lookup_uid>,
    lookup_uid_range = 0x5cb7c <_view_lookup_uid_range>,
    lookup_first = 0x5c9b4 <_view_lookup_first>,
    lookup_ext_full = 0x5c630 <_view_lookup_ext_full>,
    get_header_ext = 0x5d430 <_view_get_header_ext>}, index = 0xb7fc8,
  log_view = 0xbc550, indexid = 1148252687, map = 0xc3b78, sync_new_map = 0x0,
  map_refs = {buffer = 0x0, element_size = 0}, hdr = {major_version = 7 '\a',
    minor_version = 0 '\0', base_header_size = 120, header_size = 144,
    record_size = 16, compat_flags = 0 '\0', unused = "\000\000",
    indexid = 1148252687, flags = 0, uid_validity = 1061934138,
    next_uid = 420, messages_count = 419, recent_messages_count = 0,
    seen_messages_count = 419, deleted_messages_count = 0,
    first_recent_uid_lowwater = 0, first_unseen_uid_lowwater = 420,
    first_deleted_uid_lowwater = 0, log_file_seq = 1,
    log_file_int_offset = 8532, log_file_ext_offset = 8532,
    sync_size = 3088940, sync_stamp = 1084242696, day_stamp = 1148184000,
    day_first_uid = {1, 0, 0, 0, 0, 0, 0, 0}}, log_file_seq = 1,
  log_file_offset = 24, log_syncs = {buffer = 0x0, element_size = 0},
  transactions = 0, lock_id = 0, inconsistent = 0, syncing = 0,
  broken_counters = 0}
(gdb) up
#4  0x00059958 in mail_index_sync_commit (_ctx=0x0) at mail-index-sync.c:671
671                     if (mail_cache_compress(index->cache, ctx->view) == 0) {
(gdb) print index
$4 = (struct mail_index *) 0x0
(gdb) print ctx
$5 = (struct mail_index_sync_ctx *) 0x0
(gdb) up
#5  0x0003c3e0 in mbox_sync (mbox=0x0, flags=4290770300) at mbox-sync.c:1717
1717            else if (mail_index_sync_commit(&index_sync_ctx) < 0) {
(gdb) print index_sync_ctx
Cannot access memory at address 0xffffffec
(gdb) up
#6  0x0003c710 in mbox_storage_sync_init (box=0x1,
    flags=MAILBOX_SYNC_FLAG_NO_EXPUNGES) at mbox-sync.c:1780
1780                    ret = mbox_sync(mbox, mbox_sync_flags);
(gdb) print *box
Cannot access memory at address 0x1
(gdb) print mbox
Variable "mbox" is not available.
(gdb) up
#7  0x00065b48 in mailbox_sync_init (box=Variable "box" is not available.
) at mail-storage.c:387
387             return box->v.sync_init(box, flags);
(gdb) print flags
$6 = MAILBOX_SYNC_FLAG_FULL_READ
(gdb) up
#8  0x00028370 in imap_sync_nonselected (box=0xbb3d0,
    flags=MAILBOX_SYNC_FLAG_FULL_READ) at imap-sync.c:195
195             ctx = mailbox_sync_init(box, flags);
(gdb) print *box
$7 = {name = 0xbb528 "sent-mail-apr-2004", storage = 0xb1978, v = {
    is_readonly = 0x4d498 <index_storage_is_readonly>,
    allow_new_keywords = 0x4d4a4 <index_storage_allow_new_keywords>,
    close = 0x33258 <mbox_storage_close>,
    get_status = 0x4d46c <index_storage_get_status>,
    sync_init = 0x3c6ac <mbox_storage_sync_init>,
    sync_next = 0x4e2e8 <index_mailbox_sync_next>,
    sync_deinit = 0x4e174 <index_mailbox_sync_deinit>,
    notify_changes = 0x33210 <mbox_notify_changes>,
    transaction_begin = 0x3505c <mbox_transaction_begin>,
    transaction_commit = 0x34f44 <mbox_transaction_commit>,
    transaction_rollback = 0x34efc <mbox_transaction_rollback>,
    keywords_create = 0x4d514 <index_keywords_create>,
    keywords_free = 0x4d4fc <index_keywords_free>,
    get_uids = 0x48d2c <index_storage_get_uids>,
    mail_alloc = 0x4a3b8 <index_mail_alloc>,
    header_lookup_init = 0x4a6cc <index_header_lookup_init>,
    header_lookup_deinit = 0x4a6b0 <index_header_lookup_deinit>,
    search_get_sorting = 0x4c000 <index_storage_search_get_sorting>,
    search_init = 0x4d0dc <index_storage_search_init>,
    search_deinit = 0x4ce2c <index_storage_search_deinit>,
    search_next = 0x4c0cc <index_storage_search_next>,
    search_next_update_seq = 0x4c00c <index_storage_search_next_update_seq>,
    save_init = 0x37e28 <mbox_save_init>,
    save_continue = 0x37ab4 <mbox_save_continue>,
    save_finish = 0x37750 <mbox_save_finish>,
    save_cancel = 0x379c4 <mbox_save_cancel>,
    copy = 0x65384 <mail_storage_copy>,
    is_inconsistent = 0x4d598 <index_storage_is_inconsistent>},
  pool = 0xbb3a0, module_contexts = {buffer = 0xbb540, element_size = 4}}
(gdb) print flags
$8 = MAILBOX_SYNC_FLAG_FULL_READ
(gdb) up
#9  0x000205ec in _cmd_select_full (cmd=0x0, readonly=true) at cmd-select.c:39
39              if (imap_sync_nonselected(box, MAILBOX_SYNC_FLAG_FULL_READ) < 0) {
(gdb) up
#10 0x00020760 in cmd_select (cmd=0x1) at cmd-select.c:92
92              return _cmd_select_full(cmd, FALSE);
(gdb) up
#11 0x00022150 in _client_input (context=Variable "context" is not available.
) at client.c:375
375                     if (cmd->func(cmd) || cmd->param_error) {
(gdb) print cmd
$9 = (struct client_command_context *) 0x0
(gdb) up
#12 0x00079718 in io_loop_handler_run (ioloop=0xb1b40) at ioloop-poll.c:203
203                                     io->callback(io->context);
(gdb) print *ioloop
$10 = {prev = 0x0, pool = 0x1, ios = 0xaf4d8, notifys = 0xb1bd8,
  next_io = 0xb1d08, timeouts = 0xb1570, handler_context = 0x0,
  notify_handler_context = 0xb5dc0, running = 0}
(gdb) up
#13 0x00078f94 in io_loop_run (ioloop=0xaf440) at ioloop.c:274
274                     io_loop_handler_run(ioloop);
(gdb) print *ioloop
$11 = {prev = 0x0, pool = 0xa62cc, ios = 0xaf4d8, notifys = 0x0,
  next_io = 0xaf4b8, timeouts = 0xb0b68, handler_context = 0xaf478,
  notify_handler_context = 0x0, running = 1}
(gdb) quit


More information about the dovecot mailing list