lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] comments?


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] comments?
Date: Thu, 09 Jan 2003 02:11:51 -0000

On Thursday 14 March 2002 12.40, you wrote:
> To solve the incoming packet mem alignemnt problem i did the following
> things
>         I kept mem alignment to 4 .When pbuf_pool buf is alloced for
> incoming ethernet packet i add an offset of 2 to payload of  the first pbuf
> of chain .This makes it unaligned but ip header is aligned to 4 later on .
> On windows this seems  fine and no problem is encountered but on my
> platform i am getting a strange error that disappears as i use printfs
> inside code (sounds like a memory leak) . TCP connection is established
> with no problem but when httpd sends data an assert in pbuf_free function
> halts the system .
>
>   ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
>
> Note the problem disappers and things starts running fine as i turn on
> TCP_DEBUG
> Any comment or suggestions in this regard?

That sounds a lot like a race condition, because it dissapears when you 
introduce printfs and DEBUG statements. Where is the pbuf_free() called? Your 
device driver shouldn't call pbuf_free() for outgoing IP packets (that is 
handled by higher layers).

Hope that helps.

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]




reply via email to

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