Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#63337 - [dbus-c++] assert fail when copying data from received message

Attached to Project: Arch Linux
Opened by Théo Goudout (Theobalt) - Thursday, 01 August 2019, 09:02 GMT
Last edited by freswa (frederik) - Saturday, 22 February 2020, 20:53 GMT
Task Type Bug Report
Category Upstream Bugs
Status Assigned
Assigned To David Runge (dvzrv)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No



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.

When recompiling libdbus with checks, the following assert message is printed:

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 coming from a wrong parameter in 'dbus_message_iter_open_container' call in file 'message.cpp:349'. The type is supposed to be NULL when reading a DBUS_TYPE_STRUCT or a DBUS_TYPE_DICT_ENTRY. Currently, it's NULL for DBUS_TYPE_VARIANT.

/!\ The problem will not show if libdbus is not recompiled and reading a struct of a dict_entry. /!\

I've attached a patch that fixes it. In my opinion, the libdbus-c++ project is not really active and the patch should be added to the package.

Additional info:
* package version(s) : 0.9.0-8
* link to upstream bug report :

Steps to reproduce:

1. Recompile libdbus without '--disable-checks' and '--disable-asserts' parameters.
3. Compile test.cpp : g++ test.cpp -o test $(pkg-config dbus-c++-1 --cflags --libs)
2. Run test program : ./test
This task depends upon

Comment by David Runge (dvzrv) - Thursday, 11 June 2020, 10:53 GMT
@Theobalt: Thanks for the report!

I will look into this as time permits.
Thanks for providing a patch!