-
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
Soft WDT reset in tcp_write with WiFiClientSecure #2457
Comments
I have similar behavior but for me it is very rare. Finally it happend in development environment where I could catch the stacktrace. I don't know if it is really time-out waiting for network a bug in my program (some problem with my buffer). There has to be a work around to this. I can't loose all execution context if something wrong happend with network a connection. But I want to avoid increase hardware complexity. TCP needs to time out before WDT. Is there a workaround to this? Soft WDT reset ctx: cont
0x4024828c: pbuf_alloc at /Users/igrokhotkov/espressif/arduino/tools/sdk/lwip/src/core/pbuf.c:366 |
The unfortunate workaround right now is keeping free heap space above ~33-34K. That seems to be the sweet spot in my programs. As soon as you go under that, these stack traces return. I'm almost certain it's because a malloc/realloc fails somewhere when the heap decreases, and due to the incredibly poor memory discipline in axTLS, it's not caught, and bad stuff happens shortly afterwards such as this fault. I have had many production devices connecting, and sending to a 2048-bit cert HTTPS server every second running for over a month now without a single reset. However, this was only after spending an inordinate amount of time freeing up heap space for SSL. |
This is not a solution for me. |
@liquidfalcon has mem requirement improved with latest git? Does it improve or get worse with |
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-12F
Core Version: Git
Description
After I believe the second WiFiClient rewrite (Although, I may be wrong here), I started noticing occasional WDT resets when using WiFiClientSeccure and large payloads. They consistently fail in the same area, namely
tcp_write
in LWIP.The setup is simple:
Connect to a TLS 1.1 server with a 2K certificate. My code has approximately 30500 bytes free of heap space before I start this connection. Then, send a 1600+ byte (dynamically allocated in my case, exact size being 1696 bytes sent) payload at once via client.write(...). This will then trigger a soft WDT reset approximately 5 seconds later with the below trace. Sending my smaller payload (1200 bytes and below) over and over again generally does not cause an issue, but does occasionally crash with the same reset once or twice an hour.
Settings in IDE
Module: Generic ESP8266 Module
Flash Size: 4MB/1MB
CPU Frequency: 80Mhz
Flash Mode: qio
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: N/A
Debug Messages
Raw Output:
Decoded:
The text was updated successfully, but these errors were encountered: