[Akonadi] [Bug 362420] DAV Resource 16.08.0: Segfaults randomly

2016-12-18 Thread NightSky
https://bugs.kde.org/show_bug.cgi?id=362420

NightSky  changed:

   What|Removed |Added

 CC||risimi...@gmail.com

--- Comment #2 from NightSky  ---
Same here on Gentoo Linux, kde-frameworks-5.29, kde-applications-16.12.0 with
similar stack trace.

According to the stack trace:
EtagCache::setEtag (this=__0x0__, remoteId=..., etag=...)
DavGroupwareResource::onItemFetched(...)
it looks like DavGroupwareResource::onItemFetched() is got a nullptr instead of
EtagCache*.

Relevant lines from davgroupwareresource.cpp:
956:// update etag
957:item.setRemoteRevision(davItem.etag());
958:>>> EtagCache *etag = mEtagCaches[collection.remoteId()]; <<<
959:etag->setEtag(item.remoteId(), davItem.etag());

If collection.remoteId() is not in the mEtagCaches, the etag pointer will be
initialized to null.
( https://doc.qt.io/qt-5.7/qmap.html#operator-5b-5d )
( https://doc.qt.io/qt-5.7/containers.html#default-constructed-value )

I don't really know what the DavGroupwareResource should do in such case, so
meanwhile I just copy pasted a relevant check from another DavGroupwareResource
method (see below).
And now, instead of the segfault I get an "org.kde.pim.davresource: Fetched
item is in a collection we don't have in the cache" in the logs, each time I
open KOrganizer.

Hope that helps.

 - - -  - - - - - - - - - - - - - - - - - - - - - - - - ->8
diff --git a/resources/dav/resource/davgroupwareresource.cpp
b/resources/dav/resource/davgroupwareresource.cpp
--- a/resources/dav/resource/davgroupwareresource.cpp
+++ b/resources/dav/resource/davgroupwareresource.cpp
@@ -955,6 +955,14 @@

 // update etag
 item.setRemoteRevision(davItem.etag());
+
+if (!mEtagCaches.contains(collection.remoteId())) {
+qCWarning(DAVRESOURCE_LOG) << "Fetched item is in a collection we
don't have in the cache";
+// TODO: fix #362420 "DAV Resource 16.08.0: Segfaults randomly"
+cancelTask();
+return;
+}
+
 EtagCache *etag = mEtagCaches[collection.remoteId()];
 etag->setEtag(item.remoteId(), davItem.etag());

8< - -  - - - - - - - - - - - - - - - - - - - - - - - - - -

-- 
You are receiving this mail because:
You are watching all bug changes.

[Akonadi] [Bug 362420] DAV Resource 16.08.0: Segfaults randomly

2016-09-25 Thread Denis Kurz via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=362420

Denis Kurz  changed:

   What|Removed |Added

Version|16.08   |5.3.0
 CC||kde...@posteo.de

-- 
You are receiving this mail because:
You are watching all bug changes.


[Akonadi] [Bug 362420] DAV Resource 16.08.0: Segfaults randomly

2016-09-15 Thread Till Schäfer via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=362420

Till Schäfer  changed:

   What|Removed |Added

Version|unspecified |16.08

-- 
You are receiving this mail because:
You are watching all bug changes.

[Akonadi] [Bug 362420] DAV Resource 16.08.0: Segfaults randomly

2016-09-07 Thread Till Schäfer via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=362420

Till Schäfer  changed:

   What|Removed |Added

Summary|DAV Resource 16.04.0:   |DAV Resource 16.08.0:
   |Segfaults randomly  |Segfaults randomly
Version|16.04   |unspecified

-- 
You are receiving this mail because:
You are watching all bug changes.