I'm using a DBus method returning a Variant containing an object with signature a{sa{sv}}
. When reaching a Variant value, a seg fault signal is emitted.
After some investigating, I've realised that when compiling libdbus library with checks and asserts, there is an assert failing :
dbus[27636]: 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 2966. This is normally a bug in some application using the D-Bus library.
The problem comes from message.cpp:353
where the contained_signature is incorrect. From libdbus code, dbus-message.c:2919
:
For variants, the contained_signature should be the type of the single value inside the variant. For structs and dict entries, contained_signature should be #NULL; it will be set to whatever types you write into the struct. For arrays, contained_signature should be the type of the array elements.
Thus the following patch .
@andreas99 @shackan it would be great to merge this.
I'm packaging dbus-c++ on Arch Linux and for any downstream distribution it's of course always good to not carry many unmerged patches around.
Is this project still actively maintained by you?