Skip to content
This repository has been archived by the owner on Jan 21, 2025. It is now read-only.

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

[BUG]Crash with newer versions of ESP32 board package (Arduino IDE) #192

Closed
elaw01887 opened this issue Jan 12, 2025 · 3 comments
Closed
Labels

Comments

@elaw01887
Copy link

elaw01887 commented Jan 12, 2025

Are you folks aware that the library seems to have a crashing issue with newer versions of the ESP32 board package (> 3.0.7) and at least some of the newer ESP boards (I'm using the ESP32S3)?

It's discussed here: https://forum.arduino.cc/t/esp32-rebooting-loop-with-espasyncwebserver/1334275

Here's a snippet of my code:
` //ASYNC web server stuff:
ws.onEvent(onAsycnWSEvent); //onAsycnWSEvent is in WebServerStuff.ino
server.addHandler(&ws);

// Web Server Root URL
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
    request->send(LittleFS, "/index.html", "text/html");
});

server.serveStatic("/", LittleFS, "/");

// Start web server
server.begin();

`
The crash happens when server.begin() is executed, and will happen even if I comment out the code above it. It also happens with the "Simple server" example sketch.

I've tested with version 3.3.22 of the web server library and all newer versions and all seem to have the problem.

I'm using this board: https://www.amazon.com/gp/product/B0D9W4Y3F3/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1, but the folks discussing the issue in the Arduino forum thread I think are using different ones.

I don't know how to capture a stack trace but will research it and post back if I can figure it out!

@proddy
Copy link

proddy commented Jan 12, 2025

Thought it was fixed in mathieucarbou/AsyncTCP#27

@elaw01887
Copy link
Author

I think I figured out how to decode the stack trace? Here's the raw output from the crash:
`Rebooting...
⸮⸮⸮ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x4037b56e
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2820,len:0x1188
load:0x403c8700,len:0x4
load:0x403c8704,len:0xbf0
load:0x403cb700,len:0x30e4
entry 0x403c88ac

assert failed: tcp_alloc /IDF/components/lwip/lwip/src/core/tcp.c:1851 (Required to lock TCPIP core functionality!)

Backtrace: 0x40376646:0x3fcab730 0x4037e49d:0x3fcab750 0x40384fd5:0x3fcab770 0x4202f133:0x3fcab8a0 0x4202f29d:0x3fcab8c0 0x420064a8:0x3fcab8e0 0x420135fd:0x3fcab930 0x420056b9:0x3fcab950 0x42018b07:0x3fcab9f0 0x4037f1b2:0x3fcaba10
`

And here's the decoder output:
`
PC: 0x4037b56e

Decoding stack results
0x40376646: panic_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/panic.c line 463
0x4037e49d: esp_system_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/port/esp_system_chip.c line 92
0x40384fd5: __assert_func at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/assert.c line 80
0x4202f133: tcp_alloc at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/tcp.c line 1851
0x4202f29d: tcp_new_ip_type at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/tcp.c line 2006
0x420064a8: AsyncServer::begin() at \home\dfs\Eric's Stuff~Arduino sketchbooks\libraries\AsyncTCP\src\AsyncTCP.cpp line 1274
0x420135fd: AsyncWebServer::begin() at \home\dfs\Eric's Stuff~Arduino sketchbooks\libraries\ESP_Async_WebServer\src\WebServer.cpp line 119
0x420056b9: setup() at \home\dfs\Eric's Stuff~Arduino sketchbooks\libraries\ESP_Async_WebServer\examples\SimpleServer/SimpleServer.ino line 764
0x42018b07: loopTask(void*) at C:\Users\eric.HOME\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.1\cores\esp32\main.cpp line 59
0x4037f1b2: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c line 139
`

@mathieucarbou
Copy link
Owner

@elaw01887 : please make you you use the right dependencies before opening an issue.
Your stack traces show that you are either not using the lastest versions of these librairies, or that you are not at all using ESPAsyncWS and AsyncTCP from my forks as described in his project readme.

Repository owner locked and limited conversation to collaborators Jan 12, 2025
@mathieucarbou mathieucarbou converted this issue into discussion #193 Jan 12, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

3 participants