【问题标题】:Assertion error in dbus-c++ , terminates processdbus-c++ 中的断言错误,终止进程
【发布时间】:2012-02-03 22:13:52
【问题描述】:

我正在使用 dbus-c++ 绑定为在 dbus 上公开的 connman 服务 API 创建一个代理。 connman的Service接口xml中找到的方法,如下所示:

<method name="GetProperties">
<arg type="a{sv}" direction="out"/>
</method>

使用“dbusxx-xml2cpp”实用程序自动生成的代理文件, 像这样创建了有问题的方法:

Line 1:    std::map< std::string, ::DBus::Variant > GetProperties()
Line 2:    {
Line 3:        ::DBus::CallMessage call;
Line 4:        call.member("GetProperties");
Line 5:        ::DBus::Message ret = invoke_method (call);
Line 6:        ::DBus::MessageIter ri = ret.reader();
Line 7:        std::map< std::string, ::DBus::Variant > argout;
Line 8:        ri >> argout;
Line 9:        return argout;
Line 10:    }

在第 8 行,我收到警告/错误, 在 x86 上运行带有 libdbus-c++-1-0 软件包的 Ubuntu 11.04 (0~20110310-1ubuntu1):

process 30342: arguments to dbus_message_iter_open_container() were incorrect, assertion "(type == DBUS_TYPE_STRUCT && contained_signature == NULL) || (type == DBUS_TYPE_DICT_ENTRY && contained_signature == NULL) || (type == DBUS_TYPE_VARIANT && contained_signature != NULL) || (type == DBUS_TYPE_ARRAY && contained_signature != NULL)" failed in file dbus-message.c line 2677.
This is normally a bug in some application using the D-Bus library.
process 30342: dbus message iterator looks uninitialized or corrupted

....还有更多......但是进程不会在此处终止/abort。

然而,在 meego 上,在基于 arm 的目标上运行, 在此断言错误之后进程终止

在基于arm的板上meego使用的包是: libdbus-c++-0.5.1-4.3.armv7hl.rpm
libdbus-c++-devel-0.5.1-4.3.armv7hl.rpm

请帮助解决此问题。 迭代器是否可以通过另一种方式插入 DICT 值 - (std::map ) 而不会引发这些断言错误?

任何帮助将不胜感激。

-罗伊·塞缪尔。

【问题讨论】:

    标签: c++ linux dbus


    【解决方案1】:

    这似乎是 dbus-c++ 库中的一个错误。更多信息可以在这里找到:

    http://sourceforge.net/tracker/?func=detail&aid=3151818&group_id=236997&atid=1101682

    我建议你:

    问候,

    大脚怪。

    【讨论】:

    • 感谢您的参考。我刚刚修复了这个错误以尊重这个 method 的规范
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-10
    • 1970-01-01
    • 2011-01-15
    • 1970-01-01
    • 1970-01-01
    • 2015-02-11
    • 2015-06-10
    相关资源
    最近更新 更多