在dbus初始化时,我得到一个DBUS断言和应用程序随机崩溃。
下面是我用来获取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);随机获得分段现金,然后是dbus_g_proxy_call()失败。下面是当代理调用失败时我得到的错误。
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请让用户知道在dbus-glib库中遇到的任何问题。这将非常有帮助。
谢谢
发布于 2019-03-01 22:23:42
正如您所发现的,dbus-glib客户端到D-Bus的绑定很难使用。它们已被弃用且未维护,强烈建议您不要使用它们。
有关要使用的替代客户端绑定的讨论,请参阅this question。如果您已经在项目中使用GLib,那么GDBus ( GIO的一部分,也是GLib的一部分)是显而易见的选择。
https://stackoverflow.com/questions/54928665
复制相似问题