Reputation: 85
i am getting an dbus assertion and application crash randomly at the time of DBUS initialisation.
Below is my code code snippet to get dbus.
px_sess_ctxt->px_bus = dbus_g_bus_get (DBUS_BUS_SESSION, &ppx_error);
if (NULL == px_sess_ctxt->px_bus)
{
return ERROR_1;
}
px_bus_proxy = dbus_g_proxy_new_for_name (px_sess_ctxt->px_bus,
PROXY_NAME, PROXY_PATH,PROXY_INTERFACE_NAME);
if (NULL == px_bus_proxy)
{
return ERROR_2;
}
dbus_g_proxy_call (px_bus_proxy, "pingMethod", &ppx_error,
G_TYPE_STRING, svc_name,G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_UINT, &ui_ret, G_TYPE_INVALID);
Randomly i get segmentation cash followed by dbus_g_proxy_call() fail. below is the error i get when the proxy call fails.
process 1559: arguments to dbus_pending_call_steal_reply() were incorrect, assertion "pending->reply != NULL" failed in file dbus-pending-call.c line 715.
This is normally a bug in some application using the D-Bus library.
D-Bus not built with -rdynamic so unable to print a backtrace
Please let use know any issue faced in dbus-glib libs. This would be very much helpful.
Thanks
Upvotes: 0
Views: 548
Reputation: 5713
As you are finding, the dbus-glib client bindings to D-Bus are hard to use. They are deprecated and unmaintained, and it’s highly recommended that you do not use them.
See this question for discussion of alternative client bindings to use. If you are already using GLib in your project, then GDBus (part of GIO, which is part of GLib) is the obvious choice to use.
Upvotes: 1