Device going into Panic while publishing a message via MQTT in ESP32

Hello all, while I’m trying to publish and message via MQTT from an ESP32 to AWS the device is going into panic mode and restarting.

(64707) COAP_CLIENT: --------------END trayTable-------------
Jan 01 00:14:41 DEBG *** <-> UDP : session closed
64 6437 [MQTT Agent] [core_mqtt.c:886] [INFO] [MQTT] Packet received. ReceivedBytes=0.
65 6498 [thedemobridge] [mqtt_pub_sub.c:549] [INFO] [MQTTDemo] Generated MQTT PUBLISH payload len 12 for PUBLISH
66 6498 [thedemobridge] [mqtt_pub_sub.c:559] [INFO] [MQTTDemo] Sending publish request to agent with message on topic "publish/fild"

Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled.
Core  0 register dump:
PC      : 0x4000c291  PS      : 0x00060933  A0      : 0x8008f9f6  A1      : 0x3fff7480
A2      : 0x0000000a  A3      : 0x3fff7511  A4      : 0x00000004  A5      : 0x0000000a
A6      : 0x0000004c  A7      : 0x00000000  A8      : 0x8008f363  A9      : 0x3fff7450
A10     : 0x00000000  A11     : 0x3ffd0ffc  A12     : 0x00000004  A13     : 0x3fff74e4
A14     : 0x3ffd104c  A15     : 0x00000000  SAR     : 0x0000001f  EXCCAUSE: 0x0000001d
EXCVADDR: 0x0000000a  LBEG    : 0x4000c28c  LEND    : 0x4000c296  LCOUNT  : 0x00000003
Backtrace:0x4000c28e:0x3fff7480 0x4008f9f3:0x3fff7490 0x4008feb2:0x3fff74b0 0x400e9f7a:0x3fff74f0 0x400e99f6:0x3fff7510 0x400e9db1:0x3fff7550 0x400d4f2d:0x3fff7570 0x400d4fb6:0x3fff75d0 0x400d402f:0x3fff7a00
0x4008f9f3: prvCopyDataToQueue at /home/pcblr6004/AWS/aws_fild/fild/aws_fild/build/../freertos/freertos_kernel/queue.c:2156
0x4008feb2: xQueueGenericSend at /home/pcblr6004/AWS/aws_fild/fild/aws_fild/build/../freertos/freertos_kernel/queue.c:808
0x400e9f7a: Agent_MessageSend at /home/pcblr6004/AWS/aws_fild/fild/aws_fild/build/../freertos/libraries/abstractions/mqtt_agent/freertos_agent_message.c:54
0x400e99f6: addCommandToQueue at /home/pcblr6004/AWS/aws_fild/fild/aws_fild/build/../freertos/libraries/coreMQTT-Agent/source/core_mqtt_agent.c:520
 (inlined by) createAndAddCommand at /home/pcblr6004/AWS/aws_fild/fild/aws_fild/build/../freertos/libraries/coreMQTT-Agent/source/core_mqtt_agent.c:730
 (inlined by) createAndAddCommand at /home/pcblr6004/AWS/aws_fild/fild/aws_fild/build/../freertos/libraries/coreMQTT-Agent/source/core_mqtt_agent.c:702
0x400e9db1: MQTTAgent_Publish at /home/pcblr6004/AWS/aws_fild/fild/aws_fild/build/../freertos/libraries/coreMQTT-Agent/source/core_mqtt_agent.c:1192
0x400d4f2d: prvPublishPayload at /home/pcblr6004/AWS/aws_fild/fild/aws_fild/build/../src/mqtt_pub_sub.c:565
0x400d4fb6: testpublishpayload at /home/pcblr6004/AWS/aws_fild/fild/aws_fild/build/../src/mqtt_pub_sub.c:443

0x400d402f: thedemobridge at /home/pcblr6004/AWS/aws_fild/fild/aws_fild/build/../src/coap.c:180 (discriminator 13)
ELF file SHA256: 970a3eff68c372f7
ets Jun  8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
mode:DIO, clock div:1
0x40080400: _init at ??:?`Preformatted text`

This seems to be crashing while copying the data to the queue. Can you share the code to create the command queue? It should be something like this: FreeRTOS/mqtt-agent-task.c at main · FreeRTOS/FreeRTOS · GitHub

Where did you get this code?


I have resolved the issue thanks for the support.

Glad to hear that you resolved the issue. Would you please describe your solution for others benefit.