[dovecot] pop3 coredump

Mark E. Mallett mem at mv.mv.com
Wed Apr 16 00:07:29 EEST 2003


Hi-

I was able to get a coredump out of the new pop3 (from 0.99.9-test4)
by attempting to simulate the execution environment and simply running
the pop3 program.

Running the older pop3 from 0.99.8.1 works fine, repeatedly:

% /usr/local/libexec/dovecot/pop3
quit
+OK Logging out.

However running the new one:

% /usr/local/libexec/dovecot/pop3.new
pop3(user9): Error: Corrupted index file
/users/48/user9/Maildir/.INBOX/.imap.index:  index.next_uid (4539) >
uidlist.next_uid (4000)
Segmentation fault (core dumped)

It doesn't always dump core even with this message.  The error message
is not always the same, but it's usually what's above.  Simply
repeating the invocation a number of times I also saw:

pop3(user9): Error: Corrupted index file (in-memory index for
/users/48/user9/Maildir): Filename mismatch for UID 1:
1050440153.17005.mercury.mv.net vs 1050437948.5418.mercury.mv.net

Here's some gdb output corresponding to the coredump above.

-mm-


Script started on Tue Apr 15 16:51:28 2003
% gdb pop3/pop3 pop3.core
  ...
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/libiconv.so.2...done.
Reading symbols from /shlib/libgcc.so.1...done.
Reading symbols from /shlib/libc.so.2...done.
Reading symbols from /shlib/ld-bsdi.so...done.
#0  0x0 in ?? ()
(gdb) bt
#0  0x0 in ?? ()
#1  0x8053439 in index_storage_init (storage=0x808f000, box=0x8080658, 
    index=0x808c200, name=0x807660e "INBOX", readonly=0, fast=0)
    at index-storage.c:264
#2  0x804b8e0 in maildir_open (storage=0x808f000, name=0x807660e "INBOX", 
    readonly=0, fast=0) at maildir-storage.c:239
#3  0x804ba20 in maildir_open_mailbox (storage=0x808f000, 
    name=0x80765b1 "INBOX", readonly=0, fast=0) at maildir-storage.c:288
#4  0x804b1c7 in main_init () at main.c:98
#5  0x804b269 in main (argc=1, argv=0x8047d3c, envp=0x8047d44) at main.c:132
#6  0x8049cae in __start ()
(gdb) up 1
#1  0x8053439 in index_storage_init (storage=0x808f000, box=0x8080658, 
    index=0x808c200, name=0x807660e "INBOX", readonly=0, fast=0)
    at index-storage.c:264
264                                     storage->callbacks->notify_no(&ibox->box,
(gdb) l
259                             if (!index->open(index, flags))
260                                     break;
261     
262                             if (INDEX_IS_IN_MEMORY(index) &&
263                                 storage->index_dir != NULL) {
264                                     storage->callbacks->notify_no(&ibox->box,
265                                             "Couldn't use index files",
266                                             storage->callback_context);
267                             }
268                     }
(gdb) p index
$1 = (struct mail_index *) 0x808c200
(gdb) p *index
$2 = {open = 0x8054590 <maildir_index_open>, 
  free = 0x8054abc <maildir_index_free>, 
  set_lock = 0x805c874 <mail_index_set_lock>, 
  try_lock = 0x805c88c <mail_index_try_lock>, 
  set_lock_notify_callback = 0x805c8a4 <mail_index_set_lock_notify_callback>, 
  rebuild = 0x8054f20 <maildir_index_rebuild>, 
  fsck = 0x805de50 <mail_index_fsck>, 
  sync_and_lock = 0x8055db4 <maildir_index_sync>, 
  get_header = 0x805c928 <mail_index_get_header>, 
  lookup = 0x805c968 <mail_index_lookup>, next = 0x805cac0 <mail_index_next>, 
  lookup_uid_range = 0x805cb48 <mail_index_lookup_uid_range>, 
  lookup_field = 0x805cc58 <mail_index_lookup_field>, 
  lookup_field_raw = 0x805ccac <mail_index_lookup_field_raw>, 
  cache_fields_later = 0x805cd70 <mail_index_cache_fields_later>, 
  open_mail = 0x8054de0 <maildir_open_mail>, 
  get_internal_date = 0x8054afc <maildir_get_internal_date>, 
  expunge = 0x805d078 <mail_index_expunge>, 
  update_flags = 0x8054b6c <maildir_index_update_flags>, 
  append_begin = 0x805d3ec <mail_index_append_begin>, 
  append_end = 0x805d4e4 <mail_index_append_end>, 
  append_abort = 0x805d590 <mail_index_append_abort>, 
  update_begin = 0x805f9b0 <mail_index_update_begin>, 
  update_end = 0x805ff68 <mail_index_update_end>, 
  update_abort = 0x8060050 <mail_index_update_abort>, 
  update_field = 0x806022c <mail_index_update_field>, 
  update_field_raw = 0x806025c <mail_index_update_field_raw>, 
  get_last_error = 0x805d618 <mail_index_get_last_error>, 
  get_last_error_text = 0x805d678 <mail_index_get_last_error_text>, 
  data = 0x80821a0, tree = 0x80900c0, modifylog = 0x808d200, 
  custom_flags = 0x808d100, 
  dir = 0x8090000 "/users/48/user9/Maildir/.INBOX", 
  filepath = 0x8090040 "(in-memory index for /users/48/user9/Maildir)", 
  mailbox_path = 0x8082160 "/users/48/user9/Maildir", 
  custom_flags_dir = 0x0, default_cache_fields = 0, never_cache_fields = 0, 
  indexid = 1050439124, sync_id = 6, excl_lock_counter = 1, mbox_fd = 0, 
  mbox_stream = 0x0, mbox_lock_type = MAIL_LOCK_UNLOCK, mbox_dotlock = {
    dev = 0, ino = 0, mtime = 0}, mbox_lock_counter = 0, mbox_sync_counter = 0, 
  mbox_size = 0, mbox_dev = 0, mbox_ino = 0, uidlist_dev = 18875392, 
  uidlist_ino = 1835546, maildir_lock_fd = -1, fd = -1, error = 0x0, 
  mmap_base = 0x20073000, mmap_used_length = 264, mmap_full_length = 1608, 
  header = 0x20073000, lock_type = MAIL_LOCK_EXCLUSIVE, 
  file_sync_stamp = 1050438868, first_recent_uid = 1, 
  lock_notify_cb = 0x8053238 <lock_notify>, lock_notify_context = 0x808c400, 
  set_flags = 0, set_cache_fields = 0, anon_mmap = 1, opened = 0, 
  rebuilding = 0, mail_read_mmaped = 0, inconsistent = 0, nodiskspace = 0, 
  index_lock_timeout = 0, allow_new_custom_flags = 0, mailbox_readonly = 0, 
  mailbox_lock_timeout = 0}
(gdb) p storage
$3 = (struct mail_storage *) 0x808f000
(gdb) p *storage
$5 = {name = 0x8076805 "maildir", hierarchy_sep = 46 '.', 
  create = 0x804b2c0 <maildir_create>, free = 0x804b428 <maildir_free>, 
  autodetect = 0x804b480 <maildir_autodetect>, 
  set_callbacks = 0x80535e4 <index_storage_set_callbacks>, 
  open_mailbox = 0x804b940 <maildir_open_mailbox>, 
  create_mailbox = 0x804ba5c <maildir_create_mailbox>, 
  delete_mailbox = 0x804bb08 <maildir_delete_mailbox>, 
  rename_mailbox = 0x804bea4 <maildir_rename_mailbox>, 
  list_mailbox_init = 0x804c624 <maildir_list_mailbox_init>, 
  list_mailbox_deinit = 0x804c800 <maildir_list_mailbox_deinit>, 
  list_mailbox_next = 0x804cc48 <maildir_list_mailbox_next>, 
  set_subscribed = 0x8064594 <subsfile_set_subscribed>, 
  get_mailbox_name_status = 0x804bffc <maildir_get_mailbox_name_status>, 
  get_last_error = 0x805455c <mail_storage_get_last_error>, 
  dir = 0x8082100 "/users/48/user9/Maildir", inbox_file = 0x0, 
  index_dir = 0x8082120 "/users/48/user9/Maildir", 
  user = 0x808e050 "user9", error = 0x0, callbacks = 0x8082140, 
  callback_context = 0x0, syntax_error = 0}
(gdb) p ibox
$6 = (struct index_mailbox *) 0x808c400
(gdb) p *ibox
$7 = {box = {name = 0x808e070 "INBOX", storage = 0x808f000, 
    close = 0x805359c <index_storage_close>, 
    get_status = 0x8052ee4 <index_storage_get_status>, 
    sync = 0x8053b94 <index_storage_sync>, 
    auto_sync = 0x804c0c8 <maildir_storage_auto_sync>, 
    expunge = 0x804fa64 <index_storage_expunge>, 
    update_flags = 0x8053d58 <index_storage_update_flags>, 
    copy = 0x804c3e4 <maildir_storage_copy>, 
    fetch_init = 0x804fb00 <index_storage_fetch_init>, 
    fetch_deinit = 0x804fbe8 <index_storage_fetch_deinit>, 
    fetch_next = 0x804fc70 <index_storage_fetch_next>, 
    fetch_uid = 0x804fd5c <index_storage_fetch_uid>, 
    fetch_seq = 0x804fdc0 <index_storage_fetch_seq>, 
    search_get_sorting = 0x8052af4 <index_storage_search_get_sorting>, 
    search_init = 0x8052b08 <index_storage_search_init>, 
    search_deinit = 0x8052be0 <index_storage_search_deinit>, 
    search_next = 0x8052ca0 <index_storage_search_next>, 
    save_init = 0x804cf4c <maildir_storage_save_init>, 
    save_deinit = 0x804cfe0 <maildir_storage_save_deinit>, 
    save_next = 0x804ce04 <maildir_storage_save_next>, 
    is_inconsistency_error = 0x8054578 <mail_storage_is_inconsistency_error>, 
    readonly = 0, allow_custom_flags = 0, inconsistent = 0}, 
  expunge_locked = 0, index = 0x808c200, autosync_to = 0x0, 
  autosync_files = 0x0, autosync_type = MAILBOX_SYNC_NONE, sync_last_check = 0, 
  min_newmail_notify_interval = 0, fetch_mail = {mail = {seq = 0, uid = 0, 
      seen_updated = 0, get_flags = 0, get_parts = 0, get_received_date = 0, 
      get_date = 0, get_size = 0, get_header = 0, get_address = 0, 
      get_first_mailbox = 0, get_stream = 0, get_special = 0}, data = {flags = {
        flags = 0, custom_flags = 0x0, custom_flags_count = 0}, 
      received_date = 0, size = 0, sent_time = 0, sent_timezone = 0, 
      headers = 0x0, parts = 0x0, envelope = 0x0, body = 0x0, 
      bodystructure = 0x0, envelope_data = 0x0, rec = 0x0, stream = 0x0, 
      hdr_size = {physical_size = 0, virtual_size = 0, lines = 0}, body_size = {
        physical_size = 0, virtual_size = 0, lines = 0}, parse_header = 0, 
      save_sent_time = 0, save_envelope = 0, hdr_size_set = 0, 
      body_size_set = 0}, pool = 0x0, ibox = 0x0, header_buf = 0x0, 
    wanted_fields = 0, wanted_headers = 0x0}, synced_messages_count = 0, 
  next_lock_notify = 1050439154, 
  last_notify_type = MAIL_LOCK_NOTIFY_MAILBOX_ABORT, sent_diskspace_warning = 0}
(gdb) quit
% exit
Script done on Tue Apr 15 16:53:06 2003



More information about the dovecot mailing list