[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #43437] Memory corruption beyound memory pool
From: |
Piotr |
Subject: |
[lwip-devel] [bug #43437] Memory corruption beyound memory pool |
Date: |
Sat, 18 Oct 2014 21:09:56 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0 |
Follow-up Comment #2, bug #43437 (project lwip):
I saw it "in action" :)
The "ram" is set like this:
ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER);
So, it points to a buffer, which is reserved outside LwIP. I have reserved
this buffer to be e.g:
u8_t a_buffer[MEM_SIZE];
then (lwipopts.h):
#define LWIP_RAM_HEAP_POINTER a_buffer
It is clear that code in mem_init sets "ram_end" to the end of the buffer and
hence all writings to this structure corrupt variables located after the
pool.
Simple workaround
u8_t a_buffer[MEM_SIZE+8];
Fixes it.
Maybe I have missed something from the "porting" steps, that could be the case
as well.
Ragards,
Piotr.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?43437>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/