Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDBusAbstractAdaptor blocking issue

QDBusAbstractAdaptor blocking issue

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 430 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt New Comer
    wrote on last edited by
    #1

    Hello:

    I have write an Qt Application to test Qt Dbus.
    Writing a xml file for Dbus interface, named with PlatformAdaptor, working on server side.
    Then using qdbusxml2cpp to generate interface class "PlatformAdaptor" derived from QDBusAbstractAdaptor.

    In my application, when create instance of PlatformAdaptor, the Program blocked sometimes !!!

    The below is the generated source code.

    PlatformAdaptor::PlatformAdaptor(QObject *parent)
    : QDBusAbstractAdaptor(parent)
    {
    // constructor
    setAutoRelaySignals(true);
    }

    The dbus system and session worked normally.

    ps -ef | grep dbus

    S 198 2127 1 2744 892 0:0 09:29 00:00:00 /usr/bin/dbus-daemon --system
    S 0 2132 1 2844 1388 0:0 09:29 00:00:04 /usr/bin/dbus-session --session --print-pid=8 --print-address=9 --fork

    Could anyone tell my why QDBusAbstractAdaptor will block at instance creating stage?

    Thanks

    Axel SpoerlA 1 Reply Last reply
    0
    • Q Qt New Comer

      Hello:

      I have write an Qt Application to test Qt Dbus.
      Writing a xml file for Dbus interface, named with PlatformAdaptor, working on server side.
      Then using qdbusxml2cpp to generate interface class "PlatformAdaptor" derived from QDBusAbstractAdaptor.

      In my application, when create instance of PlatformAdaptor, the Program blocked sometimes !!!

      The below is the generated source code.

      PlatformAdaptor::PlatformAdaptor(QObject *parent)
      : QDBusAbstractAdaptor(parent)
      {
      // constructor
      setAutoRelaySignals(true);
      }

      The dbus system and session worked normally.

      ps -ef | grep dbus

      S 198 2127 1 2744 892 0:0 09:29 00:00:00 /usr/bin/dbus-daemon --system
      S 0 2132 1 2844 1388 0:0 09:29 00:00:04 /usr/bin/dbus-session --session --print-pid=8 --print-address=9 --fork

      Could anyone tell my why QDBusAbstractAdaptor will block at instance creating stage?

      Thanks

      Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      @Qt-New-Comer

      Can you throw a qDebug()in the constructor and see if it blocks before or after setAutoRelaySignals(true);?
      My suspicion, however, is that the constructor doesn't block.
      There's probably something wrong either in the XML, or in the code using the adapter.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        Qt New Comer
        wrote on last edited by
        #3

        Hello:

        The code snippets get from PlatformAdpater.cpp, which was generated by qdbusxml2cpp version 0.8
        I guess there is no error in the XML, otherwize the whole cpp file should not be generated.

        As the constructor is invoked firstly, the code using the adapter should not has error, they are not invoked before blocking.

        The implementation of QDBusAbstractAdaptor has been checked, via pages: https://codebrowser.dev/qt5/qtbase/src/dbus/qdbusabstractadaptor.cpp.html
        Some connection and invoke operations are found for constructor.

        Do these operations result in blocking ?

        Thanks

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          Qt New Comer
          wrote on last edited by
          #4

          One more thing, the issue is hard to reproduced.
          Only one time found in our linux terminal.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved