Closed VishalKosana closed 7 months ago
What version of the SDK is this? You are using non-multi threaded APIs and there are no resource locking on these. What are you doing on the callback for packet number 5.
-> 06:55:23 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/iotdevice/messages/events/MessageDirection=2&MessageType=1&SourceDeviceID=sensor&DestinationDeviceID= | PACKET_ID: 5 | PAYLOAD_LEN: 278
-> 06:55:23 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_LEAST_ONCE | TOPIC_NAME: devices/iotdevice2/messages/events/MessageDirection=2&MessageType=1&SourceDeviceID=sensor&DestinationDeviceID= | PACKET_ID: 6 | PAYLOAD_LEN: 278
Why are there two different devices? iotdevice
and iotdevice2
My apologies for the mistake in my typing. To clarify, it is a single IoT device (iotdevice2
) and my application is trying to send a D2C message to that particular IoT device. I am calling IoTHubDeviceClient_SendEventAsync only once for each message. However, I've noticed that two publish requests are being created simultaneously.
Can you try the previous release version?
https://github.com/Azure/azure-iot-sdk-c/releases/tag/LTS_08_2023
Also, could you please share some more details?
What is the platform you are running your application on? Linux? Which flavor? Application is running on Linux debian flavor.
How frequently are you calling IoTHubDeviceClient_SendEventAsync when the issue (crash) occurs? With a delay of ThreadAPI_Sleep(10), If I have multiple messages available.
For how long had your application been running when you experience the crash? How many messages were sent before the crash? The number of messages sent are not triggering this fault. It can happen even for the first message or 100th message.
How often have you observed this issue in your application? It is random in nature, but everytime it happens, I can see two MQTT publish requests are going. So maybe this is what triggering the issue.
Have you tried previous versions of the azure-iot-sdk-c? If yes, did you experience this crash as well? Yes, I faced the same issue with that also.
You will have to provide a sample that reproduces this issue.
We have tried reproducing this issue in house and were not able to. We will close this for now, but if you would like to follow up and provide a sample that reproduces the issue please feel free to reopen this GH issue. Thanks, Azure IoT SDK Team.
Hi, I am utilizing IoTHubDeviceClient_SendEventAsync to transmit messages to the Azure IoT Hub whenever a message is received from my sensor. However, I've observed instances where multiple message requests are generated for the same message. When this occurs, it often leads to segmentation fault errors. This issue doesn't occur consistently but tends to happen more frequently when multiple messages are received from the sensor simultaneously. Below are the logs:
When checked the gdb backtrace,
While checking the code, void IoTHubClientCore_LL_SendComplete() function:
Segmentation fault is happening every time at the line messageList->callback(result, messageList->context);
Requesting your help on same. Thanks