Bug 744799 - dovecot panic when accessing corrupt mail message on rebuilding index
Summary: dovecot panic when accessing corrupt mail message on rebuilding index
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: dovecot
Version: 4.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michal Hlavinka
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-10 14:08 UTC by Paul Bijnens
Modified: 2011-10-26 12:31 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-26 12:31:29 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Paul Bijnens 2011-10-10 14:08:30 UTC
Description of problem:

Since the upgrade on aug 19, 2011 to dovecot-0.99.11-10.EL4, we get suddenly crashes when accessing certain folders.

The relevant entries in dovecot log:

  imap-login: Oct 09 11:31:31 Info: Login: paulb [::ffff:10.11.12.90]
  imap(paulb): Oct 09 11:37:05 Error: Corrupted index file /home/paulb/Maildir/.Arch-2007/.imap.index: Duplicated message 1318152995.P1683Q919M941772.xxx.yyy.com
  imap(paulb): Oct 09 11:40:19 Panic: file lib.c: line 37 (nearest_power): assertion failed: (num <= ((size_t)1 << (BITS_IN_SIZE_T-1)))

It seems to panic when rebuilding the index file.
From then on, access to that folder consistently crashes with the same panic line.

Some googling around brought up this:

  http://www.somerandomstuff.com/2011/09/30/dovecot-crash/

which seems to imply that the presence of a message with missing final boundary line seems to the cause. (missing a "--" at the end or even completely missing)

When searching my whole folder, there were indeed a few messages with a completely missing final boundary line.  Adding the mime boundary line manually fixed the problem.


Version-Release number of selected component (if applicable):

dovecot-0.99.11-10.EL4

How reproducible:


Steps to Reproduce:

1. Create a maildir folder on the server, populating it with a few messages, having at least a few one with attachments. (Easily done with an IMAP server, thunderbird and copying some existing messages.)

2. On the server, using a editor, remove the final mime boundary line on one of them (e.g. simulating the result of "no space left on device" when writing the message -- that is probably how it ended up there in 2007 in my folder). Try to find one, so that, when dovecot reads the messages, this one is not the last one in it's list.

3. Remove the .imap.index* files, so that Dovecot tries to rebuild them on access.

4.  Using thunderbird, subscribe to the folder, access it, and watch /var/log/dovecot.log

Comment 1 Michal Hlavinka 2011-10-26 12:31:29 UTC
I'm sorry for not addressing the issue in RHEL-4. RHEL-4.9 was last regular update release,  I'm closing this bugzilla WONTFIX. If you are still experiencing the issue with RHEL-5 or RHEL-6, feel free to reopen it against RHEL-5 or RHEL-6 respectively.


Note You need to log in before you can comment on or make changes to this bug.