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 David Runge (dvzrv) - Saturday, 02 September 2023, 14:39 GMT
Opened by Théo Goudout (Theobalt) - Thursday, 01 August 2019, 09:02 GMT
Last edited by David Runge (dvzrv) - Saturday, 02 September 2023, 14:39 GMT
|
Details
Description:
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 : https://sourceforge.net/p/dbus-cplusplus/patches/27/ 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
Closed by David Runge (dvzrv)
Saturday, 02 September 2023, 14:39 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed with dbus-c++ 0.9.0-11
Saturday, 02 September 2023, 14:39 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed with dbus-c++ 0.9.0-11
I will look into this as time permits.
Thanks for providing a patch!