Bug 323586

Summary: nepomuk_tag_resource crashes when switching from offline to online mode
Product: [Frameworks and Libraries] Akonadi Reporter: info
Component: Tag ResourceAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED INTENTIONAL    
Severity: crash CC: dns_hmpf, dvratil, martin.ruessler, montel, vkrause
Priority: NOR Keywords: drkonqi
Version: 4.11   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
gdb session

Description info 2013-08-16 09:59:40 UTC
Application: akonadi_nepomuktag_resource (4.11)
KDE Platform Version: 4.11.00
Qt Version: 4.8.4
Operating System: Linux 3.8.0-29-generic x86_64
Distribution: Ubuntu 13.04

-- Information about the crash:
- What I was doing when the application crashed:
Starting Kubuntu after updating KDE to 4.11.0

- Unusual behavior I noticed:
Mail notification agent seems to work again. Kontact is very slow and needs about 2-3 minutes to load a mail

The crash can be reproduced every time.

-- Backtrace:
Application: Stichwörter vom Typ Nepomuk-Stichwörter (Virtuelle Ordner) (akonadi_nepomuktag_resource), signal: Aborted
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[KCrash Handler]
#6  0x00007fcc5b2d6037 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#7  0x00007fcc5b2d9698 in __GI_abort () at abort.c:90
#8  0x00007fcc5b8dde8d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x00007fcc5b8dbf76 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00007fcc5b8dbfa3 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#11 0x00007fcc5b8dc226 in __cxa_rethrow () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#12 0x00007fcc5c2dd884 in QEventLoop::exec (this=this@entry=0x7fff363673a0, flags=...) at kernel/qeventloop.cpp:218
#13 0x00007fcc5c2e2cf6 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#14 0x00007fcc58d34ffc in QApplication::exec () at kernel/qapplication.cpp:3828
#15 0x00007fcc5c78f163 in Akonadi::ResourceBase::init (r=r@entry=0x20f7380) at ../../akonadi/resourcebase.cpp:548
#16 0x000000000040d3b3 in Akonadi::ResourceBase::init<NepomukTagResource> (argc=<optimized out>, argv=<optimized out>) at /usr/include/akonadi/resourcebase.h:192
#17 0x00007fcc5b2c0ea5 in __libc_start_main (main=0x405300 <main(int, char**)>, argc=3, ubp_av=0x7fff36367538, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff36367528) at libc-start.c:260
#18 0x0000000000405331 in _start ()

Possible duplicates by query: bug 323544, bug 322782, bug 322594, bug 321981, bug 321758.

Reported using DrKonqi
Comment 1 Dirk Sarpe 2013-08-22 16:40:57 UTC
Created attachment 81858 [details]
New crash information added by DrKonqi

akonadi_nepomuktag_resource (4.11) on KDE Platform 4.11.00 using Qt 4.8.4

- What I was doing when the application crashed:

Toggle akonadi_nepomuktag_resource from offline to online in akonadiconsole results in a crash of this ressource. 

The task list of this ressource shows:
"The name org.freedesktop.Akonadi.Resource.akonadi_nepomuktag_resource was not provided by any .service files".

The ressource could only be toggled offline by restarting akonadi server and disbling the ressource during the initial ressource activation.

Note, I only had the tag ressource offline, because it was crashing on me.

-- Backtrace (Reduced):
#6  0x00007f95cbf08037 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#7  0x00007f95cbf0b698 in __GI_abort () at abort.c:90
#8  0x00007f95cc50fe8d in __gnu_cxx::__verbose_terminate_handler () at ../../../../src/libstdc++-v3/libsupc++/vterminate.cc:95
#9  0x00007f95cc50df76 in __cxxabiv1::__terminate (handler=<optimized out>) at ../../../../src/libstdc++-v3/libsupc++/eh_terminate.cc:40
#10 0x00007f95cc50dfa3 in std::terminate () at ../../../../src/libstdc++-v3/libsupc++/eh_terminate.cc:50
Comment 2 Daniel Vrátil 2013-08-22 17:45:17 UTC
It's terminating because of an uncaught exception.

Could you please attach gdb to the akonadi_nepomuktag_resource process, set breakpoint to "catch throw" and when the resource crashes, provide a full backtrace ("t a a bt")?
Comment 3 Dirk Sarpe 2013-08-22 18:59:31 UTC
(In reply to comment #2)
> Could you please attach gdb to the akonadi_nepomuktag_resource process, set
> breakpoint to "catch throw" and when the resource crashes, provide a full
> backtrace ("t a a bt")?

I am not exactly versed in gdb, but tried using the an interactive gdb session. Not sure if the point were the ressource crashed was caught.

Here is the backtrace:

(gdb) t a a bt

Thread 2 (Thread 0x7f9ff692d700 (LWP 3386)):
#0  0x00007fa00678b233 in select () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007fa0076b7132 in QProcessManager::run (this=0x7fa007a36540 <processManager()::processManager>) at io/qprocess_unix.cpp:245
#2  0x00007fa0075dbbec in QThreadPrivate::start (arg=0x7fa007a36540 <processManager()::processManager>) at thread/qthread_unix.cpp:338
#3  0x00007fa005880f8e in start_thread (arg=0x7f9ff692d700) at pthread_create.c:311
#4  0x00007fa006792e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 1 (Thread 0x7fa008b5d7c0 (LWP 3291)):
#0  0x00007fa0067863cd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007fa00211c1dc in g_main_context_poll (n_fds=5, fds=0x117f750, timeout=-1, context=0xbca0f0, priority=<optimized out>)
    at /build/buildd/glib2.0-2.36.0/./glib/gmain.c:3995
#2  g_main_context_iterate (context=context@entry=0xbca0f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /build/buildd/glib2.0-2.36.0/./glib/gmain.c:3696
#3  0x00007fa00211c304 in g_main_context_iteration (context=0xbca0f0, may_block=1) at /build/buildd/glib2.0-2.36.0/./glib/gmain.c:3762
#4  0x00007fa007707016 in QEventDispatcherGlib::processEvents (this=0xb94740, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#5  0x00007fa0041d613e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#6  0x00007fa0076d738f in QEventLoop::processEvents (this=this@entry=0x7fffc118cce0, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007fa0076d7618 in QEventLoop::exec (this=this@entry=0x7fffc118cce0, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007fa0076dccf6 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#9  0x00007fa00412effc in QApplication::exec () at kernel/qapplication.cpp:3828
#10 0x00007fa007b89163 in Akonadi::ResourceBase::init (r=r@entry=0xedfcd0) at ../../akonadi/resourcebase.cpp:548
#11 0x000000000040d3b3 in Akonadi::ResourceBase::init<NepomukTagResource> (argc=<optimized out>, argv=<optimized out>) at /usr/include/akonadi/resourcebase.h:192
#12 0x00007fa0066baea5 in __libc_start_main (main=0x405300 <main(int, char**)>, argc=3, ubp_av=0x7fffc118ce78, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffc118ce68) at libc-start.c:260
#13 0x0000000000405331 in _start ()
Comment 4 Dirk Sarpe 2013-08-22 19:32:08 UTC
It seems that by attaching gdb the ressource can not change the state anymore. After trying to toggle the ressource from offline to online nothing happens (the output in gdb is as above) and when trying to show the task list of the ressource I get:

"Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken."

Of course the pid of akonadi_nepomuktag_resource changes when it restarts after a crash, so I don't see how to lookup the pid, attach to it, catch throw and t a a bt in the interactive gdb session when akonadi starts up or one toggles the ressource. Is there an other way to get the needed information?
Comment 5 Daniel Vrátil 2013-08-22 19:41:07 UTC
Sure. 

You can get PID of a process either by looking to top, htop or by using utility "pidof":

gdb -p `pidof akonadi_nepomuktag_resource`
... (lots of output)
...
(now you get the interactive console, the process does not run during that)
> catch throw
> continue
(the process will now continue to run)
...
(now turn the resource online)
...
(now it crashes, you will get the interactive console again)
> t a a bt
(you get the backtrace here)
Comment 6 Dirk Sarpe 2013-08-22 21:28:40 UTC
Thanks! The complete gdb session comes as attachment (there is a gdb error when importing libstdcxx.v6.printers, probably an ubuntu bug), the backtrace is here as well:

(gdb) continue
Continuing.
Catchpoint 1 (exception thrown), __cxxabiv1::__cxa_throw (obj=0x2138b00, tinfo=0x7f2168b73670 <typeinfo for Akonadi::Exception>, dest=
    0x7f2168832e70 <Akonadi::Exception::~Exception()>) at ../../../../src/libstdc++-v3/libsupc++/eh_throw.cc:70
70      ../../../../src/libstdc++-v3/libsupc++/eh_throw.cc: Datei oder Verzeichnis nicht gefunden.
(gdb) t a a bt

Thread 2 (Thread 0x7f215761b700 (LWP 22947)):
#0  0x00007f2167479233 in select () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f21683a5132 in QProcessManager::run (this=0x7f2168724540 <processManager()::processManager>) at io/qprocess_unix.cpp:245
#2  0x00007f21682c9bec in QThreadPrivate::start (arg=0x7f2168724540 <processManager()::processManager>) at thread/qthread_unix.cpp:338
#3  0x00007f216656ef8e in start_thread (arg=0x7f215761b700) at pthread_create.c:311
#4  0x00007f2167480e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 1 (Thread 0x7f216984b7c0 (LWP 22856)):
#0  __cxxabiv1::__cxa_throw (obj=0x2138b00, tinfo=0x7f2168b73670 <typeinfo for Akonadi::Exception>, dest=0x7f2168832e70 <Akonadi::Exception::~Exception()>)
    at ../../../../src/libstdc++-v3/libsupc++/eh_throw.cc:70
#1  0x00007f216884a4bd in Akonadi::ProtocolHelper::entitySetToByteArray<Akonadi::Item> (_objects=..., command=...) at ../../akonadi/protocolhelper_p.h:152
#2  0x00007f216885d78d in sendCommand (asapCommand=0x7f216890cfdc "LINK", this=0x40f84c0) at ../../akonadi/linkjobimpl_p.h:64
#3  Akonadi::LinkJob::doStart (this=<optimized out>) at ../../akonadi/linkjob.cpp:49
#4  0x00007f216885c317 in Akonadi::JobPrivate::startQueued (this=<optimized out>) at ../../akonadi/job.cpp:165
#5  0x00007f2168894589 in Akonadi::SessionPrivate::startJob (this=this@entry=0x1aac540, job=job@entry=0x40f8490) at ../../akonadi/session.cpp:281
#6  0x00007f216889510f in Akonadi::SessionPrivate::doStartNext (this=0x1aac540) at ../../akonadi/session.cpp:270
#7  0x00007f21683e05be in QObject::event (this=0x1ac4830, e=<optimized out>) at kernel/qobject.cpp:1194
#8  0x00007f2164e1e8ec in QApplicationPrivate::notify_helper (this=this@entry=0x17bad70, receiver=receiver@entry=0x1ac4830, e=e@entry=0x1b695b0)
    at kernel/qapplication.cpp:4567
#9  0x00007f2164e2125b in QApplication::notify (this=this@entry=0x7fffe5528110, receiver=receiver@entry=0x1ac4830, e=e@entry=0x1b695b0) at kernel/qapplication.cpp:4428
#10 0x00007f2168da5916 in KApplication::notify (this=0x7fffe5528110, receiver=0x1ac4830, event=0x1b695b0) at ../../kdeui/kernel/kapplication.cpp:311
#11 0x00007f21683c663e in QCoreApplication::notifyInternal (this=0x7fffe5528110, receiver=receiver@entry=0x1ac4830, event=event@entry=0x1b695b0)
    at kernel/qcoreapplication.cpp:946
#12 0x00007f21683ca171 in sendEvent (event=0x1b695b0, receiver=0x1ac4830) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#13 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x1783e60) at kernel/qcoreapplication.cpp:1570
#14 0x00007f21683ca4a3 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1463
#15 0x00007f21683f4e83 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#16 postEventSourceDispatch (s=s@entry=0x17bab90) at kernel/qeventdispatcher_glib.cpp:279
#17 0x00007f2162e09f05 in g_main_dispatch (context=0x17bb0f0) at /build/buildd/glib2.0-2.36.0/./glib/gmain.c:3054
#18 g_main_context_dispatch (context=context@entry=0x17bb0f0) at /build/buildd/glib2.0-2.36.0/./glib/gmain.c:3630
#19 0x00007f2162e0a248 in g_main_context_iterate (context=context@entry=0x17bb0f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /build/buildd/glib2.0-2.36.0/./glib/gmain.c:3701
#20 0x00007f2162e0a304 in g_main_context_iteration (context=0x17bb0f0, may_block=1) at /build/buildd/glib2.0-2.36.0/./glib/gmain.c:3762
#21 0x00007f21683f5016 in QEventDispatcherGlib::processEvents (this=0x1785740, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#22 0x00007f2164ec413e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#23 0x00007f21683c538f in QEventLoop::processEvents (this=this@entry=0x7fffe5528090, flags=...) at kernel/qeventloop.cpp:149
#24 0x00007f21683c5618 in QEventLoop::exec (this=this@entry=0x7fffe5528090, flags=...) at kernel/qeventloop.cpp:204
#25 0x00007f21683cacf6 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#26 0x00007f2164e1cffc in QApplication::exec () at kernel/qapplication.cpp:3828
#27 0x00007f2168877163 in Akonadi::ResourceBase::init (r=r@entry=0x1ac5860) at ../../akonadi/resourcebase.cpp:548
#28 0x000000000040d3b3 in Akonadi::ResourceBase::init<NepomukTagResource> (argc=<optimized out>, argv=<optimized out>) at /usr/include/akonadi/resourcebase.h:192
#29 0x00007f21673a8ea5 in __libc_start_main (main=0x405300 <main(int, char**)>, argc=3, ubp_av=0x7fffe5528228, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffe5528218) at libc-start.c:260
---Type <return> to continue, or q <return> to quit---
Comment 7 Dirk Sarpe 2013-08-22 21:30:02 UTC
Created attachment 81863 [details]
gdb session
Comment 8 Daniel Vrátil 2013-08-23 12:30:15 UTC
Perfect! Thank you
Comment 9 Laurent Montel 2016-07-05 06:19:08 UTC
I close as nepomuk_tag_resource doesn't exist now