-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
axTLS crashes when malloc fails #2201
Comments
I just did the same thing without SPIFFS but more debug output:
Stack decode:
|
Your log indicates that there is not enough RAM for the connection. It's 18072 bytes before the connection, which is too low for TLS handshake, especially if you aren't using 512 bit keys. |
Thanks! So it should be enough as a "workaround" to store e.g. in the RTC that an update is available and then start the update just before I do my normal stuff (constructing objects ...)? |
Also running in to this issue when trying to have two ssl connections open. How much memory would you expect a TLS handshake to take? We have ~21k available before we try the second connection and appear to be hitting this issue too. |
FWIW, I've started modifying axtls to cope gracefully with allocation failures, but it's a lot of work (finished bigint.c yesterday, but only build tested so far) . |
That's brilliant, @silbe - axTLS has been the bane of my existence developing for the ESP8266. The entire library is remarkably poor at checking for allocation failures, making it woefully unstable on these devices. I've spent some time tracking down the most common failures in the axTLS code, and have gotten it to be stable to about ~15 hours between failures sending a ~2K payload over TLS with ~34K of free heap before sending. Please let me know once you have something working, as I'd love to contribute. |
I've pushed my work-in-progress code (bigint.c only so far) to the 20161221-oom-fixes branch in the silbe/axtls-8266 repo. Been running it on several modules for several weeks without encountering any issue that I could trace back to it (after fixing one initial bug), though that doesn't mean too much given how often the modules "crash" for other reasons. |
BearSSL is merged in #4273 , with alternate BearSSL::WiFi* classes. Although axtls-based classes are still available and even the default, they are planned for deprecation and then retirement, hence won't be fixed. Any issues with BearSSL-based classes should be reported in new issues. |
Basic Infos
Hardware
Hardware: ESP-07
Core Version: 2.3.0
Description
I do an update just like in the examples, but sometimes, I get an error and the ESP reboots. Since it's not a permanent error, I think it might be a problem with the HTTPS connection.
By the way, I found another thing:
In Example Sketch
httpUpdate.ino
, there is the Line//t_httpUpdate_return ret = ESPhttpUpdate.update("https://server/file.bin");
, but this won't work since there is no fingerprint given.Settings in IDE
Module: Generic ESP8266 Module
Flash Size: 1 MB
CPU Frequency: 80 MHz
Flash Mode: DIO
Flash Frequency: ?40Mhz?
Upload Using: OTA
Reset Method: ?ck / nodemcu?
Sketch
Debug Messages
Decoded Stack trace
The text was updated successfully, but these errors were encountered: