Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-29498

QDBusAbstractInterface::disconnectNotify does not handle signal=0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.1.0 Beta 1, 5.1.0
    • 4.8.x
    • D-Bus
    • None
    • kubuntu 12.10, KDE master built from source
    • 6c48b9ad87e6b4d6fade23a2046d7d474dad5a66 d2a98df9bcb113d9ef8ea0e7c1472875372706c7 537679cb1231d63825f839df9332701d2af35de1

    Description

      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);
      

      This is 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
      

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

      Attachments

        For Gerrit Dashboard: QTBUG-29498
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            wrohdewald Wolfgang Rohdewald
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes