[ECOS] eCos 1.3.1 to eCos2 problems

Andrew Lunn andrew.lunn@ascom.ch
Thu Dec 19 02:53:00 GMT 2002


On Thu, Dec 19, 2002 at 11:44:53AM +0100, Fredrik Hederstierna wrote:
> Thanks for helping us,
> we sorted the CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO problem out
> we are defining our own malloc() which seems to override a weak eCos-malloc().
> When std-streams are constructed it calls malloc it buffered io is selected.
> 
> Can this be a problem - what other memory is using malloc() when starting up
> eCos2?? I believe eCos1.3.1 works fine when overriding malloc().
> Can all mallocs() be disabled? I thought all mem was allocated static.

All memory for the KERNEL package is statically allocated. Other
packages do use dynamic memory. 

You need to ensure that your malloc code is initialized early on. You
probably need a constructor with highish priority, or make the first
call to malloc do the initialisation.

> We havent found the crash yet, but perhapps these problems are
> related. 

Could be. Your malloc may of given out a bad pointer before it was
initialized. This is not used, or at least nothing important is
stomped over, until sometime later which then causes the crash.

        Andrew

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list