Page 1 of 1

occasional lwip "pbuf_free: p->ref > 0" assert

Posted: Wed Jan 27, 2021 12:10 pm
by dedvalson
Hi,

I am seeing a very occasional "pbuf_free: p->ref > 0" running ESP-IDF v4.1-rc-15-gbd72a9ab2-dirty

The application uses many network features (SNTP, DHCP client, TCP, UDP, AWS IoT client). It also coexists with BT.

It will often run for days, sometimes weeks, but will eventually hit this assert. I have two different stack traces that I have gathered. They come in through a different path in either case.

Here is the first:

Code: Select all

0x40092cdd: abort at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/esp32/panic.c:735
0x40202f84: __assert_func at /builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/xtensa-esp32-elf/src/newlib/newlib/libc/stdlib/assert.c:62 (discriminator 8)
0x40179845: pbuf_free at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/lwip/lwip/src/core/pbuf.c:1299
0x40181980: etharp_input at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/lwip/lwip/src/core/ipv4/etharp.c:757 (discriminator 6)
0x401878a9: ethernet_input at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/lwip/lwip/src/netif/ethernet.c:205
0x40177659: tcpip_thread_handle_msg at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/lwip/lwip/src/api/tcpip.c:596
 (inlined by) tcpip_thread at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/lwip/lwip/src/api/tcpip.c:154
Here is the second:

Code: Select all

0x40177659:0x3ffe37600x40092888: invoke_abort at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/esp32/panic.c:735
0x40092cdd: abort at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/esp32/panic.c:735
0x40202f84: __assert_func at /builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/xtensa-esp32-elf/src/newlib/newlib/libc/stdlib/assert.c:62 (discriminator 8)
0x40179845: pbuf_free at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/lwip/lwip/src/core/pbuf.c:1299
0x40183a83: ip6_input at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/lwip/lwip/src/core/ipv6/ip6.c:1325
0x401878bd: ethernet_input at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/lwip/lwip/src/netif/ethernet.c:229
0x40177659: tcpip_thread_handle_msg at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/lwip/lwip/src/api/tcpip.c:596
 (inlined by) tcpip_thread at C:/esp32chains/8.2-8.1-R6/esp-idf/v4.1a/components/lwip/lwip/src/api/tcpip.c:154
I have code in my app that logs free heap periodically and I do not see any reduction in available heap (either Internal or SPI) prior to a crash. I am hoping for some suggestions of something I could do to diagnose this further.

I have attached my sdkconfig file.

Please let me know if you have any suggestions.

Thanks,

Don