On 3/29/07, Dave Hylands <[EMAIL PROTECTED]> wrote:
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/
Well, last night I added: override LDFLAGS = -Wl,--section-start,.data=0x802100,--defsym=__heap_end=0x80A0ff,,--defsym=__malloc_heap_end=0x80A0ff,--defsym=__malloc_heap_start=0x8080ff,-Map=$(PRG).map,--cref -lm -u vfprintf -u vfscanf -lprintf_flt -lscanf_flt -lm -lc And things look to be hunky-dory now. Of course, I accept that this could have just moved things around and covered the real bug up again, but I am suspicious either way. Steve _______________________________________________ AVR-libc-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avr-libc-dev
