-
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
Unhandled C++ exception: OOM when used ESPhttpUpdate.update in the versions boards 3.1.2 and 3.1.1 for OTA update #8981
Comments
Figure out the place where OOM happens, as noted by the "last failed alloc call: 4020CF84(16)" line ( Arduino IDE 2.x tooling lacks exception decoder, see https://github.com/esp8266/Arduino/blob/master/tools/decoder.py I don't see anything suspicious between 3.1.0 and 3.1.2 related to memory management that might've caused this, you'd have to be more thorough when comparing our versions and / or your code :/ |
Hello, thanks for replying. The comparison between 3.1.0 and previous ones is because with these versions the error does not happen, only in versions 3.1.1 and 3.1.2, for the same program code, everything is the same, just changing the core version in the arduino. Unfortunately, BearSSL needs to know the buffer sizes before it begins connection, so applications that want to use smaller buffers need to check the remote server’s support before connect() . Because TLS was developed on systems with many megabytes of memory, they require by default a 16KB buffer for receive and transmit. That's enormous for the ESP8266, which has only around 40KB total heap available. The problem happens exactly when in this program line: t_httpUpdate_return ret = ESPhttpUpdate.update(UpdateClient,URL_fw_Bin); Has the buffer size changed for TLS communication in core version 3.1.2? |
No network changes as far as I can see? Check git-log between our release tags, or from github compare page It is apparent that bssl needs a lot of ram in both versions, but it had to go somewhere before that updater line is executing. Could start by checking before-and-after stats from our platform class; ESP.getFreeHeap(), ESP.getHeapStats(), etc. Another (more elaborate) way is to switch to git installation and use git-bisect to figure out what commit might've broke things between releases |
I ve a similar problem. Maybe OOM is a result of large string allocations. see #9005
OOM occours regadless of MMU settings. Are there options for StreamString or reorder mem allocations readStringUntil to get BearSSL working with less than 30k heap? Same problem happens with HTTPClient GET(): server repsonse is always to large |
It is possible to reduce SSL/TLS client buffer size when peer servers allow it. Arduino/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino Lines 42 to 45 in 1662248
|
Basic Infos
Platform
Settings in IDE
Problem Description
I have been using the esp8285 in a commercial project for a few years now and have always updated the firmware OTA. However, after flashing the esp8285 with firmware in board version 3.1.2, it is no longer possible to update the firmware over OTA. The error below occurs:
If you downgrade to version 3.1.0 and earlier, this error does not happen, and the firmware update via OTA proceeds normally.
There are hundreds of devices installed with board version 3.1.2 and now I can't update them over OTA anymore. Please help me to resolve. What to do?
The text was updated successfully, but these errors were encountered: