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

send_with_reply_and_block in libdbus is not thread-safe

    XMLWordPrintable

Details

    • Task
    • Resolution: Out of scope
    • P2: Important
    • None
    • None
    • D-Bus
    • None

    Description

      According to https://bugs.freedesktop.org/show_bug.cgi?id=857 a call to send_with_reply_and_block is not thread-safe;
      This frequently causes lockups, crashes and result corruption as in the following testcase (code by Sebastian TrĂ¼g)

      class MyThread : public QThread
      {
      public:
          void run() {
              qDebug() << QDBusConnection::sessionBus().interface()->isServiceRegistered( "org.kde.NepomukStorage" );
          }
      };
      
      int main(int argc, char *argv[])
      {
         QApplication a( argc, argv );
      
         MyThread t1, t2;
         t1.start();
         t2.start();
         return a.exec();
      }
      

      Sometimes the two threads give different answers, sometimes there is a timeout (~25secs) between the first result and the second

      Mutexing the call in QDBusIntegrator.cpp solves the last issue; however, timeouts are still occasionally present.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              tmacieir Thiago Macieira (closed Nokia identity) (Inactive)
              wilderkde Jacopo De Simoi
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes