This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: malloc not allocing


Jonathan Larmour <jifl@eCosCentric.com> writes:

> David N. Welton wrote:

> > Going off of what I did earlier:
> > http://sources.redhat.com/ml/ecos-discuss/2002-05/msg00226.html I
> > was trying to recreate my app, using the same setup.  For some
> > reason I can't figure out, it no longer seems to be working - the
> > app bails out because it can't malloc memory any more.  Any
> > thoughts on how to go about tracking this down?

> Are you sure this is the MLT map actually used in your app? In the
> example in that link, that's for floppy startup only.

Yes, I use the floppy setup.  That's what's in my config file, and
I've run 'ecosconfig tree' with that.

> What does mallinfo() say?

It's interesting:

mallocing 192 bytes at 8e7e8
(mallinfo)arena: 33043616 ordblks: 2 smblks: 0 hblks: 0 hblkhd: 0 usmblks: 0 fsm
blks: 0 uordblks: 0 fordblks: 32970576 keepcost: 0 maxfree: 32970564
ficlInitSystemEx malloc
mallocing 41068 bytes at 8e8b0
(mallinfo)arena: 33043616 ordblks: 2 smblks: 0 hblks: 0 hblkhd: 0 usmblks: 0 fsm
blks: 0 uordblks: 0 fordblks: 32929504 keepcost: 0 maxfree: 32929492
foo is at 8e8b0
mallocing 80108 bytes at 98920
(mallinfo)arena: 33043616 ordblks: 0 smblks: 0 hblks: 0 hblkhd: 0 usmblks: 0 fsm
blks: 0 uordblks: 33043586 fordblks: 0 keepcost: 0 maxfree: 0
foo is at 98920
mallocing 940 bytes at 0
(mallinfo)arena: 33043616 ordblks: 0 smblks: 0 hblks: 0 hblkhd: 0 usmblks: 0 fsm
blks: 0 uordblks: 33043586 fordblks: 0 keepcost: 0 maxfree: 0
foo is at 0
mallocing 41068 bytes at 0
(mallinfo)arena: 33043616 ordblks: 0 smblks: 0 hblks: 0 hblkhd: 0 usmblks: 0 fsm
blks: 0 uordblks: 33043586 fordblks: 0 keepcost: 0 maxfree: 0

> You could see what address the linker put __heap2 at by searching
> for it in the output of i386-elf-nm on your ELF image (not the
> .bin).

This doesn't look quite right?

davidw@arqua:~/workshop/ecos2-ficl/ficl$ nm embficl | grep heap
00015c84 t _GLOBAL_.D.47000.cygmem_memalloc_heaps
00015c6c t _GLOBAL_.I.47000.cygmem_memalloc_heaps
0008e5b0 A __heap1
0008e5b0 A __heap2
00024674 D cygmem_memalloc_heaps
00026960 B cygmem_pool_heap1
00026d80 B cygmem_pool_heap2

Thankyou for your time,
-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]