vintlabs / fauxmoESP

Add voice control of your ESP32 and ESP8266 devices using Amazon Alexa
MIT License
375 stars 70 forks source link

Infrequent crashes caused by a bug #246

Open Miq1 opened 1 year ago

Miq1 commented 1 year ago

https://github.com/vintlabs/fauxmoESP/blob/0b3aee19eac2797ac125aaab50b78a2a52e6ecf6/src/fauxmoESP.cpp#L326

In fauxmoESP.cpp on line 326 is a hidden bug that in certain constellations will crash the ESP. You are writing a zero byte behind the buffer allocated by AsyncTCP. This goes unnoticed most of the time, but if you happen to have some address data immediately following in memory unexpected things will happen.

ranger81 commented 1 year ago

@Miq1 Thank you very much for reporting that, I was wondering why my devices keep crashing from time to time. Especially when Alexa is searching for new smart home devices. I was able to find a workaround and so far, my devices no longer crash. If anyone is interested: https://github.com/ranger81/fauxmoESP/blob/3.3memorybugfix/src/fauxmoESP.cpp#L316

Miq1 commented 1 year ago

@ranger81 You are welcome. 😁

Remains the issue of Alexa not understanding or ignoring the status responses. Most annoying, I must say.

JSMSolns commented 2 months ago

Just wanted to add my thanks to @Miq1 and @ranger81 for posting this - it seems to have fixed my intermittent exceptions problems too.