2.2.15 Panic in mbox_sync_read_next_mail()

Hans Morten Kind Kind at adm.uib.no
Wed Oct 29 13:03:48 UTC 2014


It might not be a fault in dovecot, as the user is accessing the folder locally
with alpine while also running imap-sessions.  However it would have been nice
with a more graceful action than panic?

The panic is preceeded by
 Error: Next message unexpectedly corrupted in mbox file PATH

Panic: file mbox-sync.c: line 152 (mbox_sync_read_next_mail): assertion failed:
 (sync_ctx->input->v_offset != mail_ctx->mail.from_offset || sync_ctx->input->eof)

At #7 in the enclosed backtrace the actual values are
  sync_ctx->input->v_offset = 564
  mail_ctx->mail.from_offset = 564
  sync_ctx->input->eof = 0

Some will recommend convertion to maildir, but with 25 years history, thousands of
active users and dozens terrabytes of mboxes, we are not even considering it.

hmk



GNU gdb 6.8
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 "i386-pc-solaris2.10"...
Reading symbols from /datapool/local/dovecot-2.2.15/lib/dovecot/libdovecot-storage.so.0...done.
Loaded symbols for /local/dovecot-2.2.15/lib/dovecot/libdovecot-storage.so.0
Reading symbols from /datapool/local/dovecot-2.2.15/lib/dovecot/libdovecot.so.0...done.
Loaded symbols for /local/dovecot-2.2.15/lib/dovecot/libdovecot.so.0
Reading symbols from /datapool/local/program/lib/libssl.so.1.0.0...done.
Loaded symbols for /local/program/lib/libssl.so.1.0.0
Reading symbols from /datapool/local/program/lib/libcrypto.so.1.0.0...done.
Loaded symbols for /local/program/lib/libcrypto.so.1.0.0
Reading symbols from /datapool/local/program/lib/libz.so...done.
Loaded symbols for /local/program/lib/libz.so
Reading symbols from /lib/libm.so.2...done.
Loaded symbols for /lib/libm.so.2
Reading symbols from /datapool/local/program/lib/libiconv.so.2...done.
Loaded symbols for /local/program/lib/libiconv.so.2
Reading symbols from /lib/librt.so.1...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libsocket.so.1...done.
Loaded symbols for /lib/libsocket.so.1
Reading symbols from /lib/libsendfile.so.1...done.
Loaded symbols for /lib/libsendfile.so.1
Reading symbols from /lib/libc.so.1...done.
Loaded symbols for /lib/libc.so.1
Reading symbols from /lib/libdl.so.1...done.
Loaded symbols for /lib/libdl.so.1
Reading symbols from /usr/lib/libz.so...done.
Loaded symbols for /usr/lib/libz.so
Reading symbols from /lib/libaio.so.1...done.
Loaded symbols for /lib/libaio.so.1
Reading symbols from /lib/libmd.so.1...done.
Loaded symbols for /lib/libmd.so.1
Reading symbols from /lib/ld.so.1...done.
Loaded symbols for /lib/ld.so.1
Core was generated by `dovecot/imap imap-postlogin'.
Program terminated with signal 6, Aborted.
[New process 86892    ]
#0  0xfe80c8e5 in _lwp_kill () from /lib/libc.so.1
(gdb) #0  0xfe80c8e5 in _lwp_kill () from /lib/libc.so.1
No symbol table info available.
#1  0xfe807765 in thr_kill () from /lib/libc.so.1
No symbol table info available.
#2  0xfe7b376f in raise () from /lib/libc.so.1
No symbol table info available.
#3  0xfe7929e1 in abort () from /lib/libc.so.1
No symbol table info available.
#4  0xfeda1c82 in default_fatal_finish (type=LOG_TYPE_PANIC, status=0) at failures.c:152
	backtrace = 0x8093260 "0xfeda2b9f -> 0xfeda1e9b -> 0xfee9f57a -> 0xfeea207c -> 0xfeea37e9 -> 0xfeea4363 -> 0xfeea45cd -> 0xfeea477d -> 0xfeecb356 -> 0x8074b45 -> 0x805eeda -> 0x805f463 -> 0x806aad1 -> 0x8069a41 -> 0x8069d26"...
#5  0xfeda2b9f in i_internal_fatal_handler (ctx=0x80474e0, 
    format=0xfef4c588 "file %s: line %d (%s): assertion failed: (%s)", args=0x8047504 "°Æôþ\230")
    at failures.c:152
	status = 0
#6  0xfeda1e9b in i_panic (format=0xfef4c588 "file %s: line %d (%s): assertion failed: (%s)")
    at failures.c:152
	ctx = {type = LOG_TYPE_PANIC, exit_status = 0, timestamp = 0x0, timestamp_usecs = 0}
	args = 0x8047504 "°Æôþ\230"
#7  0xfee9f57a in mbox_sync_read_next_mail (sync_ctx=0x8047794, mail_ctx=0x804760c)
    at ../../../../src/lib/array.h:158
	__FUNCTION__ = "mbox_sync_read_next_mail"
#8  0xfeea207c in mbox_sync_loop (sync_ctx=0x8047794, mail_ctx=0x804760c, partial=false)
    at ../../../../src/lib/array.h:158
	rec = (const struct mail_index_record *) 0x0
	uid = 0
	messages_count = 66
	offset = 564
	ret = 1
	expunged = false
	skipped_mails = true
	uids_broken = false
#9  0xfeea37e9 in mbox_sync_do (sync_ctx=0x8047794, flags=0) at ../../../../src/lib/array.h:158
	mbox_hdr = (struct mbox_index_header *) 0x80b4a20
	mail_ctx = {sync_ctx = 0x8047794, mail = {uid = 0, idx_seq = 0, keywords = {arr = {
        buffer = 0x0, element_size = 0}, v = 0x0, v_modifiable = 0x0}, flags = 32 ' ', uid_broken = 0, 
    expunged = 0, pseudo = 0, status_broken = 0, xstatus_broken = 0, from_offset = 564, body_size = 0, 
    offset = 564, space = 0}, seq = 2, hdr_offset = 564, body_offset = 564, 
  header_first_change = 4294967295, header_last_change = 0, header = 0x809c758, 
  hdr_md5_sum = "Ô\035\214Ù\217\000²\004é\200\t\230ìøB~", content_length = 18446744073709551615, 
  hdr_pos = {4294967295, 4294967295, 4294967295, 4294967295, 4294967295}, parsed_uid = 0, 
  last_uid_updated_value = 0, last_uid_value_start_pos = 0, have_eoh = 0, need_rewrite = 0, 
  seen_imapbase = 0, updated = 0, recent = 0, dirty = 0, imapbase_rewrite = 0, imapbase_updated = 0}
	st = (const struct stat *) 0x80c0060
	i = 0
	ret = 52
	partial = 1
#10 0xfeea4363 in mbox_sync_int (mbox=0x80b4868, flags=0, lock_id=0x8047988)
    at ../../../../src/lib/array.h:158
	index_sync_ctx = (struct mail_index_sync_ctx *) 0x80b62e0
	sync_view = (struct mail_index_view *) 0x80b6320
	trans = (struct mail_index_transaction *) 0x80c5890
	sync_ctx = {mbox = 0x80b4868, flags = 0, input = 0x80c0180, file_input = 0x80c0040, 
  write_fd = 12, orig_mtime = 1414582020, orig_atime = 1414582021, orig_size = 3843471, last_stat = {
    st_dev = 47513605, st_pad1 = {0, 0, 0}, st_ino = 17869, st_mode = 33152, st_nlink = 1, 
    st_uid = 22671, st_gid = 4601, st_rdev = 4294967295, st_pad2 = {0, 0}, st_size = 3843471, 
    st_atim = {tv_sec = 1414582021, tv_nsec = 353242309}, st_mtim = {tv_sec = 1414582020, 
      tv_nsec = 0}, st_ctim = {tv_sec = 1414582021, tv_nsec = 352990278}, st_blksize = 131072, 
    st_blocks = 7693, st_fstype = "zfs", '\0' <repeats 12 times>, st_pad4 = {0, 0, 0, 0, 0, 0, 0, 0}}, 
  index_sync_ctx = 0x80b62e0, sync_view = 0x80b6320, t = 0x80c5890, reset_hdr = {
    major_version = 0 '\0', minor_version = 0 '\0', base_header_size = 0, header_size = 0, 
    record_size = 0, compat_flags = 0 '\0', unused = "\000\000", indexid = 0, flags = 0, 
    uid_validity = 0, next_uid = 0, messages_count = 0, unused_old_recent_messages_count = 0, 
    seen_messages_count = 0, deleted_messages_count = 0, first_recent_uid = 0, 
    first_unseen_uid_lowwater = 0, first_deleted_uid_lowwater = 0, log_file_seq = 0, 
    log_file_tail_offset = 0, log_file_head_offset = 0, unused_old_sync_size = 0, 
    unused_old_sync_stamp = 0, day_stamp = 0, day_first_uid = {0, 0, 0, 0, 0, 0, 0, 0}}, 
  hdr = 0x80c5b68, header = 0x809c758, from_line = 0x809c6b8, base_uid_validity = 1353318516, 
  base_uid_last = 144140, base_uid_last_offset = 250, mails = {arr = {buffer = 0x809c640, 
      element_size = 52}, v = 0x809c640, v_modifiable = 0x809c640}, sync_changes = 0x80ab998, 
  mail_keyword_pool = 0x80bf220, saved_keywords_pool = 0x80bcbe0, prev_msg_uid = 0, next_uid = 144141, 
  idx_next_uid = 144141, seq = 2, idx_seq = 1, need_space_seq = 0, last_nonrecent_uid = 0, 
  expunged_space = 0, space_diff = 0, dest_first_mail = 0, first_mail_crlf_expunged = 0, 
  keep_recent = 0, readonly = 0, delay_writes = 1, renumber_uids = 0, moved_offsets = 0, 
  ext_modified = 0, index_reset = 0, errors = 0}
	sync_flags = MAIL_INDEX_SYNC_FLAG_DROP_RECENT
	ret = 1
	changed = 1
	delay_writes = true
	readonly = false
	__FUNCTION__ = "mbox_sync_int"
#11 0xfeea45cd in mbox_sync (mbox=0x80b4868, flags=0) at ../../../../src/lib/array.h:158
	lock_id = 47
	ret = 134957840
	__FUNCTION__ = "mbox_sync"
#12 0xfeea477d in mbox_storage_sync_init (box=0x80b4868, flags=0) at ../../../../src/lib/array.h:158
	mbox = (struct mbox_mailbox *) 0x80b4868
	mbox_sync_flags = 0
	ret = 0
#13 0xfeecb356 in mailbox_sync_init (box=0x80b4868, flags=0) at ../../src/lib/array.h:197
	_data_stack_cur_id = 4
	ctx = (struct mailbox_sync_context *) 0x0
#14 0x08074b45 in imap_sync_init (client=0x80b1850, box=0x80b4868, imap_flags=0, flags=0)
    at ../../src/lib/array.h:158
	ctx = (struct imap_sync_context *) 0x80b61b0
	__FUNCTION__ = "imap_sync_init"
#15 0x0805eeda in idle_sync_now (box=0x80b4868, ctx=0x80b20e0) at cmd-idle.c:74
	__FUNCTION__ = "idle_sync_now"
#16 0x0805f463 in cmd_idle (cmd=0x80b2058) at cmd-idle.c:74
	client = (struct client *) 0x80b1850
	ctx = (struct cmd_idle_context *) 0x80b20e0
#17 0x0806aad1 in command_exec (cmd=0x80b2058) at imap-commands.c:101
	hook = (const struct command_hook *) 0x809c078
	ret = 8
#18 0x08069a41 in client_command_input (cmd=0x80b2058) at imap-client.c:130
	client = (struct client *) 0x80b1850
	command = (struct command *) 0x3
	__FUNCTION__ = "client_command_input"
#19 0x08069d26 in client_command_input (cmd=0x80b2058) at imap-client.c:130
	client = (struct client *) 0x80b1850
	command = (struct command *) 0x809d3cc
	__FUNCTION__ = "client_command_input"
#20 0x08069e29 in client_handle_next_command (client=0x80b1850, remove_io_r=0x8047b9d)
    at imap-client.c:130
No locals.
#21 0x08069ec6 in client_handle_input (client=0x80b1850) at imap-client.c:130
	_data_stack_cur_id = 3
	ret = 10
	remove_io = false
	handled_commands = false
	__FUNCTION__ = "client_handle_input"
#22 0x0806a04f in client_input (client=0x80b1850) at imap-client.c:130
	cmd = (struct client_command_context *) 0x80aaa44
	output = (struct ostream *) 0x80abea8
	bytes = 10
	__FUNCTION__ = "client_input"
#23 0xfedbb235 in io_loop_call_io (io=0x80abf10) at ioloop.c:28
	ioloop = (struct ioloop *) 0x809bfc0
	t_id = 2
	__FUNCTION__ = "io_loop_call_io"
#24 0xfedbc994 in io_loop_handler_run_internal (ioloop=0x809bfc0) at ioloop-poll.c:96
	ctx = (struct ioloop_handler_context *) 0x809cab0
	pollfd = (struct pollfd *) 0x809e148
	tv = {tv_sec = 1799, tv_usec = 999001}
	io = (struct io_file *) 0x80abf10
	msecs = 1800000
	ret = 0
	call = true
#25 0xfedbb3ce in io_loop_handler_run (ioloop=0x809bfc0) at ioloop.c:28
No locals.
#26 0xfedbb325 in io_loop_run (ioloop=0x809bfc0) at ioloop.c:28
	__FUNCTION__ = "io_loop_run"
#27 0xfed41dc1 in master_service_run (service=0x809bf08, callback=0x807724a <client_connected>)
    at master-service.c:75
No locals.
#28 0x080775e7 in main (argc=2, argv=0x809bd18) at main.c:72
	set_roots = {0x8093080, 0x0}
	login_set = {auth_socket_path = 0x8093188 " 1\t\b", postlogin_socket_path = 0x80931c0 "", 
  postlogin_timeout_secs = 60, callback = 0x8076fbe <login_client_connected>, 
  failure_callback = 0x80771cd <login_client_failed>, request_auth_token = 1}
	service_flags = MASTER_SERVICE_FLAG_KEEP_CONFIG_OPEN
	storage_service_flags = MAIL_STORAGE_SERVICE_FLAG_DISALLOW_ROOT
	username = 0x0
	c = -1




More information about the dovecot mailing list