Bug 297039 - KAlarmCal::EventAttribute::commandError makes Kontact crash
Summary: KAlarmCal::EventAttribute::commandError makes Kontact crash
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: KAlarm resource (show other bugs)
Version: 4.9
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: David Jarvie
URL:
Keywords:
: 309021 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-29 14:08 UTC by Thomas Tanghus
Modified: 2013-10-28 01:13 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.3


Attachments
New crash information added by DrKonqi (8.80 KB, text/plain)
2012-09-10 11:40 UTC, Thomas Tanghus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Tanghus 2012-03-29 14:08:50 UTC
Application: kontact (4.8.0)
KDE Platform Version: 4.8.1 (4.8.1)
Qt Version: 4.8.0
Operating System: Linux 3.0.0-17-generic x86_64
Distribution: Ubuntu 11.10

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

I had just started Kontact, so it wasn't really anything I did, and I can't see why KAlarm should make Kontact crash..?

-- Backtrace:
Application: Kontact (kontact), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f504971a7c0 (LWP 1454))]

Thread 6 (Thread 0x7f502e012700 (LWP 1455)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f5045f51c2c in WTF::TCMalloc_PageHeap::scavengerThread (this=0x7f5046908220) at wtf/FastMalloc.cpp:2495
#2  0x00007f5045f51d59 in WTF::TCMalloc_PageHeap::runScavengerThread (context=<optimized out>) at wtf/FastMalloc.cpp:1618
#3  0x00007f504171eefc in start_thread (arg=0x7f502e012700) at pthread_create.c:304
#4  0x00007f5046c6159d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7f502d711700 (LWP 1456)):
#0  0x00007f5046c55473 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f504124cf68 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f504124d429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f50473cfc26 in QEventDispatcherGlib::processEvents (this=0x1cdd4d0, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007f504739f402 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f504739f657 in QEventLoop::exec (this=0x7f502d710dc0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f504729f067 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f50472a208b in QThreadPrivate::start (arg=0x1cdcba0) at thread/qthread_unix.cpp:298
#8  0x00007f504171eefc in start_thread (arg=0x7f502d711700) at pthread_create.c:304
#9  0x00007f5046c6159d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f4fdd7bc700 (LWP 1463)):
#0  0x00007f504124c570 in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007f504124cf82 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f504124d429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f50473cfc26 in QEventDispatcherGlib::processEvents (this=0x2a151b0, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007f504739f402 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f504739f657 in QEventLoop::exec (this=0x7f4fdd7bbd90, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f504729f067 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f504737f17f in QInotifyFileSystemWatcherEngine::run (this=0x1f09910) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f50472a208b in QThreadPrivate::start (arg=0x1f09910) at thread/qthread_unix.cpp:298
#9  0x00007f504171eefc in start_thread (arg=0x7f4fdd7bc700) at pthread_create.c:304
#10 0x00007f5046c6159d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f4fd4ec4700 (LWP 1476)):
#0  0x00007f5041721034 in __pthread_mutex_lock (mutex=0x58a0b98) at pthread_mutex_lock.c:61
#1  0x00007f504124c4ca in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f504124cf82 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f504124d429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f50473cfc26 in QEventDispatcherGlib::processEvents (this=0x5824a80, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:426
#5  0x00007f504739f402 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#6  0x00007f504739f657 in QEventLoop::exec (this=0x7f4fd4ec3dc0, flags=...) at kernel/qeventloop.cpp:204
#7  0x00007f504729f067 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#8  0x00007f50472a208b in QThreadPrivate::start (arg=0x42b9270) at thread/qthread_unix.cpp:298
#9  0x00007f504171eefc in start_thread (arg=0x7f4fd4ec4700) at pthread_create.c:304
#10 0x00007f5046c6159d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f4fd312d700 (LWP 1519)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f4fd3598d54 in ?? () from /usr/lib/libvlccore.so.4
#2  0x00007f504171eefc in start_thread (arg=0x7f4fd312d700) at pthread_create.c:304
#3  0x00007f5046c6159d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#4  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f504971a7c0 (LWP 1454)):
[KCrash Handler]
#6  KAlarmCal::EventAttribute::commandError (this=0x0) at ../../kalarmcal/eventattribute.cpp:68
#7  0x00007f4f9a5144f1 in SerializerPluginKAlarm::deserialize (this=<optimized out>, item=..., label=<optimized out>, data=<optimized out>, version=<optimized out>) at ../../plugins/akonadi_serializer_kalarm.cpp:82
#8  0x00007f5043a4aca2 in Akonadi::ItemSerializer::deserialize (item=..., label=..., data=..., version=0) at ../../akonadi/itemserializer.cpp:102
#9  0x00007f5043a4b2d6 in Akonadi::ItemSerializer::deserialize (item=..., label=..., data=..., version=0, external=<optimized out>) at ../../akonadi/itemserializer.cpp:94
#10 0x00007f5043a6bb06 in Akonadi::ProtocolHelper::parseItemFetchResult (lineTokens=..., item=..., valuePool=0x0) at ../../akonadi/protocolhelper.cpp:396
#11 0x00007f5043a42fc7 in Akonadi::ItemFetchJob::doHandleResponse (this=<optimized out>, tag=..., data=...) at ../../akonadi/itemfetchjob.cpp:192
#12 0x00007f5043a559e9 in Akonadi::JobPrivate::handleResponse (this=<optimized out>, tag=..., data=...) at ../../akonadi/job.cpp:80
#13 0x00007f5043a8b836 in Akonadi::SessionPrivate::dataReceived (this=0x29b1d20) at ../../akonadi/session.cpp:218
#14 0x00007f5043a8e88d in Akonadi::Session::qt_metacall (this=0x236b2c0, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fff4feb6570) at ./session.moc:96
#15 0x00007f50473b4c09 in QMetaObject::activate (sender=0x29ad720, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3566
#16 0x00007f50473b4a01 in QMetaObject::activate (sender=0x29ae0f8, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3547
#17 0x00007f504255181f in QAbstractSocketPrivate::canReadNotification (this=0x29ae150) at socket/qabstractsocket.cpp:651
#18 0x00007f5042559371 in event (this=<optimized out>, e=<optimized out>) at socket/qnativesocketengine.cpp:1151
#19 QReadNotifier::event (this=<optimized out>, e=<optimized out>) at socket/qnativesocketengine.cpp:1148
#20 0x00007f5047d94104 in notify_helper (e=0x7fff4feb6c30, receiver=0x29ad870, this=0x1cd9350) at kernel/qapplication.cpp:4555
#21 QApplicationPrivate::notify_helper (this=0x1cd9350, receiver=0x29ad870, e=0x7fff4feb6c30) at kernel/qapplication.cpp:4527
#22 0x00007f5047d98f83 in QApplication::notify (this=0x7fff4feb6ee0, receiver=0x29ad870, e=0x7fff4feb6c30) at kernel/qapplication.cpp:4416
#23 0x00007f5048ac69a6 in KApplication::notify (this=0x7fff4feb6ee0, receiver=0x29ad870, event=0x7fff4feb6c30) at ../../kdeui/kernel/kapplication.cpp:311
#24 0x00007f50473a061c in QCoreApplication::notifyInternal (this=0x7fff4feb6ee0, receiver=0x29ad870, event=0x7fff4feb6c30) at kernel/qcoreapplication.cpp:876
#25 0x00007f50473cf217 in sendEvent (event=0x7fff4feb6c30, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#26 socketNotifierSourceDispatch (source=0x1ce3880) at kernel/qeventdispatcher_glib.cpp:110
#27 0x00007f504124ca5d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007f504124d258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007f504124d429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007f50473cfbbf in QEventDispatcherGlib::processEvents (this=0x1ca3c10, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#31 0x00007f5047e3928e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#32 0x00007f504739f402 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#33 0x00007f504739f657 in QEventLoop::exec (this=0x7fff4feb6e70, flags=...) at kernel/qeventloop.cpp:204
#34 0x00007f50473a46e7 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#35 0x0000000000403629 in main (argc=1, argv=0x7fff4feb7508) at ../../../kontact/src/main.cpp:218

Reported using DrKonqi
Comment 1 Christophe Marin 2012-03-30 13:31:47 UTC
Adding David
Comment 2 emw-kdebugs 2012-03-30 21:49:53 UTC
Hi all,

I'm observing the same issue with current git branch "origin-KDE/4.8" for both kontact and the korganizer reminder daemon. KDE is the the very recent 4.8 branch freshly compiled (including qt 4.8.1) with the help of "kdesrc-build" on top of a debian/sid.

This is a quite serious issue with recurring kalarm items, which then makes kontact quasi unusable.

Unfortunately, I'm not that much experienced with kdepim source code, thus I'm afraid, I currently cannot contribute much, except the obvious observation: A NULL-pointer check could be added in "SerializerPluginKAlarm::deserialize" in order to avoid the segfault, but the problem is likely located somewhere else where a NULL-pointer is inserted as item.attribute<EventAttribute>() for the parameter "item" of "SerializerPluginKAlarm::deserialize".

Best regards, 
Martin
Comment 3 David Jarvie 2012-03-30 22:32:04 UTC
Git commit 32f4856a753e83328fe6b602d84a241de7db4479 by David Jarvie.
Committed on 31/03/2012 at 00:32.
Pushed by djarvie into branch 'master'.

Fix crash when fetching attribute.

Use member variable to control initialisation, not static variable.

M  +5    -6    plugins/akonadi_serializer_kalarm.cpp
M  +2    -1    plugins/akonadi_serializer_kalarm.h

http://commits.kde.org/kdepim-runtime/32f4856a753e83328fe6b602d84a241de7db4479
Comment 4 David Jarvie 2012-03-30 22:35:19 UTC
Git commit 85aabae810197bc220215a7dde6225c0a99d065a by David Jarvie.
Committed on 31/03/2012 at 00:35.
Pushed by djarvie into branch 'KDE/4.8'.

Fix crash when fetching attribute.

Use member variable to control initialisation, not static variable.

Backport of 32f4856a753e83328fe6b602d84a241de7db4479 (master).

M  +5    -6    plugins/akonadi_serializer_kalarm.cpp
M  +2    -1    plugins/akonadi_serializer_kalarm.h

http://commits.kde.org/kdepim-runtime/85aabae810197bc220215a7dde6225c0a99d065a
Comment 5 Thomas Tanghus 2012-09-10 11:40:57 UTC
Created attachment 73785 [details]
New crash information added by DrKonqi

kontact (4.9) on KDE Platform 4.9.00 using Qt 4.8.2

- What I was doing when the application crashed:

I had just marked a ToDo completed on a CalDAV resource though I don't think that is related?
This is on 4.9, so apparently not totally fixed ;)

-- Backtrace (Reduced):
#6  KAlarmCal::EventAttribute::commandError (this=0x0) at ../../kalarmcal/eventattribute.cpp:68
#7  0x00007f5de83dc57e in SerializerPluginKAlarm::deserialize (this=<optimized out>, item=..., label=..., data=..., version=<optimized out>) at ../../plugins/akonadi_serializer_kalarm.cpp:81
#8  0x00007f5e775096c2 in Akonadi::ItemSerializer::deserialize (item=..., label=..., data=..., version=0) at ../../akonadi/itemserializer.cpp:102
#9  0x00007f5e77509cf6 in Akonadi::ItemSerializer::deserialize (item=..., label=..., data=..., version=0, external=<optimized out>) at ../../akonadi/itemserializer.cpp:94
#10 0x00007f5e7752a596 in Akonadi::ProtocolHelper::parseItemFetchResult (lineTokens=..., item=..., valuePool=0x0) at ../../akonadi/protocolhelper.cpp:396
Comment 6 Myriam Schweingruber 2012-09-10 18:54:04 UTC
Apparently this fix didn't do it, reopening.
Comment 7 David Jarvie 2012-09-11 09:06:56 UTC
Can you reproduce this crash? If so, if you have debug area 5250 turned on, do you see the following warning message:

"Found attribute of unknown type KAlarmEvent. Did you forget to call AttributeFactory::registerAttribute()?"
Comment 8 Christophe Marin 2012-09-11 09:18:34 UTC
(In reply to comment #7)
> Can you reproduce this crash? If so, if you have debug area 5250 turned on,
> do you see the following warning message:
> 

To do that, run `kdebugdialog`, look for 5250 and tick the box if it's not. Then try to reproduce the crash. 

You will get some debug messages in ~/.xsession-errors
Comment 9 David Jarvie 2012-09-12 00:13:38 UTC
I've committed a patch which should either fix this, or provide better diagnostic information if it still happens. Once you eventually update to KDE 4.9.2 or later, please report again whether you see this crash. If you do see it, please submit the new crash trace to allow better analysis of the problem.

Please note that if you can currently reproduce this crash, I'd still appreciate the information requested in comment 7 (without waiting for 4.9.2).

Thanks for taking the trouble to report this crash again.

Git commit edae867614453fedd09aff54b45b6276e5ba840a (master), 6edb5ec0d3dae3fc12a07176090b24e15556a014 (4.9 branch).
Comment 10 Thomas Tanghus 2012-09-12 12:02:21 UTC
(In reply to comment #9)
> I've committed a patch which should either fix this, or provide better
> diagnostic information if it still happens. Once you eventually update to
> KDE 4.9.2 or later, please report again whether you see this crash. If you
> do see it, please submit the new crash trace to allow better analysis of the
> problem.

Great. I'll keep an eye open for it.

> Please note that if you can currently reproduce this crash, I'd still
> appreciate the information requested in comment 7 (without waiting for
> 4.9.2).

Sorry, I had forgotten to enable that. Done.

> Thanks for taking the trouble to report this crash again.

Thanks for trying to fix it :-)
Comment 11 emw-kdebugs 2012-09-13 18:27:33 UTC
(In reply to comment #9)

Hi David!

> I've committed a patch which should either fix this, or provide better
> diagnostic information if it still happens. Once you eventually update to

Thanks for your commit! Once more, I'm also affected this issue. Seems that the code you added is hit indeed. 

Before the git pull on branch KDE/4.9, I got exactly the message you wrote in comment #7, immediately before the crashes of korgac and kontact.

After a git pull (yesterday evening) on branch KDE/4.9 to fetch your commit, the new code is hit and produces the following error message/stack trace:

  korgac(21391)/akonadiserializer (kalarm): deserialize(): Event with uid "5f3bbd7b-f018-4544-815f-6bf333e5156c" contains unknown type EventAttribute 
  KCrash: Application 'korgac' crashing...

  Thread 1 (Thread 0x7f81f62ae840 (LWP 23041)):
  [KCrash Handler]
  #5  0x00007f81ef8f5475 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
  #6  0x00007f81ef8f86f0 in *__GI_abort () at abort.c:92
  #7  0x00007f81f090eddf in qt_message_output(QtMsgType, char const*) () from /usr/src/kde-4.9/install//lib/libQtCore.so.4
  #8  0x00007f81866b9931 in SerializerPluginKAlarm::deserialize(Akonadi::Item&, QByteArray const&, QIODevice&, int) () from /usr/src/kde-4.9/install/lib/kde4/akonadi_serializer_kalarm.so
  #9  0x00007f81eb4910d3 in Akonadi::ItemSerializer::deserialize(Akonadi::Item&, QByteArray const&, QIODevice&, int) () from /usr/src/kde-4.9/install//lib/libakonadi-kde.so.4
  #10 0x00007f81eb4916dc in Akonadi::ItemSerializer::deserialize(Akonadi::Item&, QByteArray const&, QByteArray const&, int, bool) () from /usr/src/kde-4.9/install//lib/libakonadi-kde.so.4
  #11 0x00007f81eb4b07ed in Akonadi::ProtocolHelper::parseItemFetchResult(QList<QByteArray> const&, Akonadi::Item&, Akonadi::ProtocolHelperValuePool*) () from /usr/src/kde-4.9/install//lib/libakonadi-kde.so.4
  #12 0x00007f81eb48ac48 in Akonadi::ItemFetchJob::doHandleResponse(QByteArray const&, QByteArray const&) () from /usr/src/kde-4.9/install//lib/libakonadi-kde.so.4
  #13 0x00007f81eb49b6fb in Akonadi::JobPrivate::handleResponse(QByteArray const&, QByteArray const&) () from /usr/src/kde-4.9/install//lib/libakonadi-kde.so.4
  #14 0x00007f81eb4d24db in Akonadi::SessionPrivate::dataReceived() () from /usr/src/kde-4.9/install//lib/libakonadi-kde.so.4
  #15 0x00007f81f0a29f64 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/src/kde-4.9/install//lib/libQtCore.so.4
  #16 0x00007f81f0a29f64 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/src/kde-4.9/install//lib/libQtCore.so.4
  #17 0x00007f81f33424cc in ?? () from /usr/src/kde-4.9/install//lib/libQtNetwork.so.4
  #18 0x00007f81f334ae3d in ?? () from /usr/src/kde-4.9/install//lib/libQtNetwork.so.4
  #19 0x00007f81f16ba59c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/src/kde-4.9/install//lib/libQtGui.so.4
  #20 0x00007f81f16be9c1 in QApplication::notify(QObject*, QEvent*) () from /usr/src/kde-4.9/install//lib/libQtGui.so.4
  #21 0x00007f81f23f6816 in KApplication::notify(QObject*, QEvent*) () from /usr/src/kde-4.9/install//lib/libkdeui.so.5
  #22 0x00007f81f0a14c9e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/src/kde-4.9/install//lib/libQtCore.so.4
  [...]

I'm sorry, that I'm currently not able to spend time on more sophisticated debugging of this issue, but I hope that the little bit of feedback/information in this post already provides some kind of helpful information.

With best regards and many thanks for your effort!

   Martin
Comment 12 David Jarvie 2012-09-14 11:10:57 UTC
Thanks for that information - it tells me what I need to know. It just remains to work out how to fix it ...
Comment 13 David Jarvie 2012-11-28 23:16:36 UTC
I've added a possible fix plus some more diagnostics to the 4.9 branch (which will be in the KDE 4.9.4 release). Can you please report whether this works, and what error messages you see (even if the fix works). I'm sorry this has taken so long to do.

Git commit 7a139c693c53683b805ae8282bec4daacd97d53d.
Comment 14 David Jarvie 2013-05-29 21:52:20 UTC
*** Bug 309021 has been marked as a duplicate of this bug. ***
Comment 15 David Jarvie 2013-08-11 16:23:34 UTC
There has been no further information on this bug since comment #13, and I can't reproduce the crash when Kontact opens with a KAlarm calendar containing command alarms on KDE 4.11. Marking as fixed, but if the problem recurs, please reopen.
Comment 16 David Jarvie 2013-10-28 01:13:40 UTC
I reproduced the crash on KDE 4.11. Now fixed by commit 05495dc86688e7ea49badabd72157c057e05762d (4.11 branch).