Opened 13 years ago

Closed 13 years ago

#7575 closed bug (fixed)

[mail_daemon] hangs during mail fetching

Reported by: diver Owned by: czeidler
Priority: normal Milestone: R1
Component: Servers/mail_daemon Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Fetching process stops after receiving some mails from both of my gmail accounts. For the first account it manages to download several hundreds of emails before it hangs, for another it stops after second mail (actually, sometimes this number differs). In both cases I can see that it continue to consume quite a lot of CPU cycles (in user thread of mail_daemon) which even leads to considerable slow-down of Deskbar ad Tracker. It feels like it can't read some specific mail and can't ignore it falling into some kind of endless loop.

BTW, after hang it doesn't start fetching from the second account, so I had to delete the first one from E-mail preflet to check the second one.

Running mail_daemon from Terminal doesn't show any interesting information.

Attachments (1)

crashing_mail (1.2 KB ) - added by diver 13 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by axeld, 13 years ago

It would be very helpful if you could start debugging the thread via ProcessController (by clicking on it in "Threads and CPU usage"), and provide a stack trace of it.

comment:2 by diver, 13 years ago

Sure, here it is:

[Switching to team ./mail_daemon (9565) thread user thread (9574)]
0x002b203a in memmove () from /boot/system/lib/libroot.so
(gdb) bt
#0  0x002b203a in memmove () from /boot/system/lib/libroot.so
#1  0x00281008 in re_string_reconstruct () from /boot/system/lib/libroot.so
#2  0x0028398f in re_search_internal () from /boot/system/lib/libroot.so
#3  0x0028525a in re_search_stub () from /boot/system/lib/libroot.so
#4  0x002855d8 in re_search () from /boot/system/lib/libroot.so
#5  0x005b6c6f in SubjectToThread () from /boot/system/lib/libmail.so
#6  0x005b52b3 in HaikuMailFormatFilter::HeaderFetched () from /boot/system/lib/libmail.so
#7  0x005c25ed in MailProtocol::NotifyHeaderFetched () from /boot/system/lib/libmail.so
#8  0x01bc351e in DispatcherIMAPListener::HeaderFetched () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#9  0x01bcbdbe in FetchMessageCommand::Handle () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#10 0x01bcf740 in IMAPProtocol::HandleResponse () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#11 0x01bcfa32 in IMAPProtocol::_ProcessCommandWithoutAfterQuake () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#12 0x01bcfabf in IMAPProtocol::_ProcessCommandWithoutAfterQuake () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#13 0x01bcfba2 in IMAPProtocol::ProcessCommand () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#14 0x01bcdc41 in IMAPMailbox::FetchMessages () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#15 0x01bd1954 in IMAPMailboxSync::Sync () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#16 0x01bc21ad in IMAPInboundProtocol::Connect () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#17 0x01bc45b5 in IMAPRootInboundProtocol::Connect () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#18 0x01bc3d29 in IMAPInboundProtocol::SyncMessages () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#19 0x01bc425f in IMAPRootInboundProtocol::SyncMessages () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#20 0x01bc1dd4 in IMAPInboundProtocol::UpdateSettings () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#21 0x01bc23d1 in IMAPInboundProtocol::AddedToLooper () from /boot/system/add-ons/mail_daemon/inbound_protocols/IMAP
#22 0x005c294c in MailProtocol::SetProtocolThread () from /boot/system/lib/libmail.so
#23 0x005c2c63 in MailProtocolThread::MessageReceived () from /boot/system/lib/libmail.so
#24 0x005c315c in InboundProtocolThread::MessageReceived () from /boot/system/lib/libmail.so
#25 0x003ecaa8 in BLooper::DispatchMessage () from /boot/system/lib/libbe.so
#26 0x003ee5e4 in BLooper::task_looper () from /boot/system/lib/libbe.so
#27 0x003ee30a in BLooper::_task0_ () from /boot/system/lib/libbe.so
#28 0x0024e225 in thread_entry () from /boot/system/lib/libroot.so
#29 0x700c1fec in ?? ()
(gdb)

comment:3 by czeidler, 13 years ago

probably another bug in the header parser... Would be cool if you could send me the crashing mail. The header would probably enough. (take care to not post sensitive data) maybe its possible to download the mail with beam?

comment:4 by diver, 13 years ago

Is there a way to find which mail is the crashing one?

comment:5 by czeidler, 13 years ago

if you start the daemon in a terminal you will see the uid of the mail... but just look into your mail inbox there should be a file "Downloading file... uid:xxx" this is the raw header. The crash happen in HeaderFetched, this means the raw header is on the disk and now the attributes are going to be extracted from the header / the file will be renamed to something more meaningful... (Probably there are multiple of these files now)

by diver, 13 years ago

Attachment: crashing_mail added

comment:6 by diver, 13 years ago

In case Trac still doesn't send notifications, I found the crashing mail and attached it to the ticket.

comment:7 by czeidler, 13 years ago

Resolution: fixed
Status: newclosed

Workaround in hrev41826.

Note: See TracTickets for help on using tickets.