Bug 305584

Summary: Calendar resource does not handle Akonadi::PayloadException
Product: [Frameworks and Libraries] Akonadi Reporter: Loïc Grobol <loic.grobol>
Component: Google ResourceAssignee: Daniel Vrátil <dvratil>
Status: RESOLVED FIXED    
Severity: crash CC: inbrick, joern-schumacher, kde, kdebug, kdepim-bugs, loic.grobol, shafff, Vojtech.Zeisek
Priority: NOR    
Version: 4.9   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 4.9.3
Attachments: New crash information added by DrKonqi

Description Loïc Grobol 2012-08-22 09:44:24 UTC
Application: akonadi_googlecalendar_resource (4.9)
KDE Platform Version: 4.9.00
Qt Version: 4.8.1
Operating System: Linux 3.2.0-30-generic x86_64
Distribution: Ubuntu 12.04.1 LTS

-- Information about the crash:
- What I was doing when the application crashed:
Right after logging in, the Crash Reporting Assistant showed up, telling me that the ressource had crashed. But everything seems to be working fine, and KMail and Calendar had no problem using the Google ressources.

-- Backtrace:
Application: Google Calendars and Tasks (akonadi_googlecalendar_resource), signal: Aborted
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[KCrash Handler]
#6  0x00007fe80467e445 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x00007fe804681bab in __GI_abort () at abort.c:91
#8  0x00007fe804cd269d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x00007fe804cd0846 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00007fe804cd0873 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#11 0x00007fe804cd09b6 in __cxa_rethrow () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#12 0x00007fe806d9e16c in QEventLoop::exec (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:218
#13 0x00007fe806da2f67 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#14 0x00007fe807511576 in Akonadi::ResourceBase::init(Akonadi::ResourceBase*) () from /usr/lib/libakonadi-kde.so.4
#15 0x0000000000416606 in int Akonadi::ResourceBase::init<CalendarResource>(int, char**) ()
#16 0x00007fe80466976d in __libc_start_main (main=0x40da00, argc=3, ubp_av=0x7fffa2a65b28, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffa2a65b18) at libc-start.c:226
#17 0x000000000040da31 in _start ()

Possible duplicates by query: bug 305530, bug 305122, bug 304756, bug 304424, bug 303616.

Reported using DrKonqi
Comment 1 Daniel Vrátil 2012-08-22 09:54:59 UTC
Could you check your $HOME/.xsession-errors if there are any information about the crash?

You can search for line similar to "KCrash: Application 'akonadi_googlecalendar_resource' crashing...", which will be followed by information about unhandled exception. It would really help me to track down what exactly happened.
Comment 2 Loïc Grobol 2012-08-22 10:08:35 UTC
Here's what seem to be relevant (it was after 

terminate called after throwing an instance of 'Akonadi::PayloadException'
  what():  Akonadi::PayloadException: No payload set
KCrash: Application 'akonadi_googlecalendar_resource' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x3e00022
ProcessControl: Application '/usr/bin/akonadi_googlecalendar_resource' returned with exit code 253 (Unknown error)
"/usr/bin/akonadi_googlecalendar_resource" crashed too often and will not be restarted! 
kontact(3116)/kdeui (KWindowInfo) KWindowInfo::state: Pass NET::WMState to KWindowInfo
Comment 3 Myriam Schweingruber 2012-08-25 14:38:02 UTC
Also, installing debugging symbols for Akonadi would be a good idea, you apparently don't have them installed. See also http://techbase.kde.org/Development/Tutorials/Debugging/How_to_create_useful_crash_reports
Comment 4 Loïc Grobol 2012-08-25 15:15:41 UTC
Created attachment 73465 [details]
New crash information added by DrKonqi

akonadi_googlecalendar_resource (4.9) on KDE Platform 4.9.00 using Qt 4.8.1

- What I was doing when the application crashed: Now with the backtrace with akonadi-dbg and kdepimlibs-dbg.

-- Backtrace (Reduced):
#6  0x00007f5836fae445 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x00007f5836fb1bab in __GI_abort () at abort.c:91
[...]
#12 0x00007f58396ce16c in QEventLoop::exec (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:218
#13 0x00007f58396d2f67 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#14 0x00007f5839e41576 in Akonadi::ResourceBase::init (r=0x1119460) at ../../akonadi/resourcebase.cpp:451
Comment 5 Myriam Schweingruber 2012-08-27 22:37:45 UTC
Thank you for the fast feedback.
Comment 6 Myriam Schweingruber 2012-09-06 21:28:27 UTC
*** Bug 306218 has been marked as a duplicate of this bug. ***
Comment 7 Myriam Schweingruber 2012-09-06 21:29:01 UTC
Confirmed by duplicates
Comment 8 Daniel Vrátil 2012-09-25 15:28:04 UTC
*** Bug 307378 has been marked as a duplicate of this bug. ***
Comment 9 Daniel Vrátil 2012-10-22 12:59:19 UTC
*** Bug 308801 has been marked as a duplicate of this bug. ***
Comment 10 Daniel Vrátil 2012-10-22 13:09:44 UTC
Git commit a81eb36d7db664dc7615addf0cd28fb6e0cb663a by Dan Vrátil.
Committed on 22/10/2012 at 14:54.
Pushed by dvratil into branch 'KDE/4.9'.

Verify payload type before calling Akonadi::Item::payload()

Apparently Akonadi sometimes sends us Item with an invalid
or empty payload, so direct access to it throws PayloadException.

The only place where we can't use hasPayload() is in itemRemoved()
since removed items don't have payload.
FIXED-IN: 4.9.3

M  +4    -4    resources/google/calendar/calendarresource.cpp
M  +5    -0    resources/google/calendar/resource_tasks.cpp

http://commits.kde.org/kdepim-runtime/a81eb36d7db664dc7615addf0cd28fb6e0cb663a
Comment 11 Daniel Vrátil 2012-10-24 14:12:06 UTC
*** Bug 308929 has been marked as a duplicate of this bug. ***
Comment 12 Daniel Vrátil 2012-11-22 15:28:21 UTC
*** Bug 310213 has been marked as a duplicate of this bug. ***