[Interest] [BUG] QDBusAbstractInterface::disconnectNotify

Wolfgang Rohdewald wolfgang at rohdewald.de
Tue Feb 5 23:11:10 CET 2013


all current sources from master branches (qt, kde)

in kde, I am running
kdesrc/build/kde/kdepim-runtime/resources$ ctest -V -V -R maildir-synctest
which makes the binary synctest coredump deep in Qt. See backtrace below.

I have been looking at the Qt source code and now I have a suspicion.

void QDBusAbstractInterface::disconnectNotify(const char *signal)
{
    // someone disconnecting from one of our signals

So this expects signal to be != 0, I assume. This matches the actual code
which dereferences signal.

OTOH in QObject::disconnect(), the signal argument may be 0 which
means "all signals" according to http://doc.qt.digia.com/qt/qobject.html#disconnect

And QObject::disconnect() does call QDBusAbstractInterface::disconnectNotify()
with signal=0, see qobject.cpp line 2928:

    if (res)
        const_cast<QObject*>(sender)->disconnectNotify(signal ? (signal - 1) : 0);


So - to me it seems that QDBusAbstractInterface should handle signal=0
instead of segfaulting.

Here comes the relevant part of the backtrace:

4  0x00007f0f16757dec in qFatal (msg=0x7f0f18610348 "Received signal %d") at /home/wr/kdesrc/qt/src/corelib/global/qglobal.cpp:2552
#5  0x00007f0f185fa773 in QTest::FatalSignalHandler::signal (signum=11) at /home/wr/kdesrc/qt/src/testlib/qtestcase.cpp:1729
#6  <signal handler called>
#7  0x00007f0f16768296 in QByteArray::QByteArray (this=0x7fff4b73d290, str=0x1 <Address 0x1 out of bounds>)
    at /home/wr/kdesrc/qt/src/corelib/tools/qbytearray.cpp:1298
#8  0x00007f0f164472a6 in QDBusConnectionPrivate::prepareHook (hook=..., key=..., service=..., path=..., interface=..., name=..., 
    argMatch=..., receiver=0x2439720, signal=0x0, minMIdx=5, buildSignature=true) at /home/wr/kdesrc/qt/src/dbus/qdbusintegrator.cpp:1267
#9  0x00007f0f1644e922 in QDBusConnectionPrivate::disconnectRelay (this=0x23fe520, service=..., path=..., interface=..., 
    receiver=0x2439720, signal=0x0) at /home/wr/kdesrc/qt/src/dbus/qdbusintegrator.cpp:2303
#10 0x00007f0f16460036 in QDBusAbstractInterface::disconnectNotify (this=0x2439720, signal=0x0)
    at /home/wr/kdesrc/qt/src/dbus/qdbusabstractinterface.cpp:613
#11 0x00007f0f168be0d3 in QObject::disconnect (sender=0x2439720, signal=0x0, receiver=0x7fff4b73e2f0, method=0x0)
    at /home/wr/kdesrc/qt/src/corelib/kernel/qobject.cpp:2928
#12 0x00007f0f16e7eaf0 in slotSignalEmitted (this=<optimized out>) at /home/wr/kdesrc/kde/kdelibs/kdecore/util/qtest_kde.cpp:44
#13 qt_static_metacall (_id=<optimized out>, _o=<optimized out>, _c=<optimized out>, _a=<optimized out>)
    at /home/wr/kdesrc/build/kde/kdelibs/kdecore/qtest_kde.moc:47


-- 
Wolfgang



More information about the Interest mailing list