Version: 4.3.5 (using KDE 4.0.5) Installed from: Fedora RPMs OS: Linux Reproduce steps. 1. Call QDBusConnection::connectToBus (address, name) 2. delete the connection 3. Call QDBusConnection::disconnectFromBus 4. crash Output: process 21469: Applications must not close shared connections - see dbus_connection_close() docs. This is a bug in the application. D-Bus not built with -rdynamic so unable to print a backtrace
Did you report the bug to Trolltech? For example, using qt-bugs@trolltech.com
#include <QtDBus/QDBusConnection> #include <QtCore/QCoreApplication> int main(int argc, char **argv) { QCoreApplication app(argc, argv); { QDBusConnection conn = QDBusConnection::connectToBus(QDBusConnection::SessionBus, "myconnection"); } QDBusConnection::disconnectFromBus("myconnection"); } No crash. If you have a testcase, please send to trolltech.
No. I will sent a mail to it. FYI: QDBusConnection::connectToBus (type, name) uses dbus_bus_get_private to create a private dbus connection (it works fine), but QDBusConnection::connectToBus (address, name) does not use dbus_connection_open_private to create a private connection. So calling disconnectFromBus will cause the crash. I think it's the reason of this bug.
The problem will happens, if connection is created by QDBusConnection::connectToBus (address, name).
Test Case: QDBusConnection *connection = new QDBusConnection (QDBusConnection::connectToBus (getenv ("DBUS_SESSION_BUS_ADDRESS"), "dbus")); delete connection; QDBusConnection::disconnectFromBus ("dbus");
Report to trolltech.