KDEDModule Patch crashes kded

Michael Jansen kde at michael-jansen.biz
Sun Oct 12 18:47:28 BST 2008


Hi David

The following patch crashes kded . I have no idea why. If we can't get this to 
work i think it would be a good idea to deprecate the direct registration of 
kded modules with dbus and encourage/require the registration using an 
adaptor.

I wonder how useful it is to have a dbus service unable to use signals.


diff --git a/kdecore/util/kdedmodule.cpp b/kdecore/util/kdedmodule.cpp
index ee8c745..9020cd9 100644
--- a/kdecore/util/kdedmodule.cpp
+++ b/kdecore/util/kdedmodule.cpp
@@ -48,10 +48,11 @@ void KDEDModule::setModuleName( const QString& name )
    QString realPath = d->moduleName = name;
    realPath.prepend("/modules/");
    // ExportSignals not used since it triggers a warning at this point
-   QDBusConnection::sessionBus().registerObject(
+   Q_ASSERT(QDBusConnection::sessionBus().registerObject(
            realPath,
            this,
-           QDBusConnection::ExportScriptableContents | 
QDBusConnection::ExportAdaptors);
+           // QDBusConnection::ExportScriptableSlots | 
QDBusConnection::ExportScriptableProperties | 
QDBusConnection::ExportAdaptors));
+           QDBusConnection::ExportScriptableContents | 
QDBusConnection::ExportAdaptors));
 }

The crash is always 

9  0x00007f1b0867e001 in dbus_message_new_signal () from /lib64/libdbus-1.so.3
#10 0x00007f1b0d792dab in QDBusMessagePrivate::toDBusMessage (message=<value 
optimized out>) at /local/build/kde/trunk/src/qt-
copy/src/dbus/qdbusmessage.cpp:132
#11 0x00007f1b0d789af9 in QDBusConnectionPrivate::relaySignal (this=0x620da0, 
obj=0x8299f0, mo=<value optimized out>, signalId=<value optimized out>, 
args=@0x7fff18c533d0)
    at /local/build/kde/trunk/src/qt-copy/src/dbus/qdbusintegrator.cpp:1093
#12 0x00007f1b0d7b7730 in QDBusConnectionPrivate::qt_metacall (this=0x620da0, 
_c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, 
_a=0x7fff18c53350)
    at .moc/release-shared/moc_qdbusconnection_p.cpp:91
#13 0x00007f1b0dd2f420 in QMetaObject::activate (sender=0x839eb0, 
from_signal_index=<value optimized out>, to_signal_index=6, 
argv=0xffffffffffffffff)
    at /local/build/kde/trunk/src/qt-copy/src/corelib/kernel/qobject.cpp:3025
#14 0x00007f1b0d7a1dd4 in QDBusAdaptorConnector::relaySignal (this=0x1285, 
_t1=0x8299f0, _t2=0x7f1b05d84820, _t3=6, _t4=@0x42)
    at /local/build/kde/trunk/src/qt-
copy/src/dbus/qdbusabstractadaptor.cpp:378
#15 0x00007f1b0d7a202a in QDBusAdaptorConnector::relay (this=0x839eb0, 
senderObj=<value optimized out>, lastSignalIdx=6, argv=0x7fff18c53540)
    at /local/build/kde/trunk/src/qt-
copy/src/dbus/qdbusabstractadaptor.cpp:307
#16 0x00007f1b0d7a2835 in QDBusAdaptorConnector::qt_metacall (this=0x839eb0, 
_c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fff18c53540)
    at /local/build/kde/trunk/src/qt-
copy/src/dbus/qdbusabstractadaptor.cpp:365
#17 0x00007f1b0dd2f420 in QMetaObject::activate (sender=0x8299f0, 
from_signal_index=<value optimized out>, to_signal_index=6, 
argv=0xffffffffffffffff)
    at /local/build/kde/trunk/src/qt-copy/src/corelib/kernel/qobject.cpp:3025
#18 0x00007f1b0fb11a32 in KDEDModule::windowUnregistered (this=0x1285, 
_t1=62914561) at 
/home/mjansen/build/kde/trunk/bld/kdelibs/kdecore/kdedmodule.moc:100
#19 0x00007f1b1082b4e3 in Kded::unregisterWindowId (this=<value optimized 
out>, windowId=62914561, sender=<value optimized out>) at 
/home/mjansen/build/kde/trunk/src/kdelibs/kded/kded.cpp:643
#20 0x00007f1b1083243f in KdedAdaptor::unregisterWindowId (this=<value 
optimized out>, windowId=62914561, msg=<value optimized out>)
    at /home/mjansen/build/kde/trunk/src/kdelibs/kded/kdedadaptor.cpp:63
#21 0x00007f1b10832673 in KdedAdaptor::qt_metacall (this=0x6295f0, 
_c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, 
_a=0x7fff18c53750)
    at /home/mjansen/build/kde/trunk/bld/kdelibs/kded/kdedadaptor.moc:93

and happens when starting/stopping kmail. probably because it uses this 
register/unregisterWindowId calls. The offending kded module is always 
powerdevil. 

Anyone an idea?

Mike

-- 
Michael Jansen

http://www.michael-jansen.biz




More information about the kde-core-devel mailing list