Re: [Dovecot] Segfault in imap_bodystructure_write when searching
Bullseye. Why did I fail to mention that I was trying to use uiddb from Courier? :P Using your conversion script fixed it, but simply copying the Courier file crashed Dovecot. According to http://wiki.dovecot.org/Migration/Courier this is supposed to work though, so either that page is wrong, or Dovecot has a bug.
I tried reproducing now, but it seems it's started working even when moving all dovecot files and copying courierimapuiddb to dovecot-uidlist. If I see it again I'll send you a copy of the file offlist.
Thanks.
-- -==- -=- -==- Christer Mjellem Strand yitzhaq System administrator ICQ: 9557698 GSM +47 922 000 12 JID: yitzhaq@jabber.no -==- -=- -==-
On Sun, 2008-06-01 at 16:47 +0200, Christer Mjellem Strand wrote:
The Courier and Dovecot v1.0 uidlist files are nearly identical. The only difference is that Dovecot adds the ":2,flags" to filenames which is kind of an optimistic optimization that it's able to find filenames without scanning maildir to find the exact filename. But this isn't relied on in any way. So the problem most likely was caused/fixed by something else.
You said this happens when searching? imap_bodystructure_write() is never called on SEARCH, so this is probably also because the backtrace was corrupted.
Do you know what exactly was the SEARCH command that caused the crash? (rawlog could help: http://wiki.dovecot.org/Debugging/Rawlog) I tried reproducing the crash with the files you sent privately, but I can't seem to cause it to crash.
One way to maybe avoid gdb backtrace corruption is to attach gdb while the process is still running. Like:
- Log in so imap process exists
- gdb /usr/lib/dovecot/imap
pidof imap
- cont
- make it crash
- bt full
This latest crash I can reproduce by just trying to open the mailbox, no searching necessary. With the previous crashes, while other symptoms seemed identical, the mailbox (and messages in it) would open normally, but the crash would happen once I tried searching for something.
I have very limited gdb experience, and can't seem to make this work as intended. I've restarted dovecot and logged in so only one imap process exists, and attached to that. However, it seems that this process keeps on running, and instead spawns children, and they're the ones that die immediately. The main process stays alive, and no backtrace is generated when I just kill dovecot to stop the loop..
Any pointers as to how I could attach gdb to any of those processes, or other ways to proceed?
Please excuse my ignorance here. I've found a successful workaround (just regenerating the index files), but since you state that you wish to fix every crasher, I'll gladly help debug this until you've pinpointed it, if you have the patience to bear with me.. :)
-- -==- -=- -==- Christer Mjellem Strand yitzhaq System administrator ICQ: 9557698 GSM +47 922 000 12 JID: yitzhaq@jabber.no -==- -=- -==-
On Jun 1, 2008, at 7:17 PM, Christer Mjellem Strand wrote:
This latest crash I can reproduce by just trying to open the
mailbox, no searching necessary.
Is it with the files you sent me or some other mailbox?
Only dovecot process forks new processes. I guess it's possible that
your IMAP client works by first creating one connection (first imap
process) and then when selecting the mailbox logs in using a new
connection.
Any pointers as to how I could attach gdb to any of those processes,
or other ways to proceed?
How about manually:
telnet localhost 143 a login user pass << gdb attach >> b select mailbox
Yes, fixing the crash would be good.
The files I sent you. The search issue I haven't been able to reproduce since last night.
Aha, that does indeed sound probable, and seems to fit well with what I'm seeing in the logs.
No crash :\
I could always fire up wireshark or something to try to figure out what my client (Mulberry) is actually doing, but that still wouldn't log the crasher..
-- -==- -=- -==- Christer Mjellem Strand yitzhaq System administrator ICQ: 9557698 GSM +47 922 000 12 JID: yitzhaq@jabber.no -==- -=- -==-
On Jun 1, 2008, at 7:50 PM, Christer Mjellem Strand wrote:
The last sent command should be the one that causes the crash. Instead
of wireshark you could also use http://wiki.dovecot.org/Debugging/
Rawlog (works with SSL connections too).
Found out Mulberry has built-in logging, so I just used that. http://trac.mulberrymail.com/mulberry/wiki/logging btw, in case it's useful.
I suspect the SORT command might be involved here, since just opening the mailbox didn't cause the crash. I'll send you a log copy off-list. If that doesn't do the trick, I can play around with Rawlog.
-- -==- -=- -==- Christer Mjellem Strand yitzhaq System administrator ICQ: 9557698 GSM +47 922 000 12 JID: yitzhaq@jabber.no -==- -=- -==-
On Jun 1, 2008, at 8:12 PM, Christer Mjellem Strand wrote:
Oh, Mulberry. I bet this fixes it: http://hg.dovecot.org/dovecot-1.0/rev/538f8892a2f1
I was going to release 1.0.14 this weekend. I suppose I still could. :)
participants (2)
-
Christer Mjellem Strand
-
Timo Sirainen