[Dovecot] failed assertion in 1.1.8: istream.c: line 81
Hello,
We're having a problem in Dovecot 1.1.8 with a failed assertion on certain mbox format mailboxes. It happens both with deliver when it attempts to delier to the mailbox, and with IMAP connections for the affected box (though I'm not sure what they're doing at the time).
Mar 3 12:55:26 <snip> dovecot: Panic: IMAP(<snip>): file istream.c: line 81 (i_stream_read): assertion failed: (_stream->skip != _stream->pos)
This is on FreeBSD 6.2, without any nfs. The IMAP client is Squirrel Mail, but as I said, the assertion occurs with deliver as well.
Apparently, moving the inbox out of the way fixed the problem for a while, but then it came back. Clearing out the dovecot index files seemed not to have any effect.
I have a core dump available for deliver; here's a backtrace: #0 0x282bbecb in kill () from /lib/libc.so.6 #1 0x282bbe68 in raise () from /lib/libc.so.6 #2 0x282bab78 in abort () from /lib/libc.so.6 #3 0x080b7ad8 in default_fatal_finish (type=LOG_TYPE_PANIC, status=0) at failures.c:150 #4 0x080b7dbb in i_syslog_fatal_handler (type=LOG_TYPE_PANIC, status=0, fmt=0x80ca9a0 "file %s: line %d (%s): assertion failed: (%s)", args=0xbfbfe2a4 "{\215\r\bQ") at failures.c:308 #5 0x080b7c37 in i_panic (format=0x80ca9a0 "file %s: line %d (%s): assertion failed: (%s)") at failures.c:197 #6 0x080bb8a1 in i_stream_read (stream=0x8102e28) at istream.c:93 #7 0x080bbd3d in i_stream_read_data (stream=0x8102e28, data_r=0xbfbfe350, size_r=0xbfbfe354, threshold=0) at istream.c:322 #8 0x0806d85b in istream_raw_mbox_get_body_size (stream=0x8102e28, expected_body_size=11013) at istream-raw-mbox.c:562 #9 0x080736dd in mbox_sync_do (sync_ctx=0xbfbfe640, flags=0) at mbox-sync.c:151 #10 0x08075700 in mbox_sync (mbox=0x8103028, flags=0) at mbox-sync.c:1833 #11 0x08070001 in mbox_save_init (_t=0x80f2980, flags=0, keywords=0x0, received_date=1236108538, timezone_offset=0, from_envelope=0x80e6100 "<snip>", input=0x80f6f28, dest_mail=0x8106028, ctx_r=0x0) at mbox-save.c:318 #12 0x282ee17f in quota_save_init (t=0x80f2980, flags=0, keywords=0x0, received_date=-1, timezone_offset=0, from_envelope=0x80e6100 "<snip>", input=0x80f6f28, dest_mail=0x8106028, ctx_r=0xbfbfe9f0) at quota-storage.c:236 #13 0x0808e36d in mailbox_save_init (t=0x5, flags=0, keywords=0x0, received_date=-1, timezone_offset=0, from_envelope=0x80e6100 "<snip>", input=0x80f6f28, dest_mail=0x8106028, ctx_r=0xbfbfe9f0) at mail-storage.c:726 #14 0x0808c34a in mail_storage_copy (t=0x80f2980, mail=0xbfbfe9f0, flags=0, keywords=0x0, dest_mail=0x8106028) at mail-copy.c:28 #15 0x282ee08a in quota_copy (t=0x80f2980, mail=0x80fd028, flags=0, keywords=0x0, dest_mail=0x8106028) at quota-storage.c:180 #16 0x080590a4 in deliver_save (namespaces=0x80f7028, storage_r=0xbfbfeb60, mailbox=0x80d0eeb "INBOX", mail=0x80fd028, flags=0, keywords=0x0) at deliver.c:237 #17 0x0805a90c in main (argc=5, argv=0xbfbfec14) at deliver.c:1093
Does anyone have any clues on how to debug this further? I wonder if the original bug reporter removed both the mailbox and the index files at the same time; the current explanation is less than satisfactory.
Thanks, Alan Ferrency pair Networks, Inc.
On Tue, 2009-03-03 at 15:35 -0500, Alan Ferrency wrote:
I have a core dump available for deliver; here's a backtrace:
Could you also do:
#6 0x080bb8a1 in i_stream_read (stream=0x8102e28) at istream.c:93
fr 6 p *stream p *stream.real_stream p *stream.real_stream.parent p *stream.real_stream.parent.real_stream
On Tue, 3 Mar 2009, Timo Sirainen wrote:
On Tue, 2009-03-03 at 15:35 -0500, Alan Ferrency wrote:
I have a core dump available for deliver; here's a backtrace:
Could you also do:
#6 0x080bb8a1 in i_stream_read (stream=0x8102e28) at istream.c:93
fr 6 p *stream p *stream.real_stream p *stream.real_stream.parent p *stream.real_stream.parent.real_stream
Sure.
(To add insult to injury, it's spam of course...)
(gdb) p *stream
$1 = {v_offset = 676764, stream_errno = 0, mmaped = 0, blocking = 1, closed = 0, seekable = 1, eof = 0,
real_stream = 0x8102e00}
(gdb) p *stream.real_stream
$2 = {iostream = {refcount = 1, close = 0x80c925c
Thanks, Alan Ferrency pair Networks, Inc.
On Tue, 2009-03-03 at 15:42 -0500, Alan Ferrency wrote:
On Tue, 3 Mar 2009, Timo Sirainen wrote:
On Tue, 2009-03-03 at 15:35 -0500, Alan Ferrency wrote:
I have a core dump available for deliver; here's a backtrace:
Could you also do:
#6 0x080bb8a1 in i_stream_read (stream=0x8102e28) at istream.c:93
fr 6 p *stream p *stream.real_stream p *stream.real_stream.parent p *stream.real_stream.parent.real_stream
Sure.
There's some bug here, but I'm not really sure where exactly the bug is. Could you apply the attached patch, remove -O2 from CFLAGS in src/lib-storage/index/mbox/Makefile, install and see if the assert moves to the istream-raw-mbox.c. If it does, again do:
fr 6 p ret p pos p new_pos p *rstream p *stream.parent p *stream.parent.real_stream
On Tue, 2009-03-03 at 15:35 -0500, Alan Ferrency wrote:
Mar 3 12:55:26 <snip> dovecot: Panic: IMAP(<snip>): file istream.c: line 81 (i_stream_read): assertion failed: (_stream->skip != _stream->pos)
Thanks!
Is this going into the 1.1 branch for a future release, curiously?
And do I still need the previous patch(es) you sent? I expect not.
Alan Ferrency pair Networks, Inc.
On Thu, 5 Mar 2009, Timo Sirainen wrote:
On Tue, 2009-03-03 at 15:35 -0500, Alan Ferrency wrote:
Mar 3 12:55:26 <snip> dovecot: Panic: IMAP(<snip>): file istream.c: line 81 (i_stream_read): assertion failed: (_stream->skip != _stream->pos)
The patch fixes everything. Thanks!
Alan Ferrency pair Networks, Inc.
On Thu, 5 Mar 2009, Timo Sirainen wrote:
On Thu, 2009-03-05 at 13:51 -0500, Alan Ferrency wrote:
Thanks!
Is this going into the 1.1 branch for a future release, curiously?
Yes.
And do I still need the previous patch(es) you sent? I expect not.
Probably not.
participants (2)
-
Alan Ferrency
-
Timo Sirainen