LwIP pbuf/memp corruption Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Posts: 3
Joined: Thu Apr 25, 2019 2:39 pm

Re: LwIP pbuf/memp corruption

Postby aleo » Tue May 07, 2019 10:50 pm


I noticed that in the bug tracking for this issue it was marked as resolved with a comment from you "Fixed by lwIP 2.0 merge" (https://sourceforge.net/p/chibios/bugs/729/), but your last comment on this thread was half a year later and seems to imply the issue may not have been resolved.

I wanted to see if this was successfully patched in one of the stable releases, as it may be causing a problem I'm having.

User avatar
Site Admin
Posts: 12294
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 590 times
Been thanked: 503 times

Re: LwIP pbuf/memp corruption

Postby Giovanni » Wed May 08, 2019 7:37 am


On the tracker there is another issue not yet resolved: https://sourceforge.net/p/chibios/bugs/1009/

Could this be causing your problem? anyway, if you have a better understanding of the problem could you suggest a fix?


Posts: 626
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 5 times
Been thanked: 87 times

Re: LwIP pbuf/memp corruption

Postby steved » Wed May 08, 2019 8:52 pm

Having re-read this thread, I would say that the originally reported problem has been fixed. The relevant bit of code is:

Code: Select all

    if (mask & FRAME_RECEIVED_ID) {
      struct pbuf *p;
      while (low_level_input(&thisif, &p)) {
        if (p != NULL) {
          struct eth_hdr *ethhdr = p->payload;
          switch (htons(ethhdr->type)) {
            /* IP or ARP packet? */
            case ETHTYPE_IP:
            case ETHTYPE_ARP:
              /* full packet send to tcpip_thread to process */
              if (thisif.input(p, &thisif) == ERR_OK)
              LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
          /* Falls through */

So buffer is allocated in low_level_input().
It's then either passed to thisif.input() (which presumably frees it after processing) or its released in the above loop.

I think I've now used lwip sufficiently that any problem would have shown by now.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 2 guests