Bug 305024 - Crash in ResourceWatcher - DBusPendingCall
Summary: Crash in ResourceWatcher - DBusPendingCall
Status: RESOLVED FIXED
Alias: None
Product: nepomuk
Classification: Unmaintained
Component: libnepomukcore (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Nepomuk Bugs Coordination
URL:
Keywords:
: 311526 313089 314538 314700 314820 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-08-12 14:28 UTC by Hrvoje Senjan
Modified: 2013-03-28 21:14 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hrvoje Senjan 2012-08-12 14:28:33 UTC
Application: kactivitymanagerd (3.0)
KDE Platform Version: 4.9.00 "release 1" (Compiled from sources)
Qt Version: 4.8.2
Operating System: Linux 3.4.6-1.1-desktop x86_64
Distribution: "openSUSE 12.2 (x86_64)"

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

... all of the sudden. Doing nothing much. Restarting kactivitymanagerd brought back abilty to change activities, but it crashed again after some time.
Got this in .xsession-errors:

Object::connect: No such signal OrgKdeActivityManagerActivitiesInterface::presenceChanged(bool)
This is the current thread id for Activities 140486406407936 QThread(0x96c140) 
process 29487: arguments to dbus_pending_call_unref() were incorrect, assertion "pending != NULL" failed in file dbus-pending-call.c line 608.
This is normally a bug in some application using the D-Bus library.
  D-Bus not built with -rdynamic so unable to print a backtrace
KCrash: Attempting to start /usr/bin/kactivitymanagerd from kdeinit
KCrash: Application 'kactivitymanagerd' crashing...
KCrash: Attempting to start /usr/lib64/kde4/libexec/drkonqi from kdeinit
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
kactivitymanagerd(30582): Communication problem with  "kactivitymanagerd" , it probably crashed. 
Error message was:  "org.freedesktop.DBus.Error.NoReply" : " "Message did not receive a reply (timeout by message bus)" " 
Object::connect: No such signal OrgKdeActivityManagerActivitiesInterface::presenceChanged(bool)

Also:
These are the disabled plugins: ("activitymanager_plugin_dummy", "activitymanager_plugin_nepomuk") 
Loading library for: "activitymanager_plugin_globalshortcuts" 
Creating Factory: "activitymanager_plugin_globalshortcuts" 
Creating plugin: "activitymanager_plugin_globalshortcuts" 
Initializing plugin: "activitymanager_plugin_globalshortcuts" 
Loading library for: "activitymanager_plugin_slc" 
Creating Factory: "activitymanager_plugin_slc" 
Creating plugin: "activitymanager_plugin_slc" 
Initializing plugin: "activitymanager_plugin_slc" 
Loading library for: "activitymanager_plugin_virtualdesktopswitch" 
Creating Factory: "activitymanager_plugin_virtualdesktopswitch" 
Creating plugin: "activitymanager_plugin_virtualdesktopswitch" 
Initializing plugin: "activitymanager_plugin_virtualdesktopswitch" 
Loading library for: "activitymanager_plugin_activityranking" 
Creating Factory: "activitymanager_plugin_activityranking" 
Creating plugin: "activitymanager_plugin_activityranking" 
Initializing plugin: "activitymanager_plugin_activityranking" 
Loading library for: "activitymanager_plugin_sqlite" 
Creating Factory: "activitymanager_plugin_sqlite" 
Creating plugin: "activitymanager_plugin_sqlite" 
Initializing plugin: "activitymanager_plugin_sqlite" 
kactivitymanagerd(24263)/nepomuk (library) Nepomuk2::ResourceData::store: "createResource: Encountered invalid type URI." 
kactivitymanagerd(24263)/nepomuk (library) Nepomuk2::ResourceData::store: "createResource: Encountered invalid type URI." 
kactivitymanagerd(24263)/nepomuk (library) Nepomuk2::ResourceData::store: "createResource: Encountered invalid type URI." 
kactivitymanagerd(24263)/nepomuk (library) Nepomuk2::ResourceData::store: "createResource: Encountered invalid type URI." 
kactivitymanagerd(24263)/nepomuk (library) Nepomuk2::ResourceData::store: "createResource: Encountered invalid type URI." 
kactivitymanagerd(24263)/nepomuk (library) Nepomuk2::ResourceData::store: "createResource: Encountered invalid type URI." 
kactivitymanagerd(24263)/nepomuk (library) Nepomuk2::ResourceData::store: "createResource: Encountered invalid type URI." 
kactivitymanagerd(24263)/nepomuk (library) Nepomuk2::ResourceData::store: "createResource: Encountered invalid type URI." 
kactivitymanagerd(24263)/nepomuk (library) Nepomuk2::ResourceData::store: "createResource: Encountered invalid type URI." 
kactivitymanagerd(24263)/nepomuk (library) Nepomuk2::ResourceData::store: "createResource: Encountered invalid type URI." 

Using latest master,  dbus version:
zypper if libdbus-1-3
Information for package libdbus-1-3:
Repository: openSUSE-12.2-Oss
Name: libdbus-1-3
Version: 1.5.12-4.1.2
Arch: x86_64
Vendor: openSUSE
Installed: Yes
Status: up-to-date

The crash can be reproduced some of the time.

-- Backtrace:
Application: KDE Activity Manager (kactivitymanagerd), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fc59a2b4780 (LWP 29487))]

Thread 5 (Thread 0x7fc58afa0700 (LWP 29488)):
#0  0x00007fc5981bfe15 in pthread_mutex_lock () from /lib64/libpthread.so.0
#1  0x00007fc592d053a1 in g_mutex_lock () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fc592cc91f5 in g_main_context_check () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fc592cc9672 in ?? () from /usr/lib64/libglib-2.0.so.0
#4  0x00007fc592cc97f4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#5  0x00007fc59857c3f6 in QEventDispatcherGlib::processEvents (this=0x7fc5840008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#6  0x00007fc59854cebf in QEventLoop::processEvents (this=this@entry=0x7fc58af9fda0, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007fc59854d148 in QEventLoop::exec (this=0x7fc58af9fda0, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007fc598450ef0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#9  0x000000000040f335 in Thread::run (this=0x9004a0) at /usr/src/debug/kactivities-git/src/service/Application.cpp:72
#10 0x00007fc598453e8b in QThreadPrivate::start (arg=0x9004a0) at thread/qthread_unix.cpp:307
#11 0x00007fc5981bde0e in start_thread () from /lib64/libpthread.so.0
#12 0x00007fc596f362bd in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7fc58a598700 (LWP 29489)):
[KCrash Handler]
#6  0x00007fc596e86d25 in raise () from /lib64/libc.so.6
#7  0x00007fc596e881a8 in abort () from /lib64/libc.so.6
#8  0x00007fc5933b3175 in _dbus_abort () at dbus-sysdeps.c:94
#9  0x00007fc5933a9d15 in _dbus_warn_check_failed (format=0x7fc5933b9560 "arguments to %s() were incorrect, assertion \"%s\" failed in file %s line %d.\nThis is normally a bug in some application using the D-Bus library.\n") at dbus-internals.c:290
#10 0x00007fc598903f60 in q_dbus_pending_call_unref (pending=<optimized out>) at qdbus_symbols_p.h:321
#11 QDBusPendingCallPrivate::~QDBusPendingCallPrivate (this=0x7fc57c01e9a0, __in_chrg=<optimized out>) at qdbuspendingcall.cpp:137
#12 0x00007fc5989040d3 in ~QExplicitlySharedDataPointer (this=<optimized out>, __in_chrg=<optimized out>) at ../../src/corelib/tools/qshareddata.h:166
#13 QDBusPendingCall::~QDBusPendingCall (this=0x732f, __in_chrg=<optimized out>) at qdbuspendingcall.cpp:271
#14 0x00007fc598eb7fc6 in ~QDBusPendingReply (this=0x7fc58a597420, __in_chrg=<optimized out>) at /usr/include/QtDBus/qdbuspendingreply.h:115
#15 Nepomuk2::ResourceWatcher::stop (this=0x7fc57c00e4f0) at /usr/src/debug/nepomuk-core-git/libnepomukcore/datamanagement/resourcewatcher.cpp:144
#16 0x00007fc598ebabab in qt_static_metacall (_a=<optimized out>, _id=<optimized out>, _o=<optimized out>, _c=<optimized out>) at /usr/src/debug/nepomuk-core-git/build/libnepomukcore/resourcewatcher.moc:145
#17 Nepomuk2::ResourceWatcher::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /usr/src/debug/nepomuk-core-git/build/libnepomukcore/resourcewatcher.moc:109
#18 0x00007fc598562b4e in QObject::event (this=0x7fc57c00e4f0, e=<optimized out>) at kernel/qobject.cpp:1204
#19 0x00007fc5976dc69c in QApplicationPrivate::notify_helper (this=this@entry=0x799ef0, receiver=receiver@entry=0x7fc57c00e4f0, e=e@entry=0x7fc58400a2e0) at kernel/qapplication.cpp:4551
#20 0x00007fc5976e0b1a in QApplication::notify (this=0x758710, receiver=0x7fc57c00e4f0, e=0x7fc58400a2e0) at kernel/qapplication.cpp:4412
#21 0x00007fc5997f5ce6 in KApplication::notify (this=0x758710, receiver=0x7fc57c00e4f0, event=0x7fc58400a2e0) at /usr/src/debug/kdelibs-git/kdeui/kernel/kapplication.cpp:311
#22 0x00007fc59854e16e in QCoreApplication::notifyInternal (this=0x758710, receiver=receiver@entry=0x7fc57c00e4f0, event=event@entry=0x7fc58400a2e0) at kernel/qcoreapplication.cpp:915
#23 0x00007fc598551ad1 in sendEvent (event=0x7fc58400a2e0, receiver=0x7fc57c00e4f0) at kernel/qcoreapplication.h:231
#24 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x984b80) at kernel/qcoreapplication.cpp:1539
#25 0x00007fc59857c243 in sendPostedEvents () at kernel/qcoreapplication.h:236
#26 postEventSourceDispatch (s=0x7fc57c0012d0) at kernel/qeventdispatcher_glib.cpp:279
#27 0x00007fc592cc9405 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#28 0x00007fc592cc9738 in ?? () from /usr/lib64/libglib-2.0.so.0
#29 0x00007fc592cc97f4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#30 0x00007fc59857c3d6 in QEventDispatcherGlib::processEvents (this=0x7fc57c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#31 0x00007fc59854cebf in QEventLoop::processEvents (this=this@entry=0x7fc58a597da0, flags=...) at kernel/qeventloop.cpp:149
#32 0x00007fc59854d148 in QEventLoop::exec (this=0x7fc58a597da0, flags=...) at kernel/qeventloop.cpp:204
#33 0x00007fc598450ef0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#34 0x000000000040f6f5 in Thread::run (this=0x96c140) at /usr/src/debug/kactivities-git/src/service/Application.cpp:72
#35 0x00007fc598453e8b in QThreadPrivate::start (arg=0x96c140) at thread/qthread_unix.cpp:307
#36 0x00007fc5981bde0e in start_thread () from /lib64/libpthread.so.0
#37 0x00007fc596f362bd in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7fc589d97700 (LWP 29490)):
#0  0x00007fc5981c0d9f in __pthread_mutex_unlock_usercnt () from /lib64/libpthread.so.0
#1  0x00007fc592d053d1 in g_mutex_unlock () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fc592cc9685 in ?? () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fc592cc97f4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#4  0x00007fc59857c3f6 in QEventDispatcherGlib::processEvents (this=0x7fc5800008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#5  0x00007fc59854cebf in QEventLoop::processEvents (this=this@entry=0x7fc589d96da0, flags=...) at kernel/qeventloop.cpp:149
#6  0x00007fc59854d148 in QEventLoop::exec (this=0x7fc589d96da0, flags=...) at kernel/qeventloop.cpp:204
#7  0x00007fc598450ef0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#8  0x000000000040ef75 in Thread::run (this=0x968b20) at /usr/src/debug/kactivities-git/src/service/Application.cpp:72
#9  0x00007fc598453e8b in QThreadPrivate::start (arg=0x968b20) at thread/qthread_unix.cpp:307
#10 0x00007fc5981bde0e in start_thread () from /lib64/libpthread.so.0
#11 0x00007fc596f362bd in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7fc57bfff700 (LWP 29494)):
#0  0x00007fc596f2e13f in poll () from /lib64/libc.so.6
#1  0x00007fc592cc96d4 in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fc592cc97f4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fc59857c3f6 in QEventDispatcherGlib::processEvents (this=0x7fc5740008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007fc59854cebf in QEventLoop::processEvents (this=this@entry=0x7fc57bffee10, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007fc59854d148 in QEventLoop::exec (this=0x7fc57bffee10, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007fc598450ef0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007fc588b13a2a in ActivityRankingPlugin::Thread::run (this=<optimized out>) at /usr/src/debug/kactivities-git/src/service/plugins/activityranking/activityrankingplugin.cpp:52
#8  0x00007fc598453e8b in QThreadPrivate::start (arg=0x9d8650) at thread/qthread_unix.cpp:307
#9  0x00007fc5981bde0e in start_thread () from /lib64/libpthread.so.0
#10 0x00007fc596f362bd in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7fc59a2b4780 (LWP 29487)):
#0  0x00007fc5981c42ed in read () from /lib64/libpthread.so.0
#1  0x00007fc592d0475f in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fc592cc9259 in g_main_context_check () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fc592cc9672 in ?? () from /usr/lib64/libglib-2.0.so.0
#4  0x00007fc592cc97f4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#5  0x00007fc59857c3d6 in QEventDispatcherGlib::processEvents (this=0x7111d0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#6  0x00007fc59777c7fe in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#7  0x00007fc59854cebf in QEventLoop::processEvents (this=this@entry=0x7fff32e188d0, flags=...) at kernel/qeventloop.cpp:149
#8  0x00007fc59854d148 in QEventLoop::exec (this=0x7fff32e188d0, flags=...) at kernel/qeventloop.cpp:204
#9  0x00007fc598551de8 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#10 0x000000000040acb1 in main (argc=1, argv=0x7fff32e18b98) at /usr/src/debug/kactivities-git/src/service/Application.cpp:239

Reported using DrKonqi
Comment 1 Hrvoje Senjan 2012-08-13 15:04:49 UTC
(In reply to comment #0)
> Application: kactivitymanagerd (3.0)
> KDE Platform Version: 4.9.00 "release 1" (Compiled from sources)
> Qt Version: 4.8.2
> Operating System: Linux 3.4.6-1.1-desktop x86_64
> Distribution: "openSUSE 12.2 (x86_64)"
> 
> -- Information about the crash:
> - What I was doing when the application crashed:
> 
> ... all of the sudden. Doing nothing much. 

Not true. Happens every time i right click on a file in dolphin/konqueror (this also includes right clicking on a link in koqnueror).
Comment 2 Ivan Čukić 2012-12-15 11:12:14 UTC
The activity manager crashes when you click a link in konqueror?

As far as I can see in the backtrace, the crash is in libnepomuk2 (ResourceWatcher does it for some reason).
Comment 3 Hrvoje Senjan 2012-12-15 20:59:08 UTC
Nope, it crashed every time i right clicked a link/file/folder within dolphin and/or konqueror. I have in the meantime disabled activity linking service, and using s-l-c. Gonna re-enable the service and see is this still here.
Comment 4 Ivan Čukić 2013-01-11 19:29:54 UTC
*** Bug 313089 has been marked as a duplicate of this bug. ***
Comment 5 Ivan Čukić 2013-01-11 19:30:52 UTC
*** Bug 311526 has been marked as a duplicate of this bug. ***
Comment 6 Ivan Čukić 2013-01-11 19:31:47 UTC
The above linked crashes are not line-by-line identical, but all are regarding DBus and ResourceWatcher.
Comment 7 Simeon Bird 2013-03-06 00:57:42 UTC
*** Bug 314820 has been marked as a duplicate of this bug. ***
Comment 8 Simeon Bird 2013-03-06 00:58:38 UTC
*** Bug 314700 has been marked as a duplicate of this bug. ***
Comment 9 Simeon Bird 2013-03-08 16:08:10 UTC
*** Bug 314538 has been marked as a duplicate of this bug. ***
Comment 10 Simeon Bird 2013-03-15 03:03:28 UTC
Git commit cf6a1316df282c3c7e99d952e9fc351498d5f9a4 by Simeon Bird.
Committed on 12/03/2013 at 04:38.
Pushed by sbird into branch 'feature/resourcemanagercleanup'.

ResourceManager/ResourceWatcher: Make removeResource and addResource
happen in the ResourceWatcher thread via a QAutoConnection, avoiding
the thread unsafety of QDBusConnection and thus the crash.
Add convenience functions to the ResourceWatcher that start and stop it
if necessary, so that we don't have to jump back and forth between
threads.
FIXED-IN: 4.10.2

M  +16   -0    libnepomukcore/datamanagement/resourcewatcher.cpp
M  +20   -0    libnepomukcore/datamanagement/resourcewatcher.h
M  +4    -14   libnepomukcore/resource/resourcemanager.cpp

http://commits.kde.org/nepomuk-core/cf6a1316df282c3c7e99d952e9fc351498d5f9a4
Comment 11 Simeon Bird 2013-03-15 04:28:58 UTC
I can't reproduce the crash myself, so it would be great if someone who can could check that the feature/resourcemanagercleanup branch does. Ideally you should use the latest kde-workspace KDE/4.10 branch as well, due to an interaction with a (fixed in 4.10.2) plasma bug. 

Or the easy way is to just wait until 4.10.2 is released
Comment 12 Simeon Bird 2013-03-28 21:14:25 UTC
Git commit fa9c575e368d9d99e175e0e1392989e026c99913 by Simeon Bird.
Committed on 16/03/2013 at 21:27.
Pushed by sbird into branch 'KDE/4.10'.

Fix bad threading in ResourceManagerPrivate::addToWatcher dbus usage.

Instead of doing MoveToThread, take the resourceManager mutex before
talking to the ResourceWatcher. This is a lot clearer and less racy.
It should not be too contended now the rm mutex is not held over the
socket communication.
FIXED-IN: 4.10.3

M  +8    -0    libnepomukcore/resource/resourcedata.cpp
M  +15   -18   libnepomukcore/resource/resourcemanager.cpp

http://commits.kde.org/nepomuk-core/fa9c575e368d9d99e175e0e1392989e026c99913