espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.84k stars 7.32k forks source link

crash in mqtt transport close (IDFGH-13602) #14489

Open mmadela opened 2 months ago

mmadela commented 2 months ago

Answers checklist.

IDF version.

v5.2.2

Espressif SoC revision.

ESP32-S3

Operating System used.

Windows

How did you build your project?

Eclipse IDE

If you are using Windows, please specify command line type.

None

Development Kit.

Esp32-S3-DevKit-C

Power Supply used.

USB

What is the expected behavior?

it should close gracefully

What is the actual behavior?

panic

Steps to reproduce.

  1. disconnect temporarily WiFi AP the board is connected (as wifi station) and mqtt is running
  2. activate the AP again
  3. wait

occurrence: very seldom, I am dealing with the code for weeks and see for the 1st time

Debug Logs.

E (59350) transport_base: poll_read select error 113, errno = Software caused connection abort, fd = 51
E (59350) mqtt_client: esp_mqtt_handle_transport_read_error: transport_read() error: errno=0
E (59350) mqtt_client_cpp: Last error captured as transport's socket errno: 0x71
E (59350) mqtt_client: mqtt_process_receive: mqtt_message_receive() returned -2
Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x00000000  PS      : 0x00060830  A0      : 0x820d3604  A1      : 0x3fcde3c0
A2      : 0x3fcd6218  A3      : 0x3c1e739c  A4      : 0x00000000  A5      : 0x00060223
A6      : 0x00000001  A7      : 0x3fcc3448  A8      : 0x8213a2b0  A9      : 0x3fcde380
A10     : 0x00000000  A11     : 0x3c1e739c  A12     : 0x00000000  A13     : 0x00000000
A14     : 0x00000000  A15     : 0x3fcc349c  SAR     : 0x00000004  EXCCAUSE: 0x00000014
EXCVADDR: 0x00000000  LBEG    : 0x40056f5c  LEND    : 0x40056f72  LCOUNT  : 0xffffffff
0x40056f5c: __ssputs_r in ROM
0x40056f72: __ssputs_r in ROM

Backtrace: 0xfffffffd:0x3fcde3c0 0x420d3601:0x3fcde3e0 0x42072a83:0x3fcde400 0x4206d6c2:0x3fcde420 0x4206d6fb:0x3fcde440 0x4206f280:0x3fcde470 0x420081dd:0x3fcde490 0x42122136:0x3fcde4b0 0x4208eb7d:0x3fcde4d0 0x4213a72f:0x3fcde4f0 0x4204c9fb:0x3fcde510 0x4204d765:0x3fcde530 0x403844dd:0x3fcde560
0x420d3601: esp_pbuf_free at D:/itech/esp-idf/esp-idf-v5.2.2/components/esp_netif/lwip/netif/esp_pbuf_ref.c:36
0x42072a83: pbuf_free at D:/itech/esp-idf/esp-idf-v5.2.2/components/lwip/lwip/src/core/pbuf.c:768
0x4206d6c2: free_socket_free_elements at D:/itech/esp-idf/esp-idf-v5.2.2/components/lwip/lwip/src/api/sockets.c:583
0x4206d6fb: free_socket at D:/itech/esp-idf/esp-idf-v5.2.2/components/lwip/lwip/src/api/sockets.c:616
0x4206f280: lwip_close at D:/itech/esp-idf/esp-idf-v5.2.2/components/lwip/lwip/src/api/sockets.c:813
0x420081dd: esp_vfs_close at D:/itech/esp-idf/esp-idf-v5.2.2/components/vfs/vfs.c:549 (discriminator 4)
0x42122136: close at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp-elf/src/newlib/newlib/libc/syscalls/sysclose.c:9 (discriminator 1)
0x4208eb7d: base_close at D:/itech/esp-idf/esp-idf-v5.2.2/components/tcp_transport/transport_ssl.c:323
0x4213a72f: esp_transport_close at D:/itech/esp-idf/esp-idf-v5.2.2/components/tcp_transport/transport.c:172
0x4204c9fb: esp_mqtt_abort_connection at D:/itech/esp-idf/esp-idf-v5.2.2/components/mqtt/esp-mqtt/mqtt_client.c:825
0x4204d765: esp_mqtt_task at D:/itech/esp-idf/esp-idf-v5.2.2/components/mqtt/esp-mqtt/mqtt_client.c:1658
0x403844dd: vPortTaskWrapper at D:/itech/esp-idf/esp-idf-v5.2.2/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

More Information.

No response

Laxilef commented 1 month ago

Hi,

I see something similar: https://github.com/espressif/arduino-esp32/issues/10519#issuecomment-2438765277