Bug 235690 - kontact hangs when starting in summary view or after switching to summary view
Summary: kontact hangs when starting in summary view or after switching to summary view
Status: RESOLVED WORKSFORME
Alias: None
Product: kontact
Classification: Unclassified
Component: general (show other bugs)
Version: 4.4.2
Platform: openSUSE RPMs Unspecified
: NOR crash with 40 votes (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-29 08:15 UTC by Roman Fietze
Modified: 2013-08-22 02:02 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Recurrent event without DTSTART tag (343 bytes, text/plain)
2013-06-13 21:28 UTC, Martin Nebe
Details
Not recurrent event without DTSTART tag (469 bytes, text/plain)
2013-06-13 23:29 UTC, Martin Nebe
Details
ICal test file to check for the presence of the bug. (748 bytes, text/plain)
2013-08-22 01:34 UTC, Martin Nebe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Fietze 2010-04-29 08:15:41 UTC
Version:            (using KDE 4.4.2)
Installed from:    openSUSE RPMs

When I switch to the summary view this works, but from now on kontact does no longer react to keypresses or mouse clicks and has to be killed or terminated.

When the [View] section of kontactrc does not contain an entry for ActivePlugin, then kontact already hangs when beeing started and has to be killed or terminated.

Manually adding

[View]
ActivePlugin=kontact_kmailplugin

is a workaround.

Not having any unread mail fixes the problem. Not having any TODO's, event's or birthday's within the selected time frame has not yet been tested.
Comment 1 Roman Fietze 2010-04-29 08:17:10 UTC
I wrote

> Not having any unread mail fixes the problem.

This is a typo. Correct is:

Not having any unread mail does not fix the problem.
Comment 2 Roman Fietze 2010-05-05 10:00:23 UTC
Additional information:

When sendig SIGQUIT to kontact when it hangs, I get the following stack from teh core file:

#0  0x00007ff7fa080d03 in poll () from /lib64/libc.so.6
(gdb) where
#0  0x00007ff7fa080d03 in poll () from /lib64/libc.so.6
#1  0x00007ff7f2e5559c in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007ff7f2e558e0 in g_main_context_iteration ()
   from /usr/lib64/libglib-2.0.so.0
#3  0x00007ff7fb449eb3 in QEventDispatcherGlib::processEvents (this=0x613230, 
    flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:412
#4  0x00007ff7fa88b51e in QGuiEventDispatcherGlib::processEvents (this=
    0x22dd3f0, flags=<value optimized out>)
    at kernel/qguieventdispatcher_glib.cpp:204
#5  0x00007ff7fb41f2a2 in QEventLoop::processEvents (
    this=<value optimized out>, flags=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
) at kernel/qeventloop.cpp:149
#6  0x00007ff7fb41f67c in QEventLoop::exec (this=0x7fff20df7780, flags=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
)
    at kernel/qeventloop.cpp:201
#7  0x00007ff7fb7e0bbe in KJob::exec (this=0x268df80)
    at /usr/src/debug/kdelibs-4.4.2/kdecore/jobs/kjob.cpp:204
#8  0x00007ff7e54c3ccc in SDSummaryWidget::updateView (this=0x21072e0)
    at /usr/src/debug/kdepim-4.4.2/kontact/plugins/specialdates/sdsummarywidget.cpp:219
#9  0x00007ff7e54c73d0 in SDSummaryWidget::qt_metacall (this=0x21072e0, _c=
    InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff20df82f0)
    at /usr/src/debug/kdepim-4.4.2/build/kontact/plugins/specialdates/sdsummarywidget.moc:79
#10 0x00007ff7fb43378f in QMetaObject::activate (sender=0x244d8f0, 
    m=<value optimized out>, local_signal_index=<value optimized out>, argv=
---Type <return> to continue, or q <return> to quit---
    0xffffffffffffffff) at kernel/qobject.cpp:3293
#11 0x00007ff7f74e630c in KCal::Calendar::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkcal.so.4
#12 0x00007ff7f74e6340 in KCal::CalendarResources::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkcal.so.4
#13 0x00007ff7fb43378f in QMetaObject::activate (sender=0x23d7e60, 
    m=<value optimized out>, local_signal_index=<value optimized out>, argv=
    0xffffffffffffffff) at kernel/qobject.cpp:3293
#14 0x00007ff7f74e55ef in KCal::ResourceCalendar::resourceChanged(KCal::ResourceCalendar*) () from /usr/lib64/libkcal.so.4
#15 0x00007ff7d712cc40 in ?? () from /usr/lib64/kde4/kcal_kabc.so
#16 0x00007ff7fb43378f in QMetaObject::activate (sender=0x2849770, 
    m=<value optimized out>, local_signal_index=<value optimized out>, argv=
    0xffffffffffffffff) at kernel/qobject.cpp:3293
#17 0x00007ff7f77e128f in KABC::AddressBook::addressBookChanged(KABC::AddressBook*) () from /usr/lib64/libkabc.so.4
#18 0x00007ff7f77e2163 in KABC::AddressBook::resourceLoadingFinished(KABC::Resource*) () from /usr/lib64/libkabc.so.4
#19 0x00007ff7f77f9563 in KABC::AddressBook::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkabc.so.4
#20 0x00007ff7fb43378f in QMetaObject::activate (sender=0x2850a00, 
    m=<value optimized out>, local_signal_index=<value optimized out>, argv=
    0xffffffffffffffff) at kernel/qobject.cpp:3293
#21 0x00007ff7f77e114f in KABC::Resource::loadingFinished(KABC::Resource*) ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib64/libkabc.so.4
#22 0x00007ff7d575332b in ?? () from /usr/lib64/kde4/kabc_akonadi.so
#23 0x00007ff7d576b5ce in ?? () from /usr/lib64/kde4/kabc_akonadi.so
#24 0x00007ff7d5757950 in ?? () from /usr/lib64/kde4/kabc_akonadi.so
#25 0x00007ff7fb43378f in QMetaObject::activate (sender=0x284f9d8, 
    m=<value optimized out>, local_signal_index=<value optimized out>, argv=
    0xffffffffffffffff) at kernel/qobject.cpp:3293
#26 0x00007ff7d5761347 in ?? () from /usr/lib64/kde4/kabc_akonadi.so
#27 0x00007ff7d5762c58 in ?? () from /usr/lib64/kde4/kabc_akonadi.so
#28 0x00007ff7d5763552 in ?? () from /usr/lib64/kde4/kabc_akonadi.so
#29 0x00007ff7fb43378f in QMetaObject::activate (sender=0x1f4f010, 
    m=<value optimized out>, local_signal_index=<value optimized out>, argv=
    0xffffffffffffffff) at kernel/qobject.cpp:3293
#30 0x00007ff7d5766fab in ?? () from /usr/lib64/kde4/kabc_akonadi.so
#31 0x00007ff7d5767065 in ?? () from /usr/lib64/kde4/kabc_akonadi.so
#32 0x00007ff7fb43378f in QMetaObject::activate (sender=0x2861710, 
    m=<value optimized out>, local_signal_index=<value optimized out>, argv=
    0xffffffffffffffff) at kernel/qobject.cpp:3293
#33 0x00007ff7fb7d8372 in KJob::result (this=0x22dd3f0, _t1=0x2861710)
    at /usr/src/debug/kdelibs-4.4.2/build/kdecore/kjob.moc:194
#34 0x00007ff7fb7e0a40 in KJob::emitResult (this=0x2861710)
    at /usr/src/debug/kdelibs-4.4.2/kdecore/jobs/kjob.cpp:312
#35 0x00007ff7fc24ec8e in ?? () from /usr/lib64/libakonadi-kde.so.4
#36 0x00007ff7fc2dd53c in ?? () from /usr/lib64/libakonadi-kde.so.4


Stopping akonadi before starting kontact doesn't help.

Problem can be reproduced 100%.
Comment 3 Norberto Bensa 2010-05-19 02:27:53 UTC
Hello,

I'm seeing this on three computers. All of them run Kubuntu Lucid (10.04) with kde 4.4.3 (from PPA)

Nothing more to add right now.

Regards,
Norberto
Comment 4 Nikos Alexandris 2010-05-25 11:14:34 UTC
Same here, summary is (kind of) freezing Kontact.

---
Kubuntu Lucid 64 bit on a MabBook Pro 5,1
Qt: 4.6.2
KDE Development Platform: 4.4.3 (KDE 4.4.3)
Plasma Workspace: 0.3
Kontact: 4.4.3
Comment 5 Ruben Salvador 2010-05-27 13:02:07 UTC
Same happens here, Debian Squeeze / KDE 4.4.3.

This workaround worked for me:
https://bugs.kde.org/show_bug.cgi?id=229534#c4

But, what I think is better. Once you get to open a working contact, configure summary view so that you disable all plugins within the summary view. It worked for me...and don't need to restart akonadictl (editing kontact_summaryrc file should do the trick also if you are not able to get a responsive kontact instance)
Comment 6 Ruben Salvador 2010-05-27 13:07:23 UTC
One more test...trying to trace it a little bit more

Activating "Special Dates" plugin in summary view hangs kontact on opening in summary view
Activating "Planner" plugin in summary view makes kontact not to open (process is created but application is not accessible from system tray...window is just not there, anywhere :S)

The rest of the plugins are now activated and kontact seem to work ok. Quitting and re-opening works, no hangs!
Comment 7 Christophe Giboudeaux 2010-06-06 17:00:48 UTC
@Allen: Couldn't this explain the bug 185544 ?

(In reply to comment #6)

> Activating "Special Dates" plugin in summary view hangs kontact on opening in
> summary view
> Activating "Planner" plugin in summary view makes kontact not to open (process
> is created but application is not accessible from system tray...window is just
> not there, anywhere :S)
>
Comment 8 Roman Fietze 2010-08-12 11:09:00 UTC
Cannot reproduce that using the latest 4.4 nor 4.5.0
Comment 9 Nikos Alexandris 2010-08-12 12:19:56 UTC
Works here (as well) :-)

Qt: 4.7.0
KDE Development Platform: 4.5.00 (KDE 4.5.0)
Plasma Workspace: 0.3
Comment 10 Martin Nebe 2013-06-07 06:09:42 UTC
Please reopen this bug because it has come back !

It behaves exactly like specified in comment 6, and it is all the time 100% reproducible on my two systems, which are:
- OpenSUSE 12.3 (KDE 4.10, Kontact  4.10, Kontact Summary 1.1,  Special Dates Summary 1.0)
- PC-BSD 9.1 (KDE 4.9.3, Kontact 4.9.3, Kontact Summary 1.1,  Special Dates Summary 1.0)

I have a (newbie?) theory regarding its relation to  bug 185544 mentioned in comment 7:
My guess is that the Special Dates Plugin starts a new instance of Kontact when it is going to query the calendars. When I am running Kontact from a terminal window on my OpenSUSE system I get a very long list containing the following type of messages:
kontact(2805) CalendarSupport::Calendar::Private::updateItem: Discarding duplicate incidence with uid  "7E7000E8-537B-48A9-9BE3-45BEA2AC7F7B" 
kontact(2805) CalendarSupport::Calendar::Private::updateItem: Discarding duplicate incidence with uid  "2AB58731-9AC2-47B9-A9BC-A151EF929754" 
kontact(2805) CalendarSupport::Calendar::Private::updateItem: Discarding duplicate incidence with uid  "6AC5D91C-D5A3-4DFB-96F4-F22276C32692"

I don't think these are true duplicates. Perhaps the query result contains each uid twice because a second instance containing a copy of the same information has been started by the Special Dates Summary plugin.

Fiddling a little more with the choices in the Special Dates Summary pane I have seen that by unchecking either all events boxes OR all contacts boxes Kontact will not hang anymore (but it will still generate the duplicates messages I just mentioned).
Comment 11 Martin Nebe 2013-06-07 22:40:25 UTC
I have now dug deeper into this bug and even been able to solve it on my systems: It turns out that I actually did have some calendar entries using the same Remote Id. By eliminating them all problems disappear completely!

But there are still some fishy things in all this. The uid seen in my Comment 10 above are not among the Remote Id I had to delete; they are not even from the same calendar as the bad ones.

How did I find the true culprits then?

After I had created above Comment 10 I came to think of the akonadiconsole tool. By sorting on the remote Id field under the Browser tab I was able to identify repeated values quite quickly. All of them were located in two Google calendar resources. One belonging to me and the other to a friend (who had given me read-only access).

The akonadiconsole tool let me remove the bad entries from my own calendar only, so for my friends calendar I had to go into the calender properties and disable it. The origin of those remote ID that were duplicated or even triplicated is probably that I have been creating events in a way not foreseen by the developers...
Comment 12 Roman Fietze 2013-06-10 18:33:48 UTC
Reopened as requested by Martin Nebe.
Comment 13 Martin Nebe 2013-06-12 06:24:05 UTC
After another day of intense testing I have some more information about this bug:
- Events that do not have a DTSTART entry, i.e. no starttime, will always cause Kontact to hang if the Plugin Name 'Calendar' has it's check box marked in the Summary Selection pane, no matter what choices one makes in the Upcoming Events Summary Setup pane. (I don't know how, but my friends Google calendar had three such entries, even though they did show start times in the Google web GUI. All of them were recurrent tasks.)
- The Upcoming Special Dates will cause Kontact to hang for the same reason, but only if both 'Show birthdays' check boxes are marked in the Upcoming Special Dates Summary Setup pane. (There is one such check box under 'Show these Special Dates From Your Calendar', and another one under 'Show these Special Dates From Your Contact List'.)
- My theory in Comment 10 was to simple, and therefore I have to rephrase it substantially to something like the following: Plugin summaries that query corrupted calenders can cause Kontact to hang when they e.g. encounter an event that do not have a start time or whose Remote Id is not unique in Akonadi.
- The processor load gets close to 100% when this occurs so I guess the query gets stuck in a rather tight loop, sometimes causing my whole system to freeze!
- So the most straight forward approach to palliate this problem is perhaps to add some code that replaces the hanging with an error message showing the 'Raw Payload' of the corrupted event in addition to the associated Id, Remote Id and the calendar name.
Comment 14 Sergio Martins 2013-06-13 20:52:10 UTC
Can you attach a corrupted calendar that shows this issue ?
I tried removing DTSTART and it worked fine still.
Comment 15 Martin Nebe 2013-06-13 21:28:34 UTC
Created attachment 80505 [details]
Recurrent event without DTSTART tag
Comment 16 Sergio Martins 2013-06-13 23:29:48 UTC
Git commit bbaed3479a47e546a89f55fdb434ea1fdeb8dc68 by Sergio Martins.
Committed on 14/06/2013 at 01:24.
Pushed by smartins into branch 'master'.

Ignore events with invalid DTSTART.

Fixes kontact freezing for a couple of seconds.

M  +7    -0    akonadi/calendar/calendarbase.cpp

http://commits.kde.org/kdepimlibs/bbaed3479a47e546a89f55fdb434ea1fdeb8dc68
Comment 17 Martin Nebe 2013-06-13 23:29:51 UTC
Created attachment 80508 [details]
Not recurrent event without DTSTART tag

This event is actually not recurrent but still causes problems.
Comment 18 Sergio Martins 2013-06-13 23:30:22 UTC
This is fixed for me.
Please test 4.11 when you have a chance.
Comment 19 Sergio Martins 2013-06-15 00:40:42 UTC
Git commit 00274b331e3b76b78dda6f92b2e3d5d09ae219a5 by Sergio Martins.
Committed on 15/06/2013 at 02:36.
Pushed by smartins into branch 'master'.

Performance improvements for the summary view.

Don't call eventsForDate() 7 times, uses incidences() then
timesInInterval() for recurring ones, which is faster.

M  +71   -77   kontact/plugins/korganizer/apptsummarywidget.cpp
M  +98   -79   kontact/plugins/korganizer/summaryeventinfo.cpp
M  +2    -0    kontact/plugins/korganizer/summaryeventinfo.h

http://commits.kde.org/kdepim/00274b331e3b76b78dda6f92b2e3d5d09ae219a5
Comment 20 Sergio Martins 2013-08-13 00:03:20 UTC
Please retest
Comment 21 Martin Nebe 2013-08-22 01:34:57 UTC
Created attachment 81845 [details]
ICal test file to check for the presence of the bug.

With this ICal Calendar File (and without the bugfix introduced in 4.11) kontact hangs when starting in summary view or after switching to summary view.
Comment 22 Martin Nebe 2013-08-22 02:02:31 UTC
After struggling many hours with installing KDEPIM 4.11 on my openSUSE 12.3 I finally completed the retest today by using the attached ICal test file.

I am very happy with the result: No matter how I configured the summary view it would not cause Kontact to hang or crash.

Therefore I confirm hereby that (at least from my point of view) the bug has been fixed with this release!

Thank you very much for finally having solved this problem.