Crash on index upgrade: failed to mmap new message file

Bron Gondwana brong at fastmail.fm
Thu Feb 6 16:04:55 EST 2014


On Fri, Feb 7, 2014, at 04:00 AM, Thomas Jarosch wrote:
> Hi,
> 
> I just encountered one system where cyr_expire / reconstruct / imapd process
> died during the index upgrade from cyrus 2.3.16 to 2.4.17.
> 
> The error message was:
>     "fatal error: failed to mmap new message file"
> 
> To make a long debug session short: One folder had a broken "cyrus.index" 
> file that seemed to contain an index record for uid 0 (-> invalid record).
> (I saved the file in case it's of interest)
> 
> 
> Consider this call stack:
>     upgrade_index_record():
>         -> mailbox_message_fname(mailbox, record->uid)
>         -> message_parse(fname, record)
> 
> 
> When mailbox_message_fname(mailbox, record->uid) is called for uid 0,
> the function returns the folder name without any message filename.
> 
> In my case that was ".../user/xxx/Sent items" instead of
> ".../user/xxx/Sent items/123.".
> 
> message_parse() then calls map_refresh() with the folder name (ugh!)
> and dies with the above error message.
> 
> The workaround was to kill the broken cyrus.index file and run reconstruct.
> 
> 
> @Bron: Do you know by chance if this error case is detected in 2.5?
> I took a quick look at the code in git HEAD and it seems to behave the same.

I was pretty sure that it detected that case - but I may be wrong.  I'll take
a look.  That's pretty horrible.  Yay for variable reuse.  Kind of my fault.


Thanks for the report.  It needs to be fixed in 2.4 anyway, and I need to do
a new release, so I'll make sure I put a Cassandane test for this together and
fix it.

Bron.
-- 
  Bron Gondwana
  brong at fastmail.fm


More information about the Cyrus-devel mailing list