khoih-prog / EthernetWebServer

This is simple yet complete WebServer library for AVR, AVR Dx, Portenta_H7, Teensy, SAM DUE, SAMD21/SAMD51, nRF52, STM32, RP2040-based, etc. boards running Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Coexisting now with `ESP32 WebServer` and `ESP8266 ESP8266WebServer` libraries. Ethernet_Generic library is used as default for W5x00 with custom SPI
MIT License
178 stars 49 forks source link

ESP32 heap corrupting after update to 1.4.0 or 1.5.0 #35

Closed pptsk closed 3 years ago

pptsk commented 3 years ago

Hi, I have finished ESP32 project with your great library, which periodically send json file as response to AJAX request. Wifi and BT are off. Everything works fine, but after update my version 1.3.1 to 1.4.0 or 1.5.0 after each response is free heap memory decreased by 56 bytes until system crash. All is fine with version 1.3.1.

Decoded exception is atached


Decoding stack results
0x400f94c5: panic_abort at ../esp-idf/components/esp_system/panic.c line 365
0x40091d51: esp_system_abort at ../esp-idf/components/esp_system/esp_system.c line 126
0x40097845: abort at ../esp-idf/components/newlib/abort.c line 46
0x4017a86f: __cxxabiv1::__terminate(void (*)()) at /builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc line 47
0x4017a8b6: std::terminate() at /builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc line 57
0x4017a33d: __cxxabiv1::__cxa_allocate_exception(std::size_t) at /builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_alloc.cc line 300
0x4017a16c: operator new(unsigned int) at /builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/new_op.cc line 54
0x400d5e8b: EthernetWebServer::_prepareHeader(String&, int, char const*, unsigned int) at D:\Moje projekty\ARDUINO PROJEKTY\libraries\EthernetWebServer\src/EthernetWebServer-impl.h line 456
0x400d5f89: EthernetWebServer::send(int, char const*, String const&) at C:\Users\ppt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0-alpha1\cores\esp32/WString.h line 322
0x400e2701: HandleSystemInfo() at C:\Users\ppt\AppData\Local\Temp\arduino_build_378874\sketch/ServerStream.h line 206
0x40188555: vl::internal_invokers::StaticInvoker ::Invoke() at D:\Moje projekty\ARDUINO PROJEKTY\libraries\Functional-Vlpp\src/Function.h line 75
0x400d36a2: FunctionRequestHandler::handle(EthernetWebServer&, HTTPMethod, String) at D:\Moje projekty\ARDUINO PROJEKTY\libraries\Functional-Vlpp\src/Function.h line 197
0x400d642b: EthernetWebServer::_handleRequest() at D:\Moje projekty\ARDUINO PROJEKTY\libraries\EthernetWebServer\src/EthernetWebServer-impl.h line 820
0x400d87e0: EthernetWebServer::handleClient() at D:\Moje projekty\ARDUINO PROJEKTY\libraries\EthernetWebServer\src/EthernetWebServer-impl.h line 224
0x400e0852: loop() at D:\Moje projekty\ARDUINO PROJEKTY\DAS16_ESP32_NEW/DAS16_ESP32_NEW.ino line 259
0x400f3125: loopTask(void*) at C:\Users\ppt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0-alpha1\cores\esp32\main.cpp line 39
khoih-prog commented 3 years ago

Hi,

Thanks for using the library and your nice words.

In order to help reproducing the issue, could you post the MRE.

I also noted that you're using experimental ESP32 core 2.0.0-alpha1. Can you try with the stable core v1.0.6 to see if the heap corruption persists ?