me-no-dev / ESPAsyncWebServer

Async Web Server for ESP8266 and ESP32
3.78k stars 1.23k forks source link

WebSocket textAll() causes kernel panic #302

Closed SoundsSerious closed 5 years ago

SoundsSerious commented 6 years ago

Hey! Been loving how amazing this webserver is, however I'm running into a problem when I'm trying to send telemetry data at a very fast rate. I assume the following stack trace is due to some sort of low memory kernel panic.

Decoding 13 results... 0x400d57c3: __cxa_end_catch at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/cxx/./cxx_exception_stubs.cpp line 13

0x4008ac20: invoke_abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/./panic.c line 572

0x4008ad1f: abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/./panic.c line 572

0x400d57c3: __cxa_end_catch at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/cxx/./cxx_exception_stubs.cpp line 13

0x400f7020: operator new(unsigned int) at /Volumes/build/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/new_op.cc line 54

0x400fac9e: AsyncWebSocket::makeBuffer(unsigned char*, unsigned int) at /Users/Cabin/.platformio/lib/ESP Async WebServer_ID306/src/AsyncWebSocket.cpp line 814

0x400fb1b4: AsyncWebSocket::textAll(char const*, unsigned int) at /Users/Cabin/.platformio/lib/ESP Async WebServer_ID306/src/AsyncWebSocket.cpp line 814

0x400fb1d0: AsyncWebSocket::textAll(String const&) at /Users/Cabin/.platformio/lib/ESP Async WebServer_ID306/src/AsyncWebSocket.cpp line 814

0x400d2d6d: COM::broadcastClients(String) at /Users/Cabin/Dropbox/workspace/beemo/code/Frisbeem_ESP32/src/communication.cpp line 190

: (inlined by) COM::telemetry(String, String) at /Users/Cabin/Dropbox/workspace/beemo/code/Frisbeem_ESP32/src/communication.cpp line 210

0x400d3198: COM::send_telemetry() at /Users/Cabin/Dropbox/workspace/beemo/code/Frisbeem_ESP32/src/communication.cpp line 219

JacoFourie commented 6 years ago

+1

geekbozu commented 6 years ago

I am having a very similar problem with a large data rate as well, I'm sending packets about 60 times a second, It seems the Async server is not processing them fast enough and I am running out of heap :( Is there anyway to force a websocket.textAll to process immediately?

stale[bot] commented 5 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.

stale[bot] commented 5 years ago

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.