Description
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:
Soft WDT reset
ctx: cont
sp: 3fff2684 end: 3fff2c94 offset: 01b0
>>>stack>>>
3fff2834: 271af377 856ba915 00000000 00000000
3fff2844: 4024df9e 3fff43fc 00000000 4024df74
3fff2854: 00000000 000006e5 00000000 3fffa4fc
3fff2864: 000005b4 00000000 00000001 3fff9b2c
3fff2874: 000005b4 00000000 00000000 40220668
3fff2884: 0000000a 00000009 3fff4c68 00000000
3fff2894: 3fffa4fc 000006e5 3fff42f4 402171b4
3fff28a4: 3fff4bb8 3fff4bc8 3fff4d98 00000000
3fff28b4: 3fffa4fc 000006e5 3fff42f4 40217f08
3fff28c4: 00000000 3fff455c 000006e5 40240a8d
3fff28d4: 06030317 74736fa0 306d203a 61656d2e
3fff28e4: 000006a0 00000017 00000010 006e6574
3fff28f4: 3fff2934 3fff2904 00000008 00000000
3fff2904: 3fff455c 3fff93d4 000006a0 40240b17
3fff2914: 000006a0 ff000000 00000008 4020e3cd
3fff2924: 3ffe9212 000006b5 3fff2904 3fff2964
3fff2934: 3fff2aac 3fff2a64 3fff2aac 40217988
3fff2944: 00000653 3fff2a64 3fff93d4 40213aac
3fff2954: 656e696c 3130307a 33333132 40210039
3fff2964: 39313631 00000000 00000000 00000000
3fff2974: 00000000 00000000 00000000 3fff0000
3fff2984: 2d434354 31373631 00393532 00000000
3fff2994: 00000000 00000000 00000000 40250000
3fff29a4: 005e0001 3ffffb00 3fff3be4 fffffffc
3fff29b4: 000000ac 00023e90 000001ac 40253110
3fff29c4: 40001f46 0000001a 00000195 40225aec
3fff29d4: 3fff42e4 3fff2a28 00000001 00000002
3fff29e4: 00000000 00000494 3fff3be4 40221d5c
3fff29f4: 3fff0000 00000016 3fff1934 00000000
3fff2a04: 3fff42f4 3fff42dc 3fff4364 40252702
3fff2a14: 3fff3a74 3fff2a24 00000004 3fff3a74
3fff2a24: 3fff190c 000001c3 000001c3 4010020c
3fff2a34: 3fff166c 00000000 3fff2a94 4010068c
3fff2a44: 3fff166c 3fff43dc 3fff2a84 40220668
3fff2a54: 3fff166c 00000000 3fff4374 40218843
3fff2a64: 00000000 00000000 00000000 40222c80
3fff2a74: 3fff166c 00000000 3fff4374 40218f1d
3fff2a84: 00000102 0000000b 0000003a 00000012
3fff2a94: 0000001d 00000007 00000074 00000001
3fff2aa4: 000000f1 0000014e 3ffe9768 00000000
3fff2ab4: 00001388 00000000 00000000 3fff42f4
3fff2ac4: 3fff44cc 3fff8dfc 3fff2a64 00000000
3fff2ad4: 3fff1608 3ffe8f00 3fff166c 3fff8bc4
3fff2ae4: 00001000 6d2e306d 75736165 6e2e7a72
3fff2af4: 3f007465 3fff7040 3fff2ac8 00000001
3fff2b04: 0068d7a3 00000013 3fff1934 4021f0a0
3fff2b14: 3fff10ec 3fff10e4 3fff1934 4021f0c4
3fff2b24: 00000754 3fff29a4 3fff52cc 3fff7040
3fff2b34: 3fff4b18 3fff5258 3fff6fb4 00000002
3fff2b44: 3fff5250 3fff5288 00000000 3fff2964
3fff2b54: 3fff2954 3fff4808 3734313a 40107aa9
3fff2b64: 4023ce8e 3fff10f4 40359999 3fffdad0
3fff2b74: a0000000 00000001 3fff2bd4 4021fbab
3fff2b84: 3fff36b4 402166f4 3fff1764 3fff2ba4
3fff2b94: 3fff0fe5 3fff119d 3fff10f4 402151e0
3fff2ba4: 3ffe9077 3fff10f8 3fff2bd4 4010068c
3fff2bb4: 40201312 000003e8 000003e8 4021fb00
3fff2bc4: 3fff10f4 3fff10f8 3fff13c0 4020c498
3fff2bd4: 00000000 00000000 00000000 4020df84
3fff2be4: 3fff10f4 3fff10f8 3fff10e4 40211cfc
3fff2bf4: 0000000b 0000003a 00000012 0000001d
3fff2c04: 00000007 00000074 00000001 000000f1
3fff2c14: 0000014e feefeffe feefeffe feefeffe
3fff2c24: 0000000b 0000003a 00000012 0000001d
3fff2c34: 00000007 00000074 00000001 000000f1
3fff2c44: 0000014e feefeffe feefeffe feefeffe
3fff2c54: feefeffe feefeffe feefeffe feefeffe
3fff2c64: feefeffe feefeffe feefeffe 3fff1a70
3fff2c74: 3fffdad0 00000000 3fff1a69 40220788
3fff2c84: feefeffe feefeffe 3fff1a80 40100720
<<<stack<<<
ets Jan 8 2013,rst cause:2, boot mode:(1,6)
ets Jan 8 2013,rst cause:4, boot mode:(1,6)
wdt reset
Decoded:
Decoding 38 results
0x4024df9e: tcp_write at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/tools/sdk/lwip/src/core/tcp_out.c:575
0x4024df74: tcp_pbuf_prealloc at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/tools/sdk/lwip/src/core/tcp_out.c:257
(inlined by) tcp_write at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/tools/sdk/lwip/src/core/tcp_out.c:535
0x40220668: operator delete(void*) at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/abi.cpp:57
0x402171b4: ClientContext::_write_some() at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/WiFiServer.cpp:91
0x40217f08: ClientContext::_write_from_source(DataSource*) at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp:587
(inlined by) ClientContext::write(unsigned char const*, unsigned int) at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/include/ClientContext.h:291
(inlined by) __ax_port_write at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp:616
0x40240a8d: send_raw_packet at /Users/ficeto/Desktop/ESP8266/axtls-8266/ssl/tls1.c:1072
(inlined by) send_packet at /Users/ficeto/Desktop/ESP8266/axtls-8266/ssl/tls1.c:1209
0x40240b17: ssl_write at /Users/ficeto/Desktop/ESP8266/axtls-8266/ssl/tls1.c:312
0x4020e3cd: ArduinoJson::Internals::JsonPrintable<ArduinoJson::JsonObject>::printTo(char*, unsigned int) const at /home/danielm/Arduino/core/core.ino:857
0x40217988: WiFiClientSecure::write(unsigned char const*, unsigned int) at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp:587
0x40213aac: measurz_send(bool) at /home/danielm/Arduino/core/measurz.ino:526
0x40210039: onWebSocketEvent(unsigned char, WStype_t, unsigned char*, unsigned int) at /home/danielm/Arduino/core/core.ino:857
0x40250000: espconn_tcp_memp_free at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/tools/sdk/lwip/src/app/espconn_tcp.c:235 (discriminator 1)
0x40253110: ip_output_if_opt at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/tools/sdk/lwip/src/core/ipv4/ip.c:780
0x40001f46: ?? ??:0
0x40225aec: pvPortMalloc at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/heap.c:13
0x40221d5c: SPIFFSImpl::end() at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/spiffs_api.h:169
0x40252702: igmp_send at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/tools/sdk/lwip/src/core/ipv4/igmp.c:830
0x4010020c: _umm_free at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/umm_malloc/umm_malloc.c:1287
0x4010068c: free at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/umm_malloc/umm_malloc.c:1734
0x40220668: operator delete(void*) at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/abi.cpp:57
0x40218843: std::_Function_base::_Base_manager<std::_Bind<std::_Mem_fn<void (MDNSResponder::*)()> (MDNSResponder*)> >::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation) at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/libraries/ESP8266mDNS/ESP8266mDNS.cpp:401
0x40222c80: std::_Function_base::~_Function_base() at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/functional:2031
0x40218f1d: MDNSResponder::_listen() at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/libraries/ESP8266mDNS/ESP8266mDNS.cpp:401
0x4021f0a0: Print::println() at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/Print.cpp:87
0x4021f0c4: Print::println(__FlashStringHelper const*) at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/Print.cpp:87
0x40107aa9: __digitalWrite at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring_digital.c:84
0x4023ce8e: wifi_get_opmode at ??:?
0x4021fbab: String::reserve(unsigned int) at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/WString.cpp:519
0x402166f4: ESP8266WiFiSTAClass::status() at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp:510
0x402151e0: loop at /home/danielm/Arduino/core/core.ino:1052
0x4010068c: free at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/umm_malloc/umm_malloc.c:1734
0x40201312: delay at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring.c:53
0x4021fb00: String::~String() at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/WString.cpp:519
0x4020c498: PowerSensor::writeCalibrationSettings() at /tmp/build90d29aedfc73faf1bed5fd3965104930.tmp/sketch/PowerSensor.cpp:377
0x4020df84: unmountStorage() at /home/danielm/Arduino/core/core.ino:857
0x40211cfc: setup at /home/danielm/Arduino/core/core.ino:857
0x40220788: loop_wrapper at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_main.cpp:56
0x40100720: cont_norm at /home/danielm/arduino-esp8266/hardware/esp8266com/esp8266/cores/esp8266/cont.S:109