Bug 354994 - Crash of Akonadi CardCalDav
Summary: Crash of Akonadi CardCalDav
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: DAV Resource (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: drkonqi
: 358510 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-11-07 14:33 UTC by Daniel Wrana
Modified: 2016-02-29 19:27 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 15.12.2


Attachments
New crash information added by DrKonqi (5.67 KB, text/plain)
2015-12-12 14:34 UTC, Matt Z.
Details
ATT08610.xsession-errors (208.61 KB, application/octet-stream)
2016-02-08 21:17 UTC, Matt Z.
Details
ATT93858.xsession-errors (540.71 KB, application/octet-stream)
2016-02-08 23:52 UTC, Matt Z.
Details
Check mEtagCaches[collection.remoteId()] result before using it (1.17 KB, patch)
2016-02-23 16:02 UTC, Sven Eden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Wrana 2015-11-07 14:33:17 UTC
Application: akonadi_davgroupware_resource (4.89.0)

Qt Version: 5.4.2
Operating System: Linux 4.2.0-17-generic x86_64
Distribution: Ubuntu 15.10

-- Information about the crash:
- What I was doing when the application crashed:
Regular Crash during uptime of aconadi. possible during snc

The crash can be reproduced sometimes.

-- Backtrace:
Application: Akonadi-Ressource (akonadi_davgroupware_resource), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fcabe18e840 (LWP 6564))]

Thread 3 (Thread 0x7fcabbd95700 (LWP 6565)):
#0  0x00007fcace2308dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007fcac8f2dbd2 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007fcac8f2f74f in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007fcabdcbca39 in ?? () from /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so
#4  0x00007fcaceb3a2be in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fcac914c6aa in start_thread (arg=0x7fcabbd95700) at pthread_create.c:333
#6  0x00007fcace23beed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7fcab961f700 (LWP 6569)):
#0  0x00007fcace2308dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007fcac88091ec in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fcac88092fc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fcaced7129b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007fcaced1775a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007fcaceb353d4 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007fcaceb3a2be in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007fcac914c6aa in start_thread (arg=0x7fcab961f700) at pthread_create.c:333
#8  0x00007fcace23beed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7fcabe18e840 (LWP 6564)):
[KCrash Handler]
#6  QString::QString (other=..., this=this@entry=0x7ffeec47aef0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:811
#7  Akonadi::Entity::remoteId (this=this@entry=0x7fcacede9518 <QArrayData::shared_null+24>) at ../../../../akonadi/src/core/entity.cpp:82
#8  0x0000000000468b7e in DavGroupwareResource::retrieveItems (this=this@entry=0x8e37c0, collection=...) at ../../../../resources/dav/resource/davgroupwareresource.cpp:257
#9  0x00007fcad244a32d in Akonadi::ResourceBasePrivate::slotItemRetrievalCollectionFetchDone (this=<optimized out>, job=0x935040) at ../../../../akonadi/src/agentbase/resourcebase.cpp:954
#10 0x00007fcad244c200 in Akonadi::ResourceBase::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at ./moc_resourcebase.cpp:294
#11 0x00007fcaced4a78a in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007fcad021a8d2 in KJob::result (this=this@entry=0x935040, _t1=_t1@entry=0x935040) at ./moc_kjob.cpp:552
#13 0x00007fcad021b45a in KJob::emitResult (this=0x935040) at ../../../src/lib/jobs/kjob.cpp:294
#14 0x00007fcad19c83b3 in Akonadi::JobPrivate::delayedEmitResult (this=<optimized out>) at ../../../../akonadi/src/core/jobs/job.cpp:153
#15 Akonadi::Job::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at ./moc_job.cpp:107
#16 0x00007fcaced4b651 in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007fcacf5e7b8c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007fcacf5ed230 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007fcaced19f1b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007fcaced1c057 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007fcaced70e73 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007fcac8808ff7 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007fcac8809250 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007fcac88092fc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007fcaced7127f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#26 0x00007fcaced1775a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x00007fcaced1f2cc in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#28 0x00007fcad244621a in Akonadi::ResourceBase::init (r=r@entry=0x8e37c0) at ../../../../akonadi/src/agentbase/resourcebase.cpp:602
#29 0x00000000004706c8 in Akonadi::ResourceBase::init<DavGroupwareResource> (argc=<optimized out>, argv=<optimized out>) at /usr/include/KF5/AkonadiAgentBase/resourcebase.h:193
#30 0x00007fcace155a40 in __libc_start_main (main=0x42d2a0 <main(int, char**)>, argc=3, argv=0x7ffeec47b8c8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffeec47b8b8) at libc-start.c:289
#31 0x000000000042d2d9 in _start ()

Reported using DrKonqi
Comment 1 Matt Z. 2015-12-12 14:34:02 UTC
Created attachment 96012 [details]
New crash information added by DrKonqi

akonadi_davgroupware_resource (4.89.0) using Qt 5.4.2

- What I was doing when the application crashed:
- nothing... happens periodically, seemingly random...
- also happens at times when I am reading emails (hotmail on firefox)
- I cannot see any pattern in this, timing or activity, but it happens several times during a day and has become quite annoying.
Thank you,
Matt Z.

-- Backtrace (Reduced):
#6  QString::QString (other=..., this=this@entry=0x7ffd61a82370) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:811
#7  Akonadi::Entity::remoteId (this=this@entry=0x7ff580639518 <QArrayData::shared_null+24>) at ../../../../akonadi/src/core/entity.cpp:82
#8  0x0000000000468b7e in DavGroupwareResource::retrieveItems (this=this@entry=0x137ca80, collection=...) at ../../../../resources/dav/resource/davgroupwareresource.cpp:257
#9  0x00007ff583c9a32d in Akonadi::ResourceBasePrivate::slotItemRetrievalCollectionFetchDone (this=<optimized out>, job=0x13b33a0) at ../../../../akonadi/src/agentbase/resourcebase.cpp:954
#10 0x00007ff583c9c200 in Akonadi::ResourceBase::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at ./moc_resourcebase.cpp:294
Comment 2 Grégory Oestreicher 2016-02-07 13:38:33 UTC
*** Bug 358510 has been marked as a duplicate of this bug. ***
Comment 3 Matt Z. 2016-02-08 01:21:31 UTC
Am new to linux, kubuntu, and still learning but perhaps the following will help...
Just guessing, but it seems to me possibly some kind of mismatch between server resource database and what is actually out there? I did at one point delete both 'resources' adn started over... idk, hth
_____________________________________
from "Current Akonadi server error log" -- repeated many times over...
"Cannot connect to agent instance with identifier 'akonadi_davgroupware_resource_8', error message: 'Could not get owner of name 'org.freedesktop.Akonadi.Resource.akonadi_davgroupware_resource_8': no such name'" 
"Cannot connect to agent instance with identifier 'akonadi_davgroupware_resource_8', error message: 'Could not get owner of name 'org.freedesktop.Akonadi.Resource.akonadi_davgroupware_resource_8': no such name'" 
"Cannot connect to agent instance with identifier 'akonadi_davgroupware_resource_8', error message: 'Could not get owner of name 'org.freedesktop.Akonadi.Resource.akonadi_davgroupware_resource_8': no such name'" 
_____________________________________
Listing command: ~$ find -name "*groupware*"
./.kde/share/config/akonadi_davgroupware_resource_3rc
./.kde/share/config/akonadi_davgroupware_resource_6rc
./.kde/share/apps/akonadi-davgroupware
./.kde/share/apps/akonadi-davgroupware/akonadi_davgroupware_resource_6_c2u.dat
./.kde/share/apps/akonadi-davgroupware/akonadi_davgroupware_resource_2_c2u.dat
./Temp/davgroupware_002.jpg
./Temp/davgroupware_001.jpg
./.config/akonadi_davgroupware_resource_3rc
./.config/akonadi/agent_config_akonadi_davgroupware_resource_3_changes.dat
./.config/akonadi/agent_config_akonadi_davgroupware_resource_3
./.config/akonadi/agent_config_akonadi_davgroupware_resource_8_changes.dat
./.config/akonadi/agent_config_akonadi_davgroupware_resource_8
./.config/akonadi_davgroupware_resource_8rc
_____________________________________
-end-
Comment 4 David Yentzen 2016-02-08 14:48:06 UTC
OK, thanks. I'm going to take a closer look at this. Not new to Linux but am new to trying to learn and contribute more. Interesting thing about this bug appeared only after I configured my contacts using LDAP. I just now went back into Kontacts and had to manually "activate¨ contacts and restart the LDAP. So far, no crash.
Comment 5 Grégory Oestreicher 2016-02-08 19:12:49 UTC
(In reply to Matt Z. from comment #3)

> "Cannot connect to agent instance with identifier
> 'akonadi_davgroupware_resource_8', error message: 'Could not get owner of
> name 'org.freedesktop.Akonadi.Resource.akonadi_davgroupware_resource_8': no
> such name'" 

This is because the resource crashed.

> ./.config/akonadi/agent_config_akonadi_davgroupware_resource_8_changes.dat
> ./.config/akonadi/agent_config_akonadi_davgroupware_resource_8
> ./.config/akonadi_davgroupware_resource_8rc

So this resource has pending changes waiting, and one of them may trigger the crash. Don't delete these files just now :)

Can you start "kdebugsettings", search for the dav resource (type "dav" in the search bar), restart it, and then paste here what's show in your ~/.xsession-errors (or ~/.xsessions-errors-:0 maybe)?
Comment 6 Matt Z. 2016-02-08 21:17:37 UTC
Created attachment 97093 [details]
ATT08610.xsession-errors

OK, I hope I got the instructions right... I rebooted & had to set kdebugsettings again... here is the current .xsession-errors (no app crash).
HTH.
Matt

________________________________________
From: Grégory Oestreicher via KDE Bugzilla  <bugzilla_noreply@kde.org>
Sent: Monday, February 8, 2016 2:12 PM
To: mattz@hotmail.com
Subject: [Akonadi] [Bug 354994] Crash of Akonadi CardCalDav

https://bugs.kde.org/show_bug.cgi?id=354994

Grégory Oestreicher <greg@kamago.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greg@kamago.net

--- Comment #5 from Grégory Oestreicher <greg@kamago.net> ---
(In reply to Matt Z. from comment #3)

> "Cannot connect to agent instance with identifier
> 'akonadi_davgroupware_resource_8', error message: 'Could not get owner of
> name 'org.freedesktop.Akonadi.Resource.akonadi_davgroupware_resource_8': no
> such name'"

This is because the resource crashed.

> ./.config/akonadi/agent_config_akonadi_davgroupware_resource_8_changes.dat
> ./.config/akonadi/agent_config_akonadi_davgroupware_resource_8
> ./.config/akonadi_davgroupware_resource_8rc

So this resource has pending changes waiting, and one of them may trigger the
crash. Don't delete these files just now :)

Can you start "kdebugsettings", search for the dav resource (type "dav" in the
search bar), restart it, and then paste here what's show in your
~/.xsession-errors (or ~/.xsessions-errors-:0 maybe)?

--
You are receiving this mail because:
You are on the CC list for the bug.
Comment 7 Grégory Oestreicher 2016-02-08 21:26:24 UTC
(In reply to Matt Z. from comment #6)

> OK, I hope I got the instructions right...

Definitely :) There are logs only available when in debug mode, thanks!

> here is the current .xsession-errors (no app crash).

Once the resource has crashed could you send this file again? This one is not containing anything that may point me in the right direction unfortunately.
Comment 8 Matt Z. 2016-02-08 23:52:17 UTC
Created attachment 97097 [details]
ATT93858.xsession-errors

OK... rebooted again and this time the change in kdebugsettings "stuck", all other items unchecked (my untrained eye does't see much difference in the log)... had one crash, file attached. 

a note: neither file was changed during this time... I just let the computer sit idle.

I noticed that at line 1078, there is an error (under Matt_Addr.vcf)... whereas at line 1100 there is no error (under Matt_Cal.ics). Kind of similar error around line 2899... still no changes in either file's data. I only had one crash (that I'm aware of) and at 3288 there is a crash message. Then at 3451 is the "Cannot connect to agent..." message.

HTH,
Matt

________________________________________
From: Grégory Oestreicher via KDE Bugzilla  <bugzilla_noreply@kde.org>
Sent: Monday, February 8, 2016 4:26 PM
To: mattz@hotmail.com
Subject: [Akonadi] [Bug 354994] Crash of Akonadi CardCalDav

https://bugs.kde.org/show_bug.cgi?id=354994

--- Comment #7 from Grégory Oestreicher <greg@kamago.net> ---
(In reply to Matt Z. from comment #6)

> OK, I hope I got the instructions right...

Definitely :) There are logs only available when in debug mode, thanks!

> here is the current .xsession-errors (no app crash).

Once the resource has crashed could you send this file again? This one is not
containing anything that may point me in the right direction unfortunately.

--
You are receiving this mail because:
You are on the CC list for the bug.
Comment 9 Grégory Oestreicher 2016-02-09 20:19:39 UTC
I'm a bit stumped here :| There are a lot of "Unhandled response" message and this looks like there's a race condition somewhere.

Do you have two resources querying the same server or one resource with one CalDAV URL and one CardDAV URL?
Comment 10 Matt Z. 2016-02-09 22:18:35 UTC
I (think) one... on android phone I have one davdroid 'account' with 2 urls, 1 CalDAV & 1 CardDAV... 

does that the answer your question (properly)?

________________________________________
From: Grégory Oestreicher via KDE Bugzilla  <bugzilla_noreply@kde.org>
Sent: Tuesday, February 9, 2016 3:19 PM
To: mattz@hotmail.com
Subject: [Akonadi] [Bug 354994] Crash of Akonadi CardCalDav

https://bugs.kde.org/show_bug.cgi?id=354994

--- Comment #9 from Grégory Oestreicher <greg@kamago.net> ---
I'm a bit stumped here :| There are a lot of "Unhandled response" message and
this looks like there's a race condition somewhere.

Do you have two resources querying the same server or one resource with one
CalDAV URL and one CardDAV URL?

--
You are receiving this mail because:
You are on the CC list for the bug.
Comment 11 Grégory Oestreicher 2016-02-10 20:26:12 UTC
Git commit c94e23a452d410d2c2e4033fb76261d969f19b92 by Grégory Oestreicher.
Committed on 10/02/2016 at 20:25.
Pushed by goestreicher into branch 'Applications/15.12'.

Check that we've been given a valid collection in retrieveItems()
FIXED-IN: 15.12.2

M  +5    -0    resources/dav/resource/davgroupwareresource.cpp

http://commits.kde.org/kdepim-runtime/c94e23a452d410d2c2e4033fb76261d969f19b92
Comment 12 Sven Eden 2016-02-23 15:46:16 UTC
Hmm... I've updated to 15.12.2 but all mails regarding exchange calendar invitations still crash the resource.

Maybe I hit a different bug?

I got: "akonadi_davgroupware_resource" Signal: Segmentation fault (11)

The most interesting lines from the backtrace are:

--------
#5  <signal handler called>
#6  QMap<QString, QString>::detach (this=0x10) at /usr/include/qt5/QtCore/qmap.h:364
#7  QMap<QString, QString>::operator[] (akey=..., this=0x10) at /usr/include/qt5/QtCore/qmap.h:629
#8  EtagCache::setEtag (this=0x0, remoteId=..., etag=...)
    at /home/portage/kde-apps/kdepim-runtime-15.12.2/work/kdepim-runtime-15.12.2/resources/dav/common/etagcache.cpp:38
#9  0x00000000004719ed in DavGroupwareResource::onItemFetched (this=0x1239990, job=<optimized out>, updateType=DavGroupwareResource::ItemUpdateAdd)
    at /home/portage/kde-apps/kdepim-runtime-15.12.2/work/kdepim-runtime-15.12.2/resources/dav/resource/davgroupwareresource.cpp:958
--------

See frame #8 where 'this' is 0x0?

Frame #8 source is:

--------
(gdb) frame 8
#8  EtagCache::setEtag (this=0x0, remoteId=..., etag=...)
    at /home/portage/kde-apps/kdepim-runtime-15.12.2/work/kdepim-runtime-15.12.2/resources/dav/common/etagcache.cpp:38
38          mCache[ remoteId ] = etag;
--------

Frame #9 source is:

--------
(gdb) frame 9
#9  0x00000000004719ed in DavGroupwareResource::onItemFetched (this=0x1239990, job=<optimized out>, updateType=DavGroupwareResource::ItemUpdateAdd)
    at /home/portage/kde-apps/kdepim-runtime-15.12.2/work/kdepim-runtime-15.12.2/resources/dav/resource/davgroupwareresource.cpp:958
958         mEtagCaches[collection.remoteId()]->setEtag(item.remoteId(), davItem.etag());
--------

So I *guess* collection.remoteId() should be checked first...
Comment 13 Sven Eden 2016-02-23 16:02:11 UTC
Created attachment 97378 [details]
Check mEtagCaches[collection.remoteId()] result before using it

The patch fixed the crash for me. However, I *do* think that it is a different issue, but at least you now know about it. ;-)
Comment 14 Matt Z. 2016-02-29 19:27:01 UTC
Thank you Grégory,
 
I'm still trying to figure out how to tell when I get this update so I could report back with results or confirmation of fix...
but because I don't know (as yet) if I have the update, I figured I'd wait a bit... while the crashes continued.

Meanwhile, as of Feb 28th, since I was still having crashes, I did a bit more digging... 

I found a file -- .kde/share/config/akonadi_ical_resource_2rc -- which referenced an old/original calendar which was set up when claendar app was first loaded and subsequently deleted when I went with a single calendar using davgroupware (so the item/file referenced in this file did not exist)... as an experiment, I deleted the file and have had no crashes since then (no system updates have been installed since file was deleted). Normally I would have had 10-20 crashes by now, so it seems like deleting the file resolved the issue. System has been rebooted, both calendar & addressbook updates to phone work, and I do not seem to be experiencing any problems with either app or related data.

HTH,
Matt

________________________________________
From: Grégory Oestreicher via KDE Bugzilla  <bugzilla_noreply@kde.org>
Sent: Wednesday, February 10, 2016 3:26 PM
To: mattz@hotmail.com
Subject: [Akonadi] [Bug 354994] Crash of Akonadi CardCalDav

https://bugs.kde.org/show_bug.cgi?id=354994

Grégory Oestreicher <greg@kamago.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Version Fixed In|                            |15.12.2
             Status|UNCONFIRMED                 |RESOLVED
      Latest Commit|                            |http://commits.kde.org/kdep
                   |                            |im-runtime/c94e23a452d410d2
                   |                            |c2e4033fb76261d969f19b92
         Resolution|---                         |FIXED

--- Comment #11 from Grégory Oestreicher <greg@kamago.net> ---
Git commit c94e23a452d410d2c2e4033fb76261d969f19b92 by Grégory Oestreicher.
Committed on 10/02/2016 at 20:25.
Pushed by goestreicher into branch 'Applications/15.12'.

Check that we've been given a valid collection in retrieveItems()
FIXED-IN: 15.12.2

M  +5    -0    resources/dav/resource/davgroupwareresource.cpp

http://commits.kde.org/kdepim-runtime/c94e23a452d410d2c2e4033fb76261d969f19b92

--
You are receiving this mail because:
You are on the CC list for the bug.