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

Signals might be processed in wrong order in QtDBus

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.2.10, 6.5.2, 6.6.0
    • 5.15.2, 6.5.0
    • D-Bus
    • None
    • x86_64, Linux Ubuntu 18.04, g++ 8.4.0
    • All
    • 859ef0563 (dev), ff580c201 (6.5), 0a5edcc98 (tqtc/lts-6.2)
    • Foundation Sprint 81, Foundation Sprint 82

    Description

      Hi Qt-Team,

      I discovered a potential issue in QtDBus. When signals are sent via DBus and dispatching is still disabled on the receiver side, the signals are queued. Later, when QDBusConnectionPrivate::doDispatch is called and dispatching is enabled, first currently incoming messages are processed before queued messages are handled. This can lead to a reordering of incoming signals. Wouldn't it be better to first handle queued messages before processing incoming messages?

      Please find attached a small example program that demonstrates the issue. Since it depends on the timing of the application several runs might be needed before the issue occurs. Here are two example runs. In the first run everything is ok, in the second run the signals were processed in the wrong order:

       

      Received test signal 0.
      Received test signal 1.
      Received test signal 2.
      Received test signal 3.
      Received test signal 4.
      Received test signal 5.
      Received test signal 6.
      Received test signal 7.
      Received test signal 8.
      Received test signal 9.
      Received test signal 10.
      Received test signal 11.
      Received test signal 12.
      Received test signal 13.
      Received test signal 14.
      Received test signal 15.
      Received test signal 16.
      Received test signal 17.
      Received test signal 18.
      Received test signal 19.

      and

      Received test signal 6.
      Received test signal 7.
      Received test signal 8.
      Received test signal 9.
      Received test signal 10.
      Received test signal 11.
      Received test signal 12.
      Received test signal 13.
      Received test signal 14.
      Received test signal 15.
      Received test signal 16.
      Received test signal 17.
      Received test signal 18.
      Received test signal 19.
      Received test signal 0.
      Received test signal 1.
      Received test signal 2.
      Received test signal 3.
      Received test signal 4.
      Received test signal 5.

      Attachments

        1. Signals.cpp
          1 kB
        2. Signals.h
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ievgenii.meshcheriakov Ievgenii Meshcheriakov
            pascal.weisser Pascal Weisser
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes