Bug 259798 - Assert in IMAP resource ("!set.toImapSequenceSet().trimmed().isEmpty()") [KIMAP::FetchJob::setSequenceSet, RetrieveItemTask::triggerFetchJob, RetrieveItemTask::onSelectDone]
Summary: Assert in IMAP resource ("!set.toImapSequenceSet().trimmed().isEmpty()") [KIM...
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: IMAP resource (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Christian Mollekopf
URL:
Keywords:
: 260680 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-14 02:14 UTC by Alex Merry
Modified: 2015-10-19 14:52 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Merry 2010-12-14 02:14:43 UTC
Application: akonadi_imap_resource (0.1)
KDE Platform Version: 4.5.86 (4.6 >= 20101210) (Compiled from sources)
Qt Version: 4.7.1
Operating System: Linux 2.6.36-ARCH x86_64
Distribution (Platform): Archlinux Packages

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

I selected a folder, and then an unread message.  The "resolve conflict" dialog came up with some sort of date field change.  I chose "Take Right".  Then another came up with a lot of text (the message source, I think).  I chose "Take Right" again.  These kept coming up, one after the other, no matter which option I chose.  If I closed the dialog using the window manager, I got two copies of the email I had chosen to read, and the dialog appeared again.

I forcibly killed kmail (killall kmail) and started it again.  When I returned to the same folder, the imap resource crashed.

The folder is also reporting that there is an unread email, but that doesn't appear in the folder list.




posting retrieval request for item 227421  there are  1  queues and  0  items in mine 
request for item 227421 still pending - waiting 
processing retrieval request for item 227421  parts: ("ENVELOPE")  of resource: "akonadi_imap_resource_3" 
akonadi_imap_resource_3(7431)/kdepimlibs (kimap) KIMAP::SessionThread::sslConnected: TLS negotiation done.
akonadi_imap_resource_3(7431)/kdepimlibs (kimap) KIMAP::LoginJob::handleResponse: Capabilities after STARTTLS:  ("IMAP4rev1",
 "UIDPLUS", "CHILDREN", "NAMESPACE", "THREAD=ORDEREDSUBJECT", "THREAD=REFERENCES", "SORT", "QUOTA", "IDLE", "AUTH=PLAIN", "AC
L", "ACL2=UNION")
ASSERT: "!set.toImapSequenceSet().trimmed().isEmpty()" in file /home/kde-devel/src/KDE/kdepimlibs/kimap/fetchjob.cpp, line 10
4

The crash can be reproduced some of the time.

-- Backtrace:
Application: Akonadi Resource (akonadi_imap_resource), signal: Aborted
[Current thread is 1 (Thread 0x7f3e2814a760 (LWP 7431))]

Thread 5 (Thread 0x7f3e14e80710 (LWP 7433)):
#0  0x00007f3e2207fa8a in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#1  0x00007f3e220803d0 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007f3e2208066d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007f3e27565f66 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4  0x00007f3e2753a232 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f3e2753a47c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f3e2744fd54 in QThread::exec() () from /usr/lib/libQtCore.so.4
#7  0x00007f3e25fddc2a in KIMAP::SessionThread::run (this=0x1d140b0) at /home/kde-devel/src/KDE/kdepimlibs/kimap/sessionthread.cpp:166
#8  0x00007f3e2745252e in ?? () from /usr/lib/libQtCore.so.4
#9  0x00007f3e271c9cb0 in start_thread () from /lib/libpthread.so.0
#10 0x00007f3e230849dd in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f3e1467f710 (LWP 7700)):
#0  0x00007f3e271ce779 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f3e27452b82 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f3e27448c18 in ?? () from /usr/lib/libQtCore.so.4
#3  0x00007f3e2745252e in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f3e271c9cb0 in start_thread () from /lib/libpthread.so.0
#5  0x00007f3e230849dd in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f3e0f9a7710 (LWP 7708)):
#0  0x00007f3e271cd72e in __pthread_mutex_unlock_usercnt () from /lib/libpthread.so.0
#1  0x00007f3e2207f872 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#2  0x00007f3e22080152 in ?? () from /usr/lib/libglib-2.0.so.0
#3  0x00007f3e2208066d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#4  0x00007f3e27565f66 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f3e2753a232 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f3e2753a47c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#7  0x00007f3e2744fd54 in QThread::exec() () from /usr/lib/libQtCore.so.4
#8  0x00007f3e25fddc2a in KIMAP::SessionThread::run (this=0x1f9df70) at /home/kde-devel/src/KDE/kdepimlibs/kimap/sessionthread.cpp:166
#9  0x00007f3e2745252e in ?? () from /usr/lib/libQtCore.so.4
#10 0x00007f3e271c9cb0 in start_thread () from /lib/libpthread.so.0
#11 0x00007f3e230849dd in clone () from /lib/libc.so.6
#12 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f3e101a8710 (LWP 7714)):
#0  0xffffffffff60017b in ?? ()
#1  0x00007f3e101a7ae0 in ?? ()
#2  0x00007fffcc5856e2 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0x7f3e2814a760 (LWP 7431)):
[KCrash Handler]
#6  0x00007f3e22fe8595 in raise () from /lib/libc.so.6
#7  0x00007f3e22fe9a16 in abort () from /lib/libc.so.6
#8  0x00007f3e2744a4ff in qt_message_output(QtMsgType, char const*) () from /usr/lib/libQtCore.so.4
#9  0x00007f3e2744a68d in ?? () from /usr/lib/libQtCore.so.4
#10 0x00007f3e2744a825 in qFatal(char const*, ...) () from /usr/lib/libQtCore.so.4
#11 0x00007f3e25fc7387 in KIMAP::FetchJob::setSequenceSet (this=0x20c0c60, set=...) at /home/kde-devel/src/KDE/kdepimlibs/kimap/fetchjob.cpp:104
#12 0x000000000045b161 in RetrieveItemTask::triggerFetchJob (this=0x2062fe0) at /home/kde-devel/src/KDE/kdepim/runtime/resources/imap/retrieveitemtask.cpp:73
#13 0x000000000045b0bf in RetrieveItemTask::onSelectDone (this=0x2062fe0, job=0x2072c80) at /home/kde-devel/src/KDE/kdepim/runtime/resources/imap/retrieveitemtask.cpp:64
#14 0x000000000045baaa in RetrieveItemTask::qt_metacall (this=0x2062fe0, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fffcc45df50) at /home/kde-devel/build/KDE/kdepim/runtime/resources/imap/retrieveitemtask.moc:78
#15 0x00007f3e2755031f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#16 0x00007f3e23c13867 in KJob::result (this=0x2072c80, _t1=0x2072c80) at /home/kde-devel/build/KDE/kdelibs/kdecore/kjob.moc:194
#17 0x00007f3e23c12cd5 in KJob::emitResult (this=0x2072c80) at /home/kde-devel/src/KDE/kdelibs/kdecore/jobs/kjob.cpp:312
#18 0x00007f3e25fc3ad6 in KIMAP::Job::handleErrorReplies (this=0x2072c80, response=...) at /home/kde-devel/src/KDE/kdepimlibs/kimap/job.cpp:86
#19 0x00007f3e25fd820e in KIMAP::SelectJob::handleResponse (this=0x2072c80, response=...) at /home/kde-devel/src/KDE/kdepimlibs/kimap/selectjob.cpp:145
#20 0x00007f3e25fda184 in KIMAP::SessionPrivate::responseReceived (this=0x1e09490, response=...) at /home/kde-devel/src/KDE/kdepimlibs/kimap/session.cpp:263
#21 0x00007f3e25fdb17d in KIMAP::Session::qt_metacall (this=0x20776e0, _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0x20c0bc0) at /home/kde-devel/build/KDE/kdepimlibs/kimap/session.moc:106
#22 0x00007f3e2754f17a in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#23 0x00007f3e266e82b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#24 0x00007f3e266ecdca in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#25 0x00007f3e24715605 in KApplication::notify (this=0x7fffcc45ed20, receiver=0x20776e0, event=0x20c1190) at /home/kde-devel/src/KDE/kdelibs/kdeui/kernel/kapplication.cpp:311
#26 0x00007f3e2753ae9c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#27 0x00007f3e2753e6c5 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#28 0x00007f3e27565d73 in ?? () from /usr/lib/libQtCore.so.4
#29 0x00007f3e2207fbf3 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#30 0x00007f3e220803d0 in ?? () from /usr/lib/libglib-2.0.so.0
#31 0x00007f3e2208066d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#32 0x00007f3e27565f0f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#33 0x00007f3e2678d1ae in ?? () from /usr/lib/libQtGui.so.4
#34 0x00007f3e2753a232 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#35 0x00007f3e2753a47c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#36 0x00007f3e2753e97b in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#37 0x00007f3e27c61c40 in Akonadi::ResourceBase::init (r=0x1ca08c0) at /home/kde-devel/src/KDE/kdepimlibs/akonadi/resourcebase.cpp:283
#38 0x000000000042831e in Akonadi::ResourceBase::init<ImapResource> (argc=3, argv=0x7fffcc45ee78) at /home/kde-devel/kde/include/akonadi/resourcebase.h:188
#39 0x0000000000426e67 in main (argc=3, argv=0x7fffcc45ee78) at /home/kde-devel/src/KDE/kdepim/runtime/resources/imap/imapresource.cpp:580

Reported using DrKonqi
Comment 1 Alex Merry 2010-12-14 02:19:06 UTC
Actually, the crash happens when I start kmail.  Every time, now, since the change conflict loop happened and the unread count for one of the folders got stuck.

Restarting akonadi didn't change anything.
Comment 2 Alex Merry 2010-12-14 02:24:17 UTC
The crash also happens when I open the folder with the bad unread message count in akonadiconsole.  I can't find a message without the \SEEN flag in akonadiconsole, although I've only looked through some of the messages (including the thread of the message that caused trouble previously).
Comment 3 Dario Andres 2010-12-19 16:50:57 UTC
[Comment from a bug triager]
From bug 260680:
- What I was doing when the application crashed:

I was using KMail2, and when I clicked one of my IMAP folders the Akonadi
resource crashed (the new folder loaded correctly, though).
kdelibs: r1207605
kdepimlibs: r1207605
kdepim: r1207605
Comment 4 Dario Andres 2010-12-19 16:51:15 UTC
*** Bug 260680 has been marked as a duplicate of this bug. ***
Comment 5 Raphael Kubo da Costa 2011-05-12 03:10:52 UTC
I've just experienced this same problem and was able to reproduce the crash -- it happens every time I try to enter the IMAP folder with the conflicting message in KMail2.
Comment 6 Kevin Ottens 2011-09-17 16:53:51 UTC
To debug that kind of cases efficiently, I'd need to be provided with some idea of the IMAP traffic which created the issue. That can be done by setting the KIMAP_LOGFILE environment variable and restarting the akonadiserver.

For instance:
export KIMAP_LOGFILE=imaplog
akonadictl restart

Look at the pid of the imap resource you should then have a couple of imaplog.pid.* files. Wait for the crash, and then provide me what happened before the crash. It's the best way for me to create a test case that I can reproduce here. Only caveat though is that some private data is likely in the log (except the authentication phase, after that it logs everything) so you'd have to trust me with your data and send it privately.

Also I would need some more information of the structure of the conflicting messages on the akonadi side, using akonadiconsole perhaps?
Comment 7 Kevin Ottens 2013-11-16 07:26:06 UTC
The IMAP resource has a new maintainer, reassigning to him.
Comment 8 Alex Merry 2015-10-18 18:26:44 UTC
I haven't seen this issue for a few years now. I'm happy for this bug to be closed as unreproducible.