Bug 339384 - New akonadi_kolab_resource crashing (Signal: Aborted) on start up
Summary: New akonadi_kolab_resource crashing (Signal: Aborted) on start up
Status: RESOLVED UNMAINTAINED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: Kolab Resource (show other bugs)
Version: GIT (master)
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-25 15:11 UTC by Aeneas Jaißle
Modified: 2018-02-01 09:48 UTC (History)
3 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 Aeneas Jaißle 2014-09-25 15:11:34 UTC
Application: akonadi_kolab_resource (4.14)
KDE Platform Version: 4.14.1
Qt Version: 4.8.5
Operating System: Linux 3.11.10-21-desktop x86_64
Distribution: "openSUSE 13.1 (Bottle) (x86_64)"

-- Information about the crash:
Using the old Kolab resource but having that disconnecting almost regularly after a few hours for the past week, I switched to the "new" Kolab resource, using the following steps:
* Remove old Kolab resource
* Add new Kolab resource
* Remove old IMAP accounts

After a sync and a reboot, akonadi_kolab_resource is crashing every 5 seconds.


-- Backtrace:
Application: xxx@example.org of type Kolab Groupware Server (akonadi_kolab_resource), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f70ab8bc880 (LWP 4808))]

Thread 3 (Thread 0x7f7092e9b700 (LWP 4814)):
#0  0x00007f70a65ab7bd in poll () from /lib64/libc.so.6
#1  0x00007f70a5759604 in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f70a575970c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f70aaef9d76 in QEventDispatcherGlib::processEvents (this=0x7f708c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:427
#4  0x00007f70aaecbd0f in QEventLoop::processEvents (this=this@entry=0x7f7092e9ad60, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f70aaecc005 in QEventLoop::exec (this=this@entry=0x7f7092e9ad60, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f70aadcafef in QThread::exec (this=<optimized out>) at thread/qthread.cpp:536
#7  0x00007f70aadcd68f in QThreadPrivate::start (arg=0x1d64f0e0) at thread/qthread_unix.cpp:338
#8  0x00007f70aab360db in start_thread () from /lib64/libpthread.so.0
#9  0x00007f70a65b458d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f709269a700 (LWP 4815)):
#0  0x00007f70aab3a458 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f70aadcdb44 in wait (time=30000, this=0x7f708c0132a0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=mutex@entry=0x7f708c0142e8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007f70aadc1235 in QThreadPoolThread::run (this=0x7f708c037c10) at concurrent/qthreadpool.cpp:141
#4  0x00007f70aadcd68f in QThreadPrivate::start (arg=0x7f708c037c10) at thread/qthread_unix.cpp:338
#5  0x00007f70aab360db in start_thread () from /lib64/libpthread.so.0
#6  0x00007f70a65b458d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f70ab8bc880 (LWP 4808)):
[KCrash Handler]
#5  0x00007f70a65024c9 in raise () from /lib64/libc.so.6
#6  0x00007f70a6503958 in abort () from /lib64/libc.so.6
#7  0x00007f70a6af7655 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib64/libstdc++.so.6
#8  0x00007f70a6af57c6 in ?? () from /usr/lib64/libstdc++.so.6
#9  0x00007f70a6af57f3 in std::terminate() () from /usr/lib64/libstdc++.so.6
#10 0x00007f70a6af5a66 in __cxa_rethrow () from /usr/lib64/libstdc++.so.6
#11 0x00007f70aaecc1f6 in QEventLoop::exec (this=this@entry=0x7fff3e377510, flags=...) at kernel/qeventloop.cpp:218
#12 0x00007f70aaed113b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1221
#13 0x00007f70ab3b6053 in Akonadi::ResourceBase::init (r=r@entry=0x1b84fb0) at /usr/src/debug/kdepimlibs-4.14.1/akonadi/resourcebase.cpp:579
#14 0x000000000042fb73 in Akonadi::ResourceBase::init<KolabResource> (argc=<optimized out>, argv=<optimized out>) at /usr/include/akonadi/resourcebase.h:193
#15 0x00007f70a64eebe5 in __libc_start_main () from /lib64/libc.so.6
#16 0x000000000041c2f5 in _start () at ../sysdeps/x86_64/start.S:122


Reproducible: Always
Comment 1 Tim Ruffing 2014-12-02 23:51:39 UTC
For me the problem did not show up immediately after switching to the new Kolab ressource. The new ressource worked for some weeks... Now it crashes reliably.

the output is:
[...]
akonadi_kolab_resource_1(8051)/kdepimlibs (kimap) KIMAP::LoginJob::handleResponse: "Login" "A000002"
akonadi_kolab_resource_1(8051)/kdepimlibs (kimap) KIMAP::LoginJob::~LoginJob: KIMAP::LoginJob(0x1121f80)
akonadi_kolab_resource_1(8051)/libakonadi Akonadi::EntityListCache<T, FetchJob, FetchScope_>::processResult: "Item query returned empty result set" 
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.

terminate called after throwing an instance of 'Akonadi::PayloadException'
  what():  Akonadi::PayloadException: No payload set
KCrash: Application 'akonadi_kolab_resource' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
KCrash: Connect sock_file=/home/tim/.kde4/socket-calzone/kdeinit4__0
Unregistering search instance "akonadi_kolab_resource_1" 
Lost connection to resource "org.freedesktop.Akonadi.Resource.akonadi_kolab_resource_1" , discarding cached interface 
void Akonadi::Server::NotificationSource::serviceUnregistered(const QString&) Notification

---

Application: [...] of type Kolab Groupware Server (akonadi_kolab_resource), signal: Aborted
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f0b7aa587c0 (LWP 8051))]

Thread 2 (Thread 0x7f0b63539700 (LWP 8053)):
#0  0x00007f0b758747bd in poll () from /usr/lib/libc.so.6
#1  0x00007f0b747f7c94 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007f0b747f7dac in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007f0b7a094397 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4  0x00007f0b7a063de1 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f0b7a064145 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f0b79f587f9 in QThread::exec() () from /usr/lib/libQtCore.so.4
#7  0x00007f0b79f5b05f in ?? () from /usr/lib/libQtCore.so.4
#8  0x00007f0b74edd314 in start_thread () from /usr/lib/libpthread.so.0
#9  0x00007f0b7587d5bd in clone () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7f0b7aa587c0 (LWP 8051)):
[KCrash Handler]
#5  0x00007f0b757c8a97 in raise () from /usr/lib/libc.so.6
#6  0x00007f0b757c9e6a in abort () from /usr/lib/libc.so.6
#7  0x00007f0b75daefcd in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/libstdc++.so.6
#8  0x00007f0b75dace56 in __cxxabiv1::__terminate(void (*)()) () from /usr/lib/libstdc++.so.6
#9  0x00007f0b75dacea1 in std::terminate() () from /usr/lib/libstdc++.so.6
#10 0x00007f0b75dad106 in __cxa_rethrow () from /usr/lib/libstdc++.so.6
#11 0x00007f0b7a06434b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#12 0x00007f0b7a0696e9 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#13 0x00007f0b7a56006c in Akonadi::ResourceBase::init(Akonadi::ResourceBase*) () from /usr/lib/libakonadi-kde.so.4
#14 0x00000000004314fe in _start ()
Comment 2 Tim Ruffing 2014-12-02 23:54:25 UTC
forgot to add:

This is KDE 4.14.3 on Arch Linux (x86_64).
Comment 3 Tim Ruffing 2014-12-03 14:38:57 UTC
qDebug was not enabled for akonadi_kolab_resource. If I enable it, I get one more line (marked with >>>)
akonadi_kolab_resource_1(10790)/kdepimlibs (kimap) KIMAP::LoginJob::handleResponse: "Login" "A000002"
akonadi_kolab_resource_1(10790)/kdepimlibs (kimap) KIMAP::LoginJob::~LoginJob: KIMAP::LoginJob(0x11df050)
akonadi_kolab_resource_1(10790) ImapResourceBase::doSetOnline: online= true
akonadi_kolab_resource_1(10790)/libakonadi Akonadi::EntityListCache<T, FetchJob, FetchScope_>::processResult: "Item query returned empty result set" 
>>> akonadi_kolab_resource_1(10790) KolabHelpers::translateToImap: converted event
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.

---

This happens in line 219 in kolabhelpers.cpp (v4.14.3). In a debug build, the "Q_ASSERT(item.hasPayload<KCalCore::Incidence::Ptr>());" (line 218) fires. So the expection is thrown while trying to access the payload afterwards.

The reason is that a non-existing item is processed here. 
Query Debugger says:

21587: SELECT PimItemTable.id, PimItemTable.remoteId, MimeTypeTable.name, PimItemTable.rev, PimItemTable.remoteRevision, PimItemTable.size, PimItemTable.collectionId FROM PimItemTable INNER JOIN MimeTypeTable ON ( PimItemTable.mimeTypeId = MimeTypeTable.id ) WHERE ( ( PimItemTable.id = 86977 ) ) ORDER BY PimItemTable.id DESC
Success: Query took 1 msecs 
Fetched 0 results

Using debug output, I have confirmed that 86977 is the id of the item that fails in the assert.
I just don't know where this id comes from, i.e., why this id should be accessed at all. It is possible that I created an item with this id (it's a "recent" id) locally, and deleted it afterwards, while I was offline. I could imagine that now it's still in some jon cache or similar for whatever reason, and the resource tries to send it to the kolab server. But I could not find the id anywhere in a table. (I don't know about caches.)

As a workaround, I replaced the assert by
            if (!item.hasPayload<KCalCore::Incidence::Ptr>()) {
                ok = false;
                return Akonadi::Item();
            }

Using this modification, I could avoid the crash. Then akonadi_kolab_resource could start and sort things out. Afterwards, I reverted to the original version of akonadi_kolab_resource (that crashed beforehand). Now the problems seems to be solved for me.
Comment 4 Denis Kurz 2017-06-23 19:58:07 UTC
This bug has never been confirmed for a KDE PIM version that is based on KDE Frameworks (5.x). Those versions differ significantly from the old 4.x series. Therefore, I plan to close it in around two or three months. In the meantime, it is set to WAITINGFORINFO to give reporters the oportunity to check if it is still valid. As soon as someone confirms it for a recent version (at least 5.1, ideally even more recent), I'll gladly reopen it.

Please understand that we lack the manpower to triage bugs reported for versions almost two years beyond their end of life.
Comment 5 Denis Kurz 2018-02-01 09:48:43 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.1 aka 15.12; preferably much more recent), please open a new one unless it already exists. Thank you for all your input.