[Top][All Lists]

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

[lwip-devel] [bug #29375] Error in memp_malloc with CVS Head Revision

From: EisenkolbThomas
Subject: [lwip-devel] [bug #29375] Error in memp_malloc with CVS Head Revision
Date: Wed, 31 Mar 2010 11:29:18 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/20100316 Firefox/3.6.2 (.NET CLR 3.5.30729)

Follow-up Comment #2, bug #29375 (project lwip):

Okay I have now tried a few things with the mem_free and the memp_free.

At first there in the mem_free there is no security in the case of a zero
pointer in void *rmem.
Maybe you can include ther same as in memp_free.
In my Opinion this is very important because in the case of a zero pointer,
the pointer is decremented to nonzero and after that the memp_free identifies
a bad pointer.

In the next step, I tried to free an item twice.
I am sure I am not the only one who does a mistake in the freeing of memory.
If you do it twice beacuse of any reason, not the memory pool where the item
was allocated will be decremented and freed but the memory pool at the index
before will be decremented.
As I have found this is the reason for my 0xffff or 0xfffb in the stats of
the pools.

So if you allocate 3 pools of the following sizes.
 - 3 x 200 byte
 - 3 x 600 byte
 - 3 x 1500 byte

If you know free an item of the 1500 buffer two times, at the second time not
the item in the 1500 buffer but the 600 buffer is modified.

I fyou than allocate an item from the 600 buffer, there can happen anything
and this is the reason why my controller gets a hard fault.

Is it possible to include a mechanism, that freeing an item 2 times doesn't

Thanks a lot and I hope my description is helpful.


Reply to this item at:


  Nachricht geschickt von/durch Savannah

reply via email to

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