me-no-dev / AsyncTCP

Async TCP Library for ESP32
GNU Lesser General Public License v3.0
750 stars 433 forks source link

Core 0 panic'ed (LoadProhibited) #150

Open Miraculix200 opened 2 years ago

Miraculix200 commented 2 years ago

Board: ESP32-S3-WROOM-1 Arduino-ESP32: v4.4.1-1-gb8050b365e

After a day or so of TCP requests (sending temperature and getting temperature as a response) every ~10 minutes I get a "Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled."

Backtrace:

Decoding stack results
0x4201a8c4: AsyncClient::_free_closed_slot() at y:\dev\arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp line 838
0x4201aab4: AsyncClient::_s_recv(void*, tcp_pcb*, pbuf*, signed char) at y:\dev\arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp line 1210
0x4201ab05: _tcp_recv(void*, tcp_pcb*, pbuf*, int8_t) at y:\dev\arduino\libraries\AsyncTCP-master\src\AsyncTCP.cpp line 279
0x42065c3d: tcp_input at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/tcp_in.c line 541
0x4206a2ea: ip4_input at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/ipv4/ip4.c line 829
0x4206deca: ethernet_input at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/netif/ethernet.c line 174
0x4205fd21: tcpip_thread at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/tcpip.c line 173

EXCVADDR: 0x00000000

So it tries to load something from address 0x0, I suppose. In this line: https://github.com/me-no-dev/AsyncTCP/blob/ca8ac5f919d02bea07b474531981ddbfd64de97c/src/AsyncTCP.cpp#L838

Maybe I'm doing something wrong (e.g. not ever ending the client object, and calling stop() when it's not necessary), but maybe the code could have some if (something != NULL)

(I'm not sure what happens here, maybe it isn't even a problem with the library, but some memory problem, so I didn't try to fix it. And I'm using the standard WiFi client for the temperatures for now, waiting if it will crash again after some more days)

Edit: A week later there was still no crash, when using the client from WiFiClient.h. Though I also created a new instance of the WiFiClient every time it's needed, instead of keeping one instance around forever like I did with AsyncClient. So it's not directly comparable.

stale[bot] commented 2 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.