lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] lukem-pbuf crashes?


From: lukem . lwip
Subject: Re: [lwip-devel] lukem-pbuf crashes?
Date: Tue, 4 May 2004 09:25:01 +1000 (EST)

On Mon, 3 May 2004 address@hidden wrote:
> The code halts on the assertion     LWIP_ASSERT("buf_take()\n", *x==NULL);
> in pbuf_take() in pbuf.c
>
> My UDP server app runs fine, but as soon as I want to use my UDP client
> (running on the same stack) this assertion fails. It doesn't dependent on
> uptime.
>
> Another strange thing is that my DHCP client (also UDP) runs just fine...
> Maybe it depends on the pbuf types used or something.

The reason for this seems to be:

mem_malloc() returns NULL (ie. out of memory)
causing
pbuf_ram_alloc() to return NULL
causing
pbuf_ref_take() to return NULL
causing
pbuf_take() to hit that assert

I will change this to follow what I now understand the old implementation
to do --- return NULL on failure. I was concerned about how this would
effect etharp.c, as it uses the return value of pbuf_take() without
checking for NULL.

I have just checked in a fix, let me know how you go with it.

--
Luke




reply via email to

[Prev in Thread] Current Thread [Next in Thread]