Skip to content

Segmentation fault when use GroupObject::value write string to bus. #332

Description

@killerlife

Hi,

I am try to use GroupObject::value write string to bus. My sample code are below:

#define GO_ZONE1_TITLE		knx.getGroupObject(49)
GO_ZONE1_TITLE.dataPointType(DPT_String_ASCII);
GO_ZONE1_TITLE.value(t.c_string());

It got segmentation fault when call GO_ZONE1_TITLE.value(t.c_string());

The following is backtrace from gdb:
(gdb) bt
#0 0x00000055557b56e8 in unsigned8ToPayload (payload=0x0, payload_length=37, index=0, value=228 '\344', mask=255 '\377') at /home/le/MRA/source/HS.PA/knx/knx/dptconvert.cpp:1909
#1 0x00000055557b3e38 in valueToBusValueString (value=..., payload=0x0, payload_length=37, datatype=...) at /home/le/MRA/source/HS.PA/knx/knx/dptconvert.cpp:1341
#2 0x00000055557b0dec in KNX_Encode_Value (value=..., payload=0x0, payload_length=37, datatype=...) at /home/le/MRA/source/HSr.PA/knx/knx/dptconvert.cpp:260
#3 0x00000055557b6e70 in GroupObject::valueNoSend (this=0x7fe4001c40, value=..., type=...) at /home/le/MRA/source/HS.PA/knx/knx/group_object.cpp:308
#4 0x00000055557b6c24 in GroupObject::value (this=0x7fe4001c40, value=..., type=...) at /home/le/MRA/source/HS.PA/knx/knx/group_object.cpp:247
#5 0x00000055557b6dc8 in GroupObject::value (this=0x7fe4001c40, value=...) at /home/le/MRA/source/HS.PA/knx/knx/group_object.cpp:290
#6 0x0000005555796b3c in Knx_Srv::SetZoneTitle (this=0x555659e230 <GetKnx_Srv()::gKnx_Srv>, zone=1 '\002', title="一無所有(是否我真的一無所有)") at /home/le/MRA/source/HS.PA/knx_srv.cpp:500`

It seems _data is a nullptr. I check the group_object.cpp, there is not memory alloc initalization code in the source. Maybe it's a bug.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions