lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] netbuf_delete failure in LwIP 1.3.0


From: Kieran Mansley
Subject: Re: [lwip-users] netbuf_delete failure in LwIP 1.3.0
Date: Mon, 26 Sep 2011 15:03:10 +0100

On Sat, 2011-09-24 at 16:30 -0700, farpart103 wrote:
> The data is received and the
> application program acts on the data until MEMP_NUM_NETBUF - 1 packets have
> been received. At this time the next call to netbuf_recv never returns.
>
> P.S.  the code in question is available on request.

See:
http://lwip.wikia.com/wiki/Netconn_receive

I'm not sure why you need to call netbuf_new() and netbuf_delete().
What do you do with the netbuf you allocate?  As far as I can remember
there's no way to pass this in to the receive function, especially in
1.3.0.  I think what is happening is:

1) You allocate a netbuf by calling netbuf_new()
2) You call netconn_recv() which gives you its own netbuf
3) You handle the data and call netbuf_delete() which frees one of the
two from above (not sure which), leaving the other as leaked.
4) After you repeat this MEMP_NUM_NETBUF times you've leaked all the
netbufs.

Kieran




reply via email to

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