I have stopped the problem but I am not sure of the root cause.  It does not 
seem to have anything to do with LWIP itself.  I was using a utility feature 
supplied by STM that prints debug messages to the LCD screen on the evaluation 
board.  When I reduced the number of messages and text length, the Assert 
stopped occurring.

From: Patrick Klos <patr...@klos.com>
Sent: Thursday, September 27, 2018 5:23 AM
To: lwip-users@nongnu.org
Cc: Greenwood, Gregory A. [US-US] <gregory.a.greenw...@leidos.com>
Subject: EXTERNAL: Re: [lwip-users] Pbuf Assert

On 9/26/2018 9:53 PM, Greenwood, Gregory A. wrote:
I cannot figure out why I am getting an Assert in pbuf.c at line 747:
    LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
I know the obvious answer, in the p->ref cannot be 0.
The problem is that I cannot tell what would cause p->ref to be 0.
And this is occurring in a while loop that depends on p != NULL.
I am using the LWIP that comes from CubeMX for STM32H7.
LWIP version 2.0.3.

Until someone with better information responds, let me venture a guess for you:

I think that ASSERT implies the pbuf has been dereferenced (freed) more than it 
has been referenced.  Check that you're not freeing the pbuf more than once.

Patrick Klos
Klos Technologies, Inc.
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to