1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Expand BSSL stack (#6819)

Fixes #6811 which found an issue where connecting to scripts.google.com
would *occasionally* cause a crash.  On inspection, it was found that up
to 5828 bytes of stack were used once in a while, so expand the stack to
5900 bytes to cover this case plus a little extra.
This commit is contained in:
Earle F. Philhower, III 2019-11-20 18:05:38 -07:00 committed by GitHub
parent 007e495e0d
commit ebae47c13a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -36,7 +36,8 @@ uint32_t *stack_thunk_top = NULL;
uint32_t *stack_thunk_save = NULL; /* Saved A1 while in BearSSL */
uint32_t stack_thunk_refcnt = 0;
#define _stackSize (5748/4)
/* Largest stack usage seen in the wild at scripts.google.com at 5828 */
#define _stackSize (5900/4)
#define _stackPaint 0xdeadbeef
/* Add a reference, and allocate the stack if necessary */

View File

@ -6,6 +6,7 @@
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <StackThunk.h>
#include <time.h>
#ifndef STASSID
@ -81,7 +82,8 @@ void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_
}
client->stop();
uint32_t freeStackEnd = ESP.getFreeContStack();
Serial.printf("\nCONT stack used: %d\n-------\n\n", freeStackStart - freeStackEnd);
Serial.printf("\nCONT stack used: %d\n", freeStackStart - freeStackEnd);
Serial.printf("BSSL stack used: %d\n-------\n\n", stack_thunk_get_max_usage());
}
void fetchNoConfig() {