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 ,
free = 0x8054abc ,
set_lock = 0x805c874 ,
try_lock = 0x805c88c ,
set_lock_notify_callback = 0x805c8a4 ,
rebuild = 0x8054f20 ,
fsck = 0x805de50 ,
sync_and_lock = 0x8055db4 ,
get_header = 0x805c928 ,
lookup = 0x805c968 , next = 0x805cac0 ,
lookup_uid_range = 0x805cb48 ,
lookup_field = 0x805cc58 ,
lookup_field_raw = 0x805ccac ,
cache_fields_later = 0x805cd70 ,
open_mail = 0x8054de0 ,
get_internal_date = 0x8054afc ,
expunge = 0x805d078 ,
update_flags = 0x8054b6c ,
append_begin = 0x805d3ec ,
append_end = 0x805d4e4 ,
append_abort = 0x805d590 ,
update_begin = 0x805f9b0 ,
update_end = 0x805ff68 ,
update_abort = 0x8060050 ,
update_field = 0x806022c ,
update_field_raw = 0x806025c ,
get_last_error = 0x805d618 ,
get_last_error_text = 0x805d678 ,
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_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 , free = 0x804b428 ,
autodetect = 0x804b480 ,
set_callbacks = 0x80535e4 ,
open_mailbox = 0x804b940 ,
create_mailbox = 0x804ba5c ,
delete_mailbox = 0x804bb08 ,
rename_mailbox = 0x804bea4 ,
list_mailbox_init = 0x804c624 ,
list_mailbox_deinit = 0x804c800 ,
list_mailbox_next = 0x804cc48 ,
set_subscribed = 0x8064594 ,
get_mailbox_name_status = 0x804bffc ,
get_last_error = 0x805455c ,
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 ,
get_status = 0x8052ee4 ,
sync = 0x8053b94 ,
auto_sync = 0x804c0c8 ,
expunge = 0x804fa64 ,
update_flags = 0x8053d58 ,
copy = 0x804c3e4 ,
fetch_init = 0x804fb00 ,
fetch_deinit = 0x804fbe8 ,
fetch_next = 0x804fc70 ,
fetch_uid = 0x804fd5c ,
fetch_seq = 0x804fdc0 ,
search_get_sorting = 0x8052af4 ,
search_init = 0x8052b08 ,
search_deinit = 0x8052be0 ,
search_next = 0x8052ca0 ,
save_init = 0x804cf4c ,
save_deinit = 0x804cfe0 ,
save_next = 0x804ce04 ,
is_inconsistency_error = 0x8054578 ,
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