avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] I thought I understood malloc


From: Dave Hylands
Subject: Re: [avr-libc-dev] I thought I understood malloc
Date: Thu, 29 Mar 2007 06:13:19 -0800

Hi Steve,

00803c18 D __malloc_heap_start
00803c1a D __malloc_heap_end

I'm looking at the avrlibc docs right now, and they seem to indicate that my
makefile should be instructing both heap_end and malloc_heap_end to be at
0x80A0FF.

Looking at the source code of avr-libc, it seems that _malloc_head_end
is a char * pointer that is initialized to &__heap_end.

So it's the contents of __malloc_heap_end not the address of
__malloc_heap_end that points to __heap_end.

Unfortunately, memory tramples are nasty bugs to find. They're often
caused by using functions such as strcpy, strcat, or sprintf and
providing buffers which are too small to hold the results.

This can occur on the stack or on the heap. Also check your stack to
make sure you're not getting stack overflow.

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/




reply via email to

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