QDBusAbstractAdaptor blocking issue
-
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 --forkCould anyone tell my why QDBusAbstractAdaptor will block at instance creating stage?
Thanks
-
Can you throw a
qDebug()
in the constructor and see if it blocks before or aftersetAutoRelaySignals(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. -
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
-
One more thing, the issue is hard to reproduced.
Only one time found in our linux terminal.