[Dovecot] Assertion Failure in mbox-sync.c

Todd Burroughs todd at hostopia.com
Wed May 18 03:00:42 EEST 2005


On Tue, 17 May 2005, Timo Sirainen wrote:
> On Mon, 2005-05-16 at 19:39 -0400, Todd Burroughs wrote:
>> dovecot: May 16 17:41:07 Error:  20973 IMAP(todd.bluegenesis.com): file mbox-sync.c: line 1165 (mbox_sync_handle_eof_updates): assertion failed: (file_size >= sync_ctx->file_input->v_offset)
> ..
>> (gdb) p sync_ctx->input->real_stream->statbuf
>> $5 = {st_dev = 0, __pad1 = 0, __st_ino = 0, st_mode = 0, st_nlink = 0,
>>    st_uid = 0, st_gid = 0, st_rdev = 0, __pad2 = 0, st_size = 4294967295,
>>    st_blksize = 0, st_blocks = 0, st_atim = {tv_sec = 1116279667, tv_nsec = 0},
>>    st_mtim = {tv_sec = 1116279667, tv_nsec = 0}, st_ctim = {
>>      tv_sec = 1116279667, tv_nsec = 0}, st_ino = 0}
>
> sync_ctx->input is different than sync_ctx->file_input, where the
> statbuf was taken from (took a while to notice this :). Could you do the
> same for it?

There's an odd value in here...
I checked and the values look correct, other than st_size.

(gdb) p sync_ctx->file_input->real_stream->statbuf
$2 = {st_dev = 43, __pad1 = 0, __st_ino = 23252848, st_mode = 33152,
   st_nlink = 1, st_uid = 1022, st_gid = 60, st_rdev = 0, __pad2 = 0,
   st_size = 140737488355328, st_blksize = 32768, st_blocks = 278184,
   st_atim = {tv_sec = 1114557761, tv_nsec = 0}, st_mtim = {
     tv_sec = 1116279661, tv_nsec = 95645000}, st_ctim = {tv_sec = 1116279661,
     tv_nsec = 95645000}, st_ino = 23252848}

>> (gdb) p sync_ctx->file_input->v_offset
>> $8 = 142294527
>>
>> The mbox size is larger than 142294527
>
> But it crashes because fstat() returns a value smaller than that as the
> mbox's size. Maybe NFS returns some old size from cache? I don't really
> know how NFS caching usually works. If someone has any pointers (other
> than kernel sources :) it'd be helpful.
>
> What OS are you using on NFS client side?

We're using Linux with a 2.6.x kernel for the client and NetApp filers
for the server.

> How about if you try running this little program, does it work:
>
> /* gcc writetest.c -o writetest -Wall */

Works perfectly. I tried looking at the file size from a different server
while running the program and it also worked.

My mailbox should never get smaller, unless dovecot deletes some mail.
It will grow with mail being added from different servers.

I don't think that NFS would return an older value, as there is one system
wide cache per machine.  It is possible to turn caching off, so I could
test this.  My understanding is that the client will cache attributes for
some period of time, 3 to 60 seconds are the default min/max for Linux.
I don't know how it determines how long it actually caches them for.

We have hundreds of NFS clients here and we don't run into many problems
with file corruption, etc.  Also, changes seem to get noticed very
quickly.  If I change something on a web site, it shows up immediately on
other servers.  Overall, NFS works quite well with our setup.  It's more
stable than I would expect ;-)

Todd


More information about the dovecot mailing list