ESPHome
2026.12.0-dev
Loading...
Searching...
No Matches
esphome
components
esp8266
stack_thunk_stubs.cpp
Go to the documentation of this file.
1
/*
2
* Linker wrap stub for the Arduino core's BearSSL stack-overflow handler.
3
*
4
* stack_thunk_fatal_smashing() prints "FATAL ERROR: BSSL stack smashing detected" and then calls
5
* __stack_chk_fail(). Any build that links BearSSL (http_request HTTPS, the nextion upload, MQTT TLS)
6
* links StackThunk, and on ESP8266 .rodata lives in DRAM, so the message costs 44 bytes of RAM. The
7
* postmortem that __stack_chk_fail() prints already reports the stack smash. Builds without BearSSL
8
* never reference the handler, so the wrap costs them nothing.
9
*/
10
11
#if defined(USE_ESP8266)
12
13
namespace
esphome::esp8266
{}
14
15
// NOLINTBEGIN(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp,readability-identifier-naming)
16
extern
"C"
{
17
18
void
__stack_chk_fail
();
19
void
__wrap_stack_thunk_fatal_smashing
() {
__stack_chk_fail
(); }
20
21
}
// extern "C"
22
// NOLINTEND(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp,readability-identifier-naming)
23
24
#endif
// USE_ESP8266
esphome::esp8266
Definition
core.h:10
__wrap_stack_thunk_fatal_smashing
void __wrap_stack_thunk_fatal_smashing()
Definition
stack_thunk_stubs.cpp:19
__stack_chk_fail
void __stack_chk_fail()
Generated by
1.12.0