Bug 303951 - imap resource crahes everytime it wants to fetch mail
Summary: imap resource crahes everytime it wants to fetch mail
Status: RESOLVED WORKSFORME
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: IMAP resource (show other bugs)
Version: 4.9
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: Christian Mollekopf
URL:
Keywords: triaged
: 316819 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-07-23 09:42 UTC by Marc Schiffbauer
Modified: 2018-10-27 03:58 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (7.15 KB, text/plain)
2014-05-28 19:47 UTC, Matt Newell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Schiffbauer 2012-07-23 09:42:24 UTC
Application: akonadi_imap_resource (4.8)
KDE Platform Version: 4.8.97 (Compiled from sources)
Qt Version: 4.8.2
Operating System: Linux 3.4.4-gentoo x86_64
Distribution: "NAME=Gentoo"

-- Information about the crash:
- What I was doing when the application crashed:

I get a crash every few minutes when the resource tries to get mail (at least is this what I assume...)

I have four imap resources configures, this crash seems to happen only with one of them

-- Backtrace:
Application: MCS vom Typ IMAP-E-Mail-Server (akonadi_imap_resource), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fe20080e780 (LWP 9729))]

Thread 3 (Thread 0x7fe1ed8cb700 (LWP 9732)):
#0  0x00007fe1fafad418 in g_mutex_unlock () from /usr/lib64/libglib-2.0.so.0
#1  0x00007fe1faf7347a in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fe1faf735b4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fe1ffc014e6 in QEventDispatcherGlib::processEvents (this=0x7fe1e80008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007fe1ffbd12a2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007fe1ffbd14f7 in QEventLoop::exec (this=0x7fe1ed8cade0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007fe1ffad1f27 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007fe1fe822dec in KIMAP::SessionThread::run (this=0x1fbb9b0) at /var/tmp/portage/kde-base/kdepimlibs-4.9.49.9999/work/kdepimlibs-4.9.49.9999/kimap/sessionthread.cpp:181
#8  0x00007fe1ffad4f2b in QThreadPrivate::start (arg=0x1fbb9b0) at thread/qthread_unix.cpp:307
#9  0x00007fe1fb8dbec6 in start_thread () from /lib64/libpthread.so.0
#10 0x00007fe1fc0369bd in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7fe1ed0ca700 (LWP 9931)):
#0  0x00007fe1fc02dda3 in poll () from /lib64/libc.so.6
#1  0x00007fe1faf73486 in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fe1faf735b4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fe1ffc014e6 in QEventDispatcherGlib::processEvents (this=0x7fe1e00029b0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007fe1ffbd12a2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007fe1ffbd14f7 in QEventLoop::exec (this=0x7fe1ed0c9de0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007fe1ffad1f27 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007fe1fe822dec in KIMAP::SessionThread::run (this=0x200a950) at /var/tmp/portage/kde-base/kdepimlibs-4.9.49.9999/work/kdepimlibs-4.9.49.9999/kimap/sessionthread.cpp:181
#8  0x00007fe1ffad4f2b in QThreadPrivate::start (arg=0x200a950) at thread/qthread_unix.cpp:307
#9  0x00007fe1fb8dbec6 in start_thread () from /lib64/libpthread.so.0
#10 0x00007fe1fc0369bd in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7fe20080e780 (LWP 9729)):
[KCrash Handler]
#6  0x00007fe1fbf85b15 in raise () from /lib64/libc.so.6
#7  0x00007fe1fbf86f8b in abort () from /lib64/libc.so.6
#8  0x00007fe1fbf7ebfe in ?? () from /lib64/libc.so.6
#9  0x00007fe1fbf7eca2 in __assert_fail () from /lib64/libc.so.6
#10 0x00007fe1e58d08f0 in boost::shared_ptr<KMime::Message>::operator->() const [clone .isra.14] [clone .part.15] () from /usr/lib64/kde4/akonadi_serializer_mail.so
#11 0x00007fe1e58d767a in Akonadi::SerializerPluginMail::serialize(Akonadi::Item const&, QByteArray const&, QIODevice&, int&) () from /usr/lib64/kde4/akonadi_serializer_mail.so
#12 0x00007fe2002f1b5b in Akonadi::ItemSerializer::serialize (item=..., label=..., data=..., version=@0x7ffff1695a9c: 1) at /var/tmp/portage/kde-base/kdepimlibs-4.9.49.9999/work/kdepimlibs-4.9.49.9999/akonadi/itemserializer.cpp:126
#13 0x00007fe2002f1bf9 in Akonadi::ItemSerializer::serialize (item=..., label=..., data=..., version=@0x7ffff1695a9c: 1) at /var/tmp/portage/kde-base/kdepimlibs-4.9.49.9999/work/kdepimlibs-4.9.49.9999/akonadi/itemserializer.cpp:116
#14 0x00007fe2002e2f41 in Akonadi::ItemCreateJob::doStart (this=<optimized out>) at /var/tmp/portage/kde-base/kdepimlibs-4.9.49.9999/work/kdepimlibs-4.9.49.9999/akonadi/itemcreatejob.cpp:85
#15 0x00007fe2002fde56 in Akonadi::JobPrivate::startQueued (this=<optimized out>) at /var/tmp/portage/kde-base/kdepimlibs-4.9.49.9999/work/kdepimlibs-4.9.49.9999/akonadi/job.cpp:153
#16 0x00007fe1ffbeb5d6 in QObject::event (this=0x20ce240, e=<optimized out>) at kernel/qobject.cpp:1195
#17 0x00007fe1fef7f6a4 in notify_helper (e=0x20c72f0, receiver=0x20ce240, this=0x1d5b030) at kernel/qapplication.cpp:4551
#18 QApplicationPrivate::notify_helper (this=0x1d5b030, receiver=0x20ce240, e=0x20c72f0) at kernel/qapplication.cpp:4523
#19 0x00007fe1fef843c1 in QApplication::notify (this=0x7ffff1696530, receiver=0x20ce240, e=0x20c72f0) at kernel/qapplication.cpp:3933
#20 0x00007fe1fcf9eda6 in KApplication::notify (this=0x7ffff1696530, receiver=0x20ce240, event=0x20c72f0) at /var/tmp/portage/kde-base/kdelibs-4.9.49.9999/work/kdelibs-4.9.49.9999/kdeui/kernel/kapplication.cpp:311
#21 0x00007fe1ffbd274c in QCoreApplication::notifyInternal (this=0x7ffff1696530, receiver=0x20ce240, event=0x20c72f0) at kernel/qcoreapplication.cpp:915
#22 0x00007fe1ffbd5faa in sendEvent (event=0x20c72f0, receiver=0x20ce240) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#23 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=<optimized out>, data=0x1d364d0) at kernel/qcoreapplication.cpp:1539
#24 0x00007fe1ffc01063 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#25 postEventSourceDispatch (s=<optimized out>) at kernel/qeventdispatcher_glib.cpp:279
#26 0x00007fe1faf731a3 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#27 0x00007fe1faf734f0 in ?? () from /usr/lib64/libglib-2.0.so.0
#28 0x00007fe1faf735b4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#29 0x00007fe1ffc0147f in QEventDispatcherGlib::processEvents (this=0x1d37cb0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#30 0x00007fe1ff02279e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#31 0x00007fe1ffbd12a2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#32 0x00007fe1ffbd14f7 in QEventLoop::exec (this=0x7ffff16964b0, flags=...) at kernel/qeventloop.cpp:204
#33 0x00007fe1ffbd62c5 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#34 0x00007fe20031afd6 in Akonadi::ResourceBase::init (r=0x1f025f0) at /var/tmp/portage/kde-base/kdepimlibs-4.9.49.9999/work/kdepimlibs-4.9.49.9999/akonadi/resourcebase.cpp:451
#35 0x000000000041ddd6 in int Akonadi::ResourceBase::init<ImapResource>(int, char**) ()
#36 0x00007fe1fbf7260d in __libc_start_main () from /lib64/libc.so.6
#37 0x0000000000417cc1 in _start ()

Possible duplicates by query: bug 181219.

Reported using DrKonqi
Comment 1 Marc Schiffbauer 2012-08-06 10:29:02 UTC
Updated. This crash occurs on 4.9 final as well.

Is there any other info I can provide so this annoying bug can be fixed soon?
Comment 2 Marc Schiffbauer 2012-08-06 11:05:31 UTC
More Info:

I found out that the crash always happens when the agent is syncing a specific folder. I tried to unsubscribe that folder (serverside) and voila: No more crashes.

After subscribing to it again, syncing that folder started  (cache seemed to be cleaned already because the folder was empty now) and after syncing some hundret mails it crashes again.

So I assume that I have one special mail object in that folder that makes the agent crash.

I tried to narrow this down using the integrated debugger of akonadiconsole, but I cannot find anything about the crash there.
Comment 3 Marc Schiffbauer 2012-08-15 07:44:09 UTC
Any news on this?

ATM this affects a subfolder which I can easly unsubscribe so that the imap resource agent stops to crash constantly.

But I am a bit worried that if that happens to my INBOX it will make kmail completely unusable for me.
Comment 4 Marc Schiffbauer 2012-08-16 11:47:12 UTC
Update:

I could isolate the message that is causing the crash. 
And I have put that message into a seperate folder now (via webmail)

The Problem seems to be, that the IMAP resource agent cannot handle (at least) a special IMAP error case.

The message has some error on the IMAP side, so the expected behavior of akonadi/kmail would be to display some sort of error like "IMAP Message could not be fetched" or something like that instead of crashing.

I tested with Thunderbird: I just does not show the message.
In webmail I can see that there is a message in the folder, but when I click on it to read it I get an error "NO_SUCH_BLOB".
The IMAP response *seems* to be: "No such blob: mailbox=6, item=713444, change=1095509"
(according to some details of that error shown in webmail)
Comment 5 Daniel Vrátil 2013-06-09 15:02:43 UTC
*** Bug 316819 has been marked as a duplicate of this bug. ***
Comment 6 Kevin Ottens 2013-11-16 07:32:14 UTC
The IMAP resource has a new maintainer, reassigning to him.
Comment 7 Christian Mollekopf 2013-11-20 10:50:37 UTC
SerializerPluginMail::serialize should check if the pointer is valid it tries to access, and the imap resource should handle the error from the server.
Comment 8 Christian Mollekopf 2013-11-20 10:54:49 UTC
Actually, we probably shouldn't handle the error, since it doesn't seem to be IMAP. But not crashing would be cool anyways.
Comment 9 Christian Mollekopf 2013-12-11 09:04:16 UTC
We need an imap traffic log for to figure out what exactly is going wrong:
http://techbase.kde.org/Projects/PIM/Akonadi/Debug_IMAP
Comment 10 Matt Newell 2014-05-28 19:47:36 UTC
Created attachment 86886 [details]
New crash information added by DrKonqi

akonadi_imap_resource (4.12) on KDE Platform 4.13.1 using Qt 4.8.6

- What I was doing when the application crashed:
Crashes every time mail is checked. Code doesn't check the returned pointer!  I will try to get the imap logs and isolate the email or whatever that is causing the crash.

-- Backtrace (Reduced):
#6  KMime::Content::encodedContent (this=0x0, useCrLf=useCrLf@entry=false) at ../../kmime/kmime_content.cpp:299
#7  0x00007f2171b7e9e6 in Akonadi::SerializerPluginMail::serialize (this=<optimized out>, item=..., label=..., data=..., version=<optimized out>) at ../../plugins/akonadi_serializer_mail.cpp:180
#8  0x00007f2186c89488 in Akonadi::ItemSerializer::serialize (item=..., label=..., data=..., version=@0x7ffff69f348c: 1) at ../../akonadi/itemserializer.cpp:143
#9  0x00007f2186c89c4f in Akonadi::ItemSerializer::serialize (item=..., label=..., data=..., version=@0x7ffff69f348c: 1) at ../../akonadi/itemserializer.cpp:133
#10 0x00007f2186c79400 in Akonadi::Item::payloadData (this=this@entry=0x7ffff69f3600) at ../../akonadi/item.cpp:207
Comment 11 Matt Newell 2014-05-28 20:06:45 UTC
Relevant console log output after doing:
export KIMAP_LOGFILE=/tmp/imap.log
akonadictl restart

posting retrieval request for item 104272  there are  1  queues and  0  items in mine 
request for item 104272 still pending - waiting 
processing retrieval request for item 104272  parts: ("ENVELOPE")  of resource: "akonadi_imap_resource_0" 
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  294855  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  263216  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  104277  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  104276  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  104275  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  104274  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  104273  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  104272  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  94377  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  94044  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Number of items missing the body:  10
akonadi_imap_resource_0(11777)/kdepimlibs (kimap) RetrieveItemsTask::triggerExpunge: "INBOX"
akonadi_imap_resource_0(11777)/kdepimlibs (kimap) KIMAP::ExpungeJob::handleResponse: Unhandled response:  * 20227 EXISTS
akonadi_imap_resource_0(11777)/kdepimlibs (kimap) KIMAP::ExpungeJob::handleResponse: Unhandled response:  * 1 RECENT
akonadi_imap_resource_0(11777)/kdepimlibs (kimap) RetrieveItemsTask::onFinalSelectDone: Fetch missing:  20227  But:  20226
akonadi_imap_resource_0(11777)/kdepimlibs (kimap) RetrieveCollectionMetadataTask::doStart: ".INBOX"
continuing 
request for item 104272 "331683" failed: "Unable to retrieve item from resource: <html>Invalid item retrieved</html>" 
ItemRetrieverException :  Unable to retrieve item from resource: <html>Invalid item retrieved</html>
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  294855  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  263216  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  104277  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  104276  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  104275  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  104274  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  104273  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  104272  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  94377  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Item  94044  is missing the payload! Cached payloads:  QSet()
akonadi_imap_resource_0(11777) ImapResource::fetchItemsWithoutBodiesDone: Number of items missing the body:  10
akonadi_imap_resource_0(11777)/kdepimlibs (kimap) RetrieveItemsTask::triggerExpunge: "INBOX"
Lost connection to resource "org.freedesktop.Akonadi.Resource.akonadi_imap_resource_0" , discarding cached interface 
void Akonadi::Server::NotificationSource::serviceUnregistered(const QString&) Notification source "akonadi_imap_resource_0_11777_bTg3Re" now serving: () 
KCrash: Application 'akonadi_imap_resource' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/home/newellm/.kde/socket-obsidian/kdeinit4__0
Comment 12 Andrew Crouthamel 2018-09-25 03:36:51 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 13 Andrew Crouthamel 2018-10-27 03:58:00 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!