Subject: | Segmentation fault |
When trying to connect to a bus (system/session) when the corresponding
daemon is not present ; result's in a segfault because _open tries to
ref a non existent connection.
dbus_connection_open returns NULL; croak is correct but
dbus_connection_ref should be done when conn != NULL
Attached patch file solves the problem.
libdbus was built without assert (--disable-assert)
Subject: | DBus.xs.patch |
--- DBus.xs.org 2006-11-05 22:47:57.000000000 +0100
+++ DBus.xs 2007-02-07 11:23:48.000000000 +0100
@@ -464,10 +464,10 @@
CODE:
dbus_error_init(&error);
con = dbus_connection_open(address, &error);
- dbus_connection_ref(con);
if (!con) {
_croak_error (&error);
}
+ dbus_connection_ref(con);
RETVAL = con;
OUTPUT:
RETVAL
@@ -826,10 +826,10 @@
CODE:
dbus_error_init(&error);
con = dbus_bus_get(type, &error);
- dbus_connection_ref(con);
if (!con) {
_croak_error(&error);
}
+ dbus_connection_ref(con);
RETVAL = con;
OUTPUT:
RETVAL