The memory limiter installs custom malloc/free handlers in mbedtls to do its tracking, and restores the default handlers when done. Unfortunately this breaks other tasks which are using mbedtls at the same time - e.g. HTTPS client on ESP IDF. When the magic malloc headers installed this library no longer make sense, the default handlers will assume memory corruption and crash.
Hi!
The memory limiter installs custom malloc/free handlers in mbedtls to do its tracking, and restores the default handlers when done. Unfortunately this breaks other tasks which are using mbedtls at the same time - e.g. HTTPS client on ESP IDF. When the magic malloc headers installed this library no longer make sense, the default handlers will assume memory corruption and crash.
Original bug report in the ESP IDF port of this project and an in-depth diagnosis of the issue by an Espressif developer is available here: https://github.com/espressif/esp-google-iot/issues/18#issuecomment-746988438
When network connects, a lot of network-dependent modules typically start their work in parallel. Hence the issue is quite severe in my opinion.