【问题标题】:DBUS dbus_pending_call_steal_reply assertionDBUS dbus_pending_call_steal_reply 断言
【发布时间】:2019-02-28 15:06:24
【问题描述】:

我在 DBUS 初始化时随机收到一个 dbus 断言和应用程序崩溃。

下面是我获取dbus的代码sn-p。

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 库中遇到的任何问题。这将非常有帮助。

谢谢

【问题讨论】:

  • pingMethod 方法是否真的返回了回复? dbus-monitor 显示为总线上的流量是什么?断言失败的回溯是什么? (在gdb下运行。)
  • 1.没有测试过 pingMethod 和 dbus-monitor。我会测试和更新。 2.尝试取core-dump并分析。最后一个函数 gdb coredump 点来自 dbus。之后没有堆栈跟踪。 (gdb) bt full #0 0x215082a4 in kill () from /lib/libc.so.0 #1 0x2152e852 in abort () from /lib/libc.so.0 #2 0x2015b646 in ?? () from /lib/libdbus-1.so.3.7.6 回溯停止:前一帧与本帧相同(损坏的堆栈?)

标签: embedded-linux glib dbus


【解决方案1】:

正如您所发现的,dbus-glib 客户端绑定到 D-Bus 很难使用。它们已被弃用且未维护,强烈建议您不要使用它们。

请参阅this question 以讨论要使用的替代客户端绑定。如果您已经在项目中使用 GLib,那么GDBus(GIO 的一部分,它是 GLib 的一部分)是显而易见的选择。

【讨论】:

  • 感谢您的信息。我正在使用遗留代码,我无法更改它(非常大的代码)。请让我知道调试 dbus-glib 的任何调试方式。
猜你喜欢
  • 2012-02-03
  • 2015-12-25
  • 2012-09-09
  • 1970-01-01
  • 2020-03-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-01-08
相关资源
最近更新 更多