On Aug 13, 2009, at 10:20 PM, Phillip Macey wrote:
Aug 12 15:52:25 fury dovecot: IMAP(zhi): Panic: file istream.c:
line 99 (i_stream_read): assertion failed: ((size_t)ret+old_size
== _stream->pos - _stream->skip)This is kind of annoying problem. I've been adding more of these
asserts to try to catch it, but no one's really found an easy way
to reproduce it.Til now. It would seem that I can reproduce it at will - except that
it doesnt get logged if I have core dumps enabled :-) It could be
specific to my maildir or an email in my maildir?
Yes, it's very likely specific to your maildir. Can you anonymize it
in some way that the crash still happens but you could also send me
the mails? http://dovecot.org/tools/mbox-anonymize.pl does it to
mboxes, looks like it should work for maildir files also as long as
you put $hdr=1; to beginning.
(You may need to compile Dovecot without -O2 parameter to get some
of those values. Easiest way would be to just remove -O2 from src/ lib/Makefile; touch src/lib/istream.c; make; sudo make install) Is this what you are after? I got to this point using telnet to send a copy command as you suggested below and then attaching gdb to the process and stepping through.
If you stepping through you mean you hit enter some thousand times,
you could have also used "continue" command. :)
#6 0x080f0098 in i_stream_read (stream=0x9b284c0) at istream.c:99 #7 0x080f25ca in i_stream_tee_read (stream=0x9b28578) at istream- tee.c:130
Oh, it's coming from tee_read().. I thought tee-istream was the problem.
(gdb) p ret $4 = 15376 (gdb) p old_size No symbol "old_size" in current context.
ok, so this was dropped out by -O2
(gdb) p _stream $5 = (struct istream_private *) 0x9b28498 (gdb) p _stream.pos $6 = 8191 (gdb) p _stream.skip $7 = 0 (gdb)
But still, there is only 8 kB available but read() returned 15376
bytes. That can't be correct. Could you do one more thing:
fr 6 p *stream p *stream.real_stream p *(struct file_istream *)stream.real_stream
Mail storage is on an XFS filesystem - it should support hard links. I have explicitly set maildir_copy_with_hardlinks=yes in the config file rather than just relying on the defaults because I was certain that I wanted it turned on.
For some reason that's not working. I can look into that also, but I
also really want to get that istream crash fixed. :)