lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] Possible memory leak (at least in my system)


From: David Haas
Subject: [lwip-users] Re: [lwip] Possible memory leak (at least in my system)
Date: Wed, 08 Jan 2003 23:44:26 -0000

I sent this message yesterday, but it never made it to the list. Am I being
blocked by some misguided anti-spam effort?

Anyway I was thinking about this some more and looking at the code. I think
sys_mbox_new() should take a size parameter for the mailbox size OR
sys_mbox_post() should return an error code. Something needs to be done to
ensure that sys_mbox_post() either does not fail or that it returns an error
code to show that it did fail.

Text of yesterday (Tuesday's) mail...

I was thinking about this message that I wrote after I went home yesterday
and I think I missed something. Unfortunately I am out sick today and while
I have access to my email, I don't have access to the source code.

I think lwip is using the number of msg buffers from memp_malloc to insure
that you can always put a frame in the queue. In other words the queue must
be larger than the number of msg buffers. And tcpip_input gets it's own
private supply of msg buffers. Is that the case?

If so, then there is no memory leak. But a few comment lines in tcpip_input
would have helped me.

Thanks,
David.

----- Original Message -----
From: David Haas
To: address@hidden
Sent: Monday, December 02, 2002 5:04 PM
Subject: [lwip] Possible memory leak (at least in my system)


I am having a problem with the way sys_mbox_post() is designed. It does not
return an error code, but in my system I cannot guarantee that the post will
always be successful. In fact if frames come in faster than the tcpip thread
can process them, then the mbox is bound to be full. I am calling
tcpip_input from an ISR, so I cannot suspend. I must drop the frame if the
mbox is full. So I need an error return from sys_mbox_post() and
tcpip_input() must free the pbuf if it gets this error. As it is now, when
the mbox post fails, that pbuf chain is lost.

I will make this change in my code, but I request that you do so everywhere.
Should I submit a patch? It will be quite a few files.

David Haas
NBS Card Technology
70 Eisenhower Drive,
Paramus, NJ 07652
Voice: 201-845-7373 x183
Fax: 201-845-3337
email: address@hidden

[This message was sent through the lwip discussion list.]




reply via email to

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