Timo,
Attached is gdb information from core dumps related to the
following assert in test-80:
IMAP(username): file mbox-sync-update.c: line 442
(mbox_sync_update_header_from): assertion failed: (ctx->mail.uid == 0 ||
ctx->mail.uid_broken || ctx->mail.uid == mail->uid)
My setup: Solaris 9, mbox format. test-80 compiled with
gcc 4.0.1 using the following configure options:
CC=gcc CFLAGS="-g -O" CPPFLAGS=-I/opt/openssl/include
LDFLAGS=-L/opt/openssl/lib \
./configure --prefix=/opt/dovecot.test80 --with-ssl=openssl \
--with-ssldir=/opt/openssl/ssl --with-rawlog --enable-debug
Note that system mailboxes are NFS mounted from the mail server
to the IMAP server, which may cause you to groan.
The attached debug session was done with gdb 6.3, also compiled
with gcc 4.0.1. Note that some of the variables I queried were
undefined (or otherwise unknown to gdb). The variable
"first_nonexpunged"
at line 470 of mbox-sync-rewrite.c is undefined, and I wondered
why it was scoped so locally. The value of mails[idx] being
undefined at mbox-sync-rewrite.c:353 also seems like bad news.
Hope this helps.
Jeff Earickson
Colby College
-------------- next part --------------
Script started on Tue Aug 16 10:42:17 2005
%pwd
/opt/dovecot.test80/libexec/dovecot
%ls
checkpassword-reply* deliver* imap-login* rawlog*
core.bhkelly dovecot-auth* pop3* typescript
core.rbfaruq imap* pop3-login*
%gdb imap core.h[Kbhkelly
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"...
Core was generated by `imap'.
Program terminated with signal 6, Aborted.
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 0xff2201a0 in _libc_kill () from /usr/lib/libc.so.1
(gdb) backtrace
#0 0xff2201a0 in _libc_kill () from /usr/lib/libc.so.1
#1 0xff1b6ce0 in abort () from /usr/lib/libc.so.1
#2 0x00069614 in i_internal_panic_handler (fmt=0x7d400 "file %s: line %d
(%s): assertion failed: (%s)",
args=0xffbff310) at failures.c:374
#3 0x000690f8 in i_panic (format=0x7d400 "file %s: line %d (%s): assertion
failed: (%s)") at failures.c:173
#4 0x0003f338 in mbox_sync_update_header_from (ctx=0xffbff3a0, mail=0xb3900) at
mbox-sync-update.c:443
#5 0x0003db78 in mbox_sync_read_and_move (sync_ctx=0xffbff708, mails=Variable
"mails" is not available.
) at mbox-sync-rewrite.c:353
#6 0x0003e0dc in mbox_sync_rewrite (sync_ctx=0xffbff708, end_offset=The value
of variable 'end_offset' is distributed across several
locations, and GDB cannot access its value.
) at mbox-sync-rewrite.c:473
#7 0x0003a328 in mbox_sync_handle_eof_updates (sync_ctx=0xffbff708,
mail_ctx=0xffbff5d8) at mbox-sync.c:1265
#8 0x0003a9f4 in mbox_sync_do (sync_ctx=0xffbff708, flags=Variable
"flags" is not available.
) at mbox-sync.c:1465
#9 0x0003b040 in mbox_sync (mbox=0xa6758, flags=MBOX_SYNC_REWRITE) at
mbox-sync.c:1692
#10 0x0003361c in mbox_storage_close (box=0xa6758) at mbox-storage.c:955
#11 0x0005bd08 in mailbox_close (box=Variable "box" is not available.
) at mail-storage.c:298
#12 0x00020320 in cmd_unselect (cmd=0x9f1cc) at cmd-unselect.c:18
#13 0x00020c84 in client_handle_input (cmd=0x9f1cc) at client.c:334
#14 0x00020d8c in _client_input (context=Variable "context" is not
available.
) at client.c:386
#15 0x0006ea18 in io_loop_handler_run (ioloop=0x9d090) at ioloop-poll.c:184
#16 0x0006e2e4 in io_loop_run (ioloop=0x9d090) at ioloop.c:230
#17 0x000293a8 in main (argc=0, argv=0xffbffbac, envp=0xffbffbb4) at main.c:229
(gdb) up 4
#4 0x0003f338 in mbox_sync_update_header_from (ctx=0xffbff3a0, mail=0xb3900) at
mbox-sync-update.c:443
443 ctx->mail.uid = mail->uid;
(gdb) print *ctx
$1 = {sync_ctx = 0xffbff708, mail = {uid = 21, idx_seq = 0, keywords = {buffer =
0x0, element_size = 0},
keywords__type = 0x0, flags = 8 '\b', uid_broken = 0, from_offset =
0, body_size = 20202, offset = 50,
space = 0}, seq = 1, hdr_offset = 50, body_offset = 961, header_first_change
= 4294967295,
header_last_change = 0, header = 0x9e408, hdr_md5_sum = "\000\005Z?
'\222f?\237\237\"??E?", content_length = 20202,
hdr_pos = {851, 4294967295, 877, 864, 885}, parsed_uid = 21,
last_uid_value_start_pos = 0, have_eoh = 1,
need_rewrite = 1, seen_imapbase = 0, pseudo = 0, updated = 0, recent = 0,
dirty = 0, imapbase_rewrite = 0,
imapbase_updated = 0}
(gdb) print *mail
$2 = {uid = 1, idx_seq = 1, keywords = {buffer = 0x0, element_size = 0},
keywords__type = 0x0, flags = 136 '\210',
uid_broken = 0, from_offset = 0, body_size = 20202, offset = 50, space = -33}
(gdb) print ctx->mail.uid
$3 = 21
(gdb) print ctx->mail.uid_broken
$4 = 0
(gdb) print mail->uid
$5 = 1
(gdb) up
#5 0x0003db78 in mbox_sync_read_and_move (sync_ctx=0xffbff708, mails=Variable
"mails" is not available.
) at mbox-sync-rewrite.c:353
353 mbox_sync_update_header_from(&mail_ctx,
&mails[idx]);
(gdb) print mail_ctx
$6 = {sync_ctx = 0xffbff708, mail = {uid = 21, idx_seq = 0, keywords = {buffer =
0x0, element_size = 0},
keywords__type = 0x0, flags = 8 '\b', uid_broken = 0, from_offset =
0, body_size = 20202, offset = 50,
space = 0}, seq = 1, hdr_offset = 50, body_offset = 961, header_first_change
= 4294967295,
header_last_change = 0, header = 0x9e408, hdr_md5_sum = "\000\005Z?
'\222f?\237\237\"??E?", content_length = 20202,
hdr_pos = {851, 4294967295, 877, 864, 885}, parsed_uid = 21,
last_uid_value_start_pos = 0, have_eoh = 1,
need_rewrite = 1, seen_imapbase = 0, pseudo = 0, updated = 0, recent = 0,
dirty = 0, imapbase_rewrite = 0,
imapbase_updated = 0}
(gdb) print idx
Variable "idx" is not available.
(gdb) print mails
Variable "mails" is not available.
(gdb) print *mails
Variable "mails" is not available.
(gdb) up
#6 0x0003e0dc in mbox_sync_rewrite (sync_ctx=0xffbff708, end_offset=The value
of variable 'end_offset' is distributed across several
locations, and GDB cannot access its value.
) at mbox-sync-rewrite.c:473
473 if (mbox_sync_read_and_move(sync_ctx, mails,
(gdb) print idx
$7 = 0
(gdb) print mails
$8 = (struct mbox_sync_mail *) 0xb3900
(gdb) print *mails
$9 = {uid = 1, idx_seq = 1, keywords = {buffer = 0x0, element_size = 0},
keywords__type = 0x0, flags = 136 '\210',
uid_broken = 0, from_offset = 0, body_size = 20202, offset = 50, space = -33}
(gdb) print first_nonexpunged_idx
$10 = 0
(gdb) print last_sq q eq
$11 = 37
(gdb) print first_seq
$12 = 1
(gdb) rint print padding_per_mail
$13 = 1350
(gdb) print move_diff
The value of variable 'move_diff' is distributed across several
locations, and GDB cannot access its value.
(gdb) print expunged_space
The value of variable 'expunged_space' is distributed across several
locations, and GDB cannot access its value.
(gdb) [pri print end_offset
The value of variable 'end_offset' is distributed across several
locations, and GDB cannot access its value.
(gdb) print first_nonexpunged
No symbol "first_nonexpunged" in current context.
(gdb) up
#7 0x0003a328 in mbox_sync_handle_eof_updates (sync_ctx=0xffbff708,
mail_ctx=0xffbff5d8) at mbox-sync.c:1265
1265 if (mbox_sync_rewrite(sync_ctx, file_size,
(gdb) prnt int *sync_ctx
$14 = {mbox = 0xa6758, flags = MBOX_SYNC_REWRITE, input = 0xacb78, file_input =
0xaca50, write_fd = 7,
index_sync_ctx = 0xa8dc8, sync_view = 0xa92b0, t = 0xab530, hdr = 0xa92f0,
header = 0x9e408, from_line = 0x9e2a0,
base_uid_validity = 1124147662, base_uid_last = 0, base_uid_last_offset = 0,
mails = {buffer = 0x9e458,
element_size = 56}, mails__type = 0x0, syncs = {buffer = 0x9e480,
element_size = 20}, syncs__type = 0x0,
sync_rec = {uid1 = 0, uid2 = 0, type = 0, add_flags = 0 '\0',
remove_flags = 0 '\0', keyword_idx = 0},
mail_keyword_pool = 0xab7a8, prev_msg_uid = 21, next_uid = 58, idx_next_uid =
58, seq = 33, idx_seq = 34,
need_space_seq = 1, expunged_space = 0, space_diff = -1907, dest_first_mail =
1, delay_writes = 0}
(gdb) print file_size
dwarf expression stack underflow
(gdb) print *file_size
dwarf expression stack underflow
(gdb) print st->st_size
Variable "st" is not available.
(gdb) print st
Variable "st" is not available.
(gdb) up
#8 0x0003a9f4 in mbox_sync_do (sync_ctx=0xffbff708, flags=Variable
"flags" is not available.
) at mbox-sync.c:1465
1465 if (mbox_sync_handle_eof_updates(sync_ctx, &mail_ctx) <
0)
(gdb) print st
Variable "st" is not available.
(gdb) print file_size
No symbol "file_size" in current context.
(gdb) quit
%exit
script done on Tue Aug 16 10:56:43 2005