You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all:
I tried to using devsdk_post_readings function to deliver some json message,but get a Segmentation fault (core dumped)
I debug into device-sdk-c source , The error occurs in bus.c at line 101 , during the 'edgex_bus_post' function building the message envelope and setting the 'correlationID' property , It seems that edgex_device_get_crlid () always return NULL.
i added some code to check if the edgex_device_get_crlid () returns null , and replace it with a uuid if empty ,problem solved, but I don't know if it will have any other impact.
i`m using a ubuntu22.04 docker container as the development environment. and device-csdk-c version 3.0.0
gdb debug message:
(gdb) bt
#0 0x00007f195a834a7c in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007f195a7e0476 in raise () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x00007f195a7c67f3 in abort () from /lib/x86_64-linux-gnu/libc.so.6 #3 0x00007f195a7c671b in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #4 0x00007f195a7d7e96 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #5 0x00007f195aaaad39 in iot_data_alloc_string (val=0x0, ownership=IOT_DATA_REF) at /workspace/src/device-sdk-c/src/iotech-c-utils/src/c/data.c:1403 #6 0x00007f195aadcd51 in edgex_bus_post (bus=0x558f66d108c0,
path=0x558f66d28310 "edgex/events/device/device-iec104-msater/lensyn-iec104-master/104_slave_1/JSON", payload=0x558f66d2e1c0)
at /workspace/src/device-sdk-c/src/c/bus.c:101 #7 0x00007f195aae3956 in edgex_data_client_add_event (client=0x558f66d108c0, ev=0x558f66d2d550, metrics=0x558f66d10510)
at /workspace/src/device-sdk-c/src/c/data.c:190 #8 0x00007f195ab014e7 in devsdk_post_readings (svc=0x558f66d10320, devname=0x558f6537b358 "104_slave_1", resname=0x558f6537b353 "JSON", values=0x7ffc3173adb0)
at /workspace/src/device-sdk-c/src/c/service.c:1057 #9 0x0000558f65362eba in main (argc=1, argv=0x7ffc3173af78) at /workspace/src/device-iec104-master.c:628
Has anyone had the same problem,Help me.
I have poor English , I don't know if it's clearly expressed, sorry。
The text was updated successfully, but these errors were encountered:
yes, that looks to be the problem. devsdk_post_readings() needs to call edgex_device_alloc_crlid (NULL) before pushing the event, and edgex_device_free_crlid () afterwards.
Hi all:
I tried to using devsdk_post_readings function to deliver some json message,but get a Segmentation fault (core dumped)
I debug into device-sdk-c source , The error occurs in bus.c at line 101 , during the 'edgex_bus_post' function building the message envelope and setting the 'correlationID' property , It seems that edgex_device_get_crlid () always return NULL.
i added some code to check if the edgex_device_get_crlid () returns null , and replace it with a uuid if empty ,problem solved, but I don't know if it will have any other impact.
i`m using a ubuntu22.04 docker container as the development environment. and device-csdk-c version 3.0.0
gdb debug message:
(gdb) bt
#0 0x00007f195a834a7c in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f195a7e0476 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007f195a7c67f3 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007f195a7c671b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007f195a7d7e96 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x00007f195aaaad39 in iot_data_alloc_string (val=0x0, ownership=IOT_DATA_REF) at /workspace/src/device-sdk-c/src/iotech-c-utils/src/c/data.c:1403
#6 0x00007f195aadcd51 in edgex_bus_post (bus=0x558f66d108c0,
path=0x558f66d28310 "edgex/events/device/device-iec104-msater/lensyn-iec104-master/104_slave_1/JSON", payload=0x558f66d2e1c0)
at /workspace/src/device-sdk-c/src/c/bus.c:101
#7 0x00007f195aae3956 in edgex_data_client_add_event (client=0x558f66d108c0, ev=0x558f66d2d550, metrics=0x558f66d10510)
at /workspace/src/device-sdk-c/src/c/data.c:190
#8 0x00007f195ab014e7 in devsdk_post_readings (svc=0x558f66d10320, devname=0x558f6537b358 "104_slave_1", resname=0x558f6537b353 "JSON", values=0x7ffc3173adb0)
at /workspace/src/device-sdk-c/src/c/service.c:1057
#9 0x0000558f65362eba in main (argc=1, argv=0x7ffc3173af78) at /workspace/src/device-iec104-master.c:628
Has anyone had the same problem,Help me.
I have poor English , I don't know if it's clearly expressed, sorry。
The text was updated successfully, but these errors were encountered: