[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #37148] memory pool content is being corrupted after m
From: |
Artem Pisarenko |
Subject: |
[lwip-devel] [bug #37148] memory pool content is being corrupted after memp_free() |
Date: |
Mon, 20 Aug 2012 03:19:48 +0000 |
User-agent: |
Opera/9.80 (Windows NT 6.1; WOW64; U; ru) Presto/2.10.289 Version/12.01 |
URL:
<http://savannah.nongnu.org/bugs/?37148>
Summary: memory pool content is being corrupted after
memp_free()
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: jblackarty
Submitted on: Mon 20 Aug 2012 10:19:48 AM OMSST
Category: None
Severity: 3 - Normal
Item Group: Faulty Behaviour
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release:
lwIP version: 1.4.0
_______________________________________________________
Details:
If MEMP_OVERFLOW_CHECK == 0 then
/* No sanity checks
* We don't need to preserve the struct memp while not allocated, so we
* can save a little space and set MEMP_SIZE to 0.
*/
#define MEMP_SIZE 0
"Saving a little space" results in situation where following code
void memp_free(memp_t type, void *mem)
{
...
memp = (struct memp *)(void *)((u8_t*)mem - MEMP_SIZE);
...
memp->next = memp_tab[type];
...
}
rewrites pool contents !
For example, it makes impossible to use custom defined pools to preallocate
system objects in lwip port. (Did anybody tried to implement it before me?)
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?37148>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #37148] memory pool content is being corrupted after memp_free(),
Artem Pisarenko <=