Repository navigation
Closed
Labels
Description
What happened?
When randomly requesting the web API json, or when refresing the webpage 2-3 times the wled crashes.
Sometimes takes a little longer 8-10 times, sometimes 2-3 times,
The esp settings can be the factory ones.
To Reproduce Bug
- Flash the latest 0.16 beta.
- Open the webpage.
- Refresh the webpage continously, around a 1 second delay to refresh.
The 0.16 is crashing really fast. I don't see this behaviour in 0.14.4 that easy to crash, seams more impossible with 0.14.4, sometimes after like 10 or more refreshes the page is not loading but the esp is not crashing, waiting a little and works again.
Expected Behavior
To not crash.
Install Method
Binary from WLED.me or Self Build
What version of WLED?
Which microcontroller/board are you seeing the problem on?
ESP32
Relevant log/trace output
CORRUPT HEAP: Bad head at 0x3ffe15fc. Expected 0xabba1234 got 0x3ffe1814
abort() was called at PC 0x4009020d on core 1
ELF file SHA256: 0000000000000000
Backtrace: 0x4008ab48:0x3ffdd600 0x4008aea5:0x3ffdd620 0x4009020d:0x3ffdd640 0x400862fa:0x3ffdd660 0x40086791:0x3ffdd680 0x4000bec7:0x3ffdd6a0 0x401be815:0x3ffdd6c0 0x401365c9:0x3ffdd6e0 0x401358a2:0x3ffdd700 0x40137ed5:0x3ffdd720 0x4013244f:0x3ffdd740 0x4013245d:0x3ffdd760 0x4012a9de:0x3ffdd780 0x4012abba:0x3ffdd7b0 0x4012acb1:0x3ffdd7e0 0x4012ad57:0x3ffdd800 0x4008c92e:0x3ffdd830
#0 0x4008ab48:0x3ffdd600 in invoke_abort at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:648
#1 0x4008aea5:0x3ffdd620 in abort at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:648
#2 0x4009020d:0x3ffdd640 in multi_heap_free at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/heap/multi_heap_poisoning.c:305
#3 0x400862fa:0x3ffdd660 in heap_caps_free at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/heap/heap_caps.c:354
#4 0x40086791:0x3ffdd680 in _free_r at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/newlib/syscalls.c:42
#5 0x4000bec7:0x3ffdd6a0 in ?? ??:0
#6 0x401be815:0x3ffdd6c0 in operator delete(void*) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/del_op.cc:46
#7 0x401365c9:0x3ffdd6e0 in AsyncWebServerResponse::~AsyncWebServerResponse() at .pio\libdeps\esp32dev\ESPAsyncWebServerWLED\src/WebResponses.cpp:658
#8 0x401358a2:0x3ffdd700 in AsyncWebServerRequest::~AsyncWebServerRequest() at .pio\libdeps\esp32dev\ESPAsyncWebServerWLED\src/WebRequest.cpp:1048
#9 0x40137ed5:0x3ffdd720 in AsyncWebServer::_handleDisconnect(AsyncWebServerRequest*) at .pio\libdeps\esp32dev\ESPAsyncWebServerWLED\src/DynamicBuffer.h:259
#10 0x4013244f:0x3ffdd740 in AsyncWebServerRequest::_onDisconnect() at .pio\libdeps\esp32dev\ESPAsyncWebServerWLED\src/WebRequest.cpp:1048
#11 0x4013245d:0x3ffdd760 in std::_Function_handler<void (void*, AsyncClient*), AsyncWebServerRequest::AsyncWebServerRequest(AsyncWebServer*, AsyncClient*)::{lambda(void*, AsyncClient*)#3}>::_M_invoke(std::_Any_data const&, void*&&, AsyncClient*&&) at .pio\libdeps\esp32dev\ESPAsyncWebServerWLED\src/WebRequest.cpp:1048
(inlined by) _M_invoke at c:\users\desktoptv\.platformio\packages\toolchain-xtensa32\xtensa-esp32-elf\include\c++\5.2.0/functional:1871
#12 0x4012a9de:0x3ffdd780 in std::function<void (void*, AsyncClient*)>::operator()(void*, AsyncClient*) const at .pio\libdeps\esp32dev\AsyncTCP\src/AsyncTCP.cpp:1123
#13 0x4012abba:0x3ffdd7b0 in AsyncClient::_error(signed char) at .pio\libdeps\esp32dev\AsyncTCP\src/AsyncTCP.cpp:1123
#14 0x4012acb1:0x3ffdd7e0 in AsyncClient_detail::handle_async_event(AsyncClient_event_t*) at .pio\libdeps\esp32dev\AsyncTCP\src/AsyncTCP.cpp:1123
#15 0x4012ad57:0x3ffdd800 in _async_service_task(void*) at .pio\libdeps\esp32dev\AsyncTCP\src/AsyncTCP.cpp:1123
#16 0x4008c92e:0x3ffdd830 in vPortTaskWrapper at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)
Rebooting...Anything else?
No response
Code of Conduct
Fix:
For now is to use and old version of AsyncTCP with 0.16
Instead of using: willmmiles/AsyncTCP @ 1.3.1
use: https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
- I agree to follow this project's Code of Conduct
Activity
blazoncek commentedon Jul 23, 2025
No matter how hard I hit it, I can't make it kneel.
Andro-Marian commentedon Jul 23, 2025
https://github.com/user-attachments/assets/804e72eb-e701-4505-99a8-4429d31d06a2
Like this?
DedeHai commentedon Jul 23, 2025
I can get it to crash if I violently hit the refresh button for about 10 seconds. The crash dump is completely different:
@Andro-Marian did you erase the flash and start on a fresh install directly to latest nightly?
Andro-Marian commentedon Jul 23, 2025
0.16 Crash.txt
Still can reproduce after a full clean.
DedeHai commentedon Jul 23, 2025
need more details on how to reproduce, like exact LED setup
Andro-Marian commentedon Jul 23, 2025
Nothing much.
Used the: python -m esptool --chip esp32 erase_flash
Then Build and upload the firmware with vscode
Then opening the webpage after connected to WiFi and pressing Ctrl+R to refresh the page until randomly crash
I think you need to refresh more violently.
Noticed this when requesting the "/json/si" then after "/presets.json". I think if they are to many requests fast can crash.
blazoncek commentedon Jul 23, 2025
Do not forget: ESP32 is a microcontroller with limited resources. If you hit it too hard you may deplete its resources (which may cause undesired effects).
Andro-Marian commentedon Jul 23, 2025
Yea. But should not crash if can't resolve the request. 0.14.4 is very stable or below 0.13. Not a single one crashed when requesting information and in same time as 0.16 ones.
Andro-Marian commentedon Jul 23, 2025
I don't have that "=== Memory Info ===" in the logs anywhere, what I am missing? Looks really different
Is not ESP32-DevKit-V4 with ESP32-WROOM-32E ?
DedeHai commentedon Jul 24, 2025
Memory info is from my debug build.
If you overload the ESP with requests, it can crash. Nothing we can do about it, its a core function done by espressif.
blazoncek commentedon Jul 24, 2025
One more thing. I can see you are using slow (but most compatible) flash mode of DOUT.
Try switching it for faster DIO or even QIO if your ESP supports it. And perhaps also 80MHz clock speed.
This will enable ESP to process web requests (and everything else) faster.
I.e.
EDIT: I propose to close as unresolved as this is something out of scope of WLED.
Andro-Marian commentedon Jul 24, 2025
I try the DIO, 0.16 still crash very easily, event after 2-3 refreshes or requesting data from API after boot.
0.14 I can't crash even harder than trying on 0.16
Still looks like something is broken with 0.16. Stick to 0.14 for stability.
ShareX_hDim5OJgBQ.mp4
3 remaining items
Andro-Marian commentedon Jul 24, 2025
0.14.4 already uses the 2.4.0
Andro-Marian commentedon Jul 24, 2025
The AsyncTCP was changed.
Trying to change to the old, as the 0.14, if will work
0.14.4
|-- LittleFS_esp32 @ 1.0.6+sha.f0817ca
|-- FastLED @ 3.6.0
|-- IRremoteESP8266 @ 2.8.2
|-- ESPAsyncWebServerWLED @ 2.4.0+sha.2d3af2c
|-- arduinoFFT @ 1.9.2+sha.419d7b0
|-- Wire @ 1.0.1
|-- SD(esp32) @ 1.0.5
|-- SD_MMC @ 1.0
|-- SPI @ 1.0
|-- EEPROM @ 1.0.3
|-- ArduinoOTA @ 1.0
|-- DNSServer @ 1.1.0
|-- ESPmDNS @ 1.0
|-- WiFi @ 1.0
|-- ESP32 Async UDP @ 1.0.0
|-- WebServer @ 1.0
0.16
|-- LittleFS_esp32 @ 1.0.6+sha.f0817ca
|-- AnimatedGIF @ 1.4.7
|-- GifDecoder @ 1.1.0+sha.bc3af18
|-- FastLED @ 3.6.0
|-- IRremoteESP8266 @ 2.8.2
|-- ESPAsyncWebServerWLED @ 2.4.0+sha.2d3af2c
|-- QuickEspNow @ 0.8.1+sha.193e991
|-- audioreactive
|-- Wire @ 1.0.1
|-- EEPROM @ 1.0.3
|-- Update @ 1.0
|-- ArduinoOTA @ 1.0
|-- DNSServer @ 1.1.0
|-- ESPmDNS @ 1.0
|-- WiFi @ 1.0
|-- SPI @ 1.0
|-- ESP32 Async UDP @ 1.0.0
|-- WebServer @ 1.0
Andro-Marian commentedon Jul 24, 2025
I see the crash is about AsyncTCP. May be related
Andro-Marian commentedon Jul 24, 2025
Fixed. I am soooooo happy.
https://github.com/user-attachments/assets/36b9e981-3115-4ead-9d7f-70d39881dec6
[-]WLED 0.16 crashes when refresing the webpage[/-][+][Fixed] WLED 0.16 crashes when refresing the webpage[/+]blazoncek commentedon Jul 25, 2025
I do not understand what you did. Can you elaborate?
Andro-Marian commentedon Jul 25, 2025
The AsyncTCP 'willmmiles/AsyncTCP @ 1.3.1' is broken.
The 'https://github.com/pbolduc/AsyncTCP.git @ 1.2.0' is good.
blazoncek commentedon Jul 25, 2025
@Andro-Marian please open an issue on @willmmiles AsyncTCP repository with exact steps including entire WLED configuration.
Andro-Marian commentedon Jul 25, 2025
@blazoncek Is not possible to open an issue there.
Not sure from what version he break it. Not tested all versions.
But if the old one works fine, I stick to it.
blazoncek commentedon Jul 25, 2025
If that would be the solution, everyone would still be using WLED 0.1
Andro-Marian commentedon Jul 25, 2025
Don't want this to go on a debate, at least here. Depends on the situation and perspective. If the WLED 0.2 is broken and unusable, in this case AsyncTCP. Then yes. Old is better.
Until the new one is working fine. You/I can fix it by changing to the old version.