public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: David Brennan <eCos@brennanhome.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: eCos Discussion List <ecos-discuss@sources.redhat.com>
Subject: Re: [ECOS] Memory allocation failure
Date: Sat, 07 May 2005 07:54:00 -0000	[thread overview]
Message-ID: <427C29C0.80000@brennanhome.com> (raw)
In-Reply-To: <20050506201207.GJ31731@lunn.ch>



Andrew Lunn wrote:

>On Fri, May 06, 2005 at 06:57:19AM -0700, David Brennan wrote:
>  
>
>>I have created two different applications with the same eCos 
>>configuration and essentially the same code base. One trivial 
>>application which is missing most of the meat of the main application. 
>>The trivial application runs fine. However when I try and start the real 
>>application, it dies during my static constructors. I have traced the 
>>problem down to a malloc call, but GDB eventually hangs while trying to 
>>single step through there. It always hangs at this one particular 
>>malloc, when constructing one particular instantiation of a class. Any 
>>ideas? Is there a fixed number of pool elements which can be allocated 
>>using dlmalloc?
>>Target is i386 VME based PC.
>>    
>>
>
>A total guess.....
>
>You say this is a constructor. When is the constructor called? Is it a
>static constructor which will be called early during startup? 
>
It is a static constructor, using the default constructor init priority. 
However, the application has already run a lot of other static 
constructors by the time this happens. (Our application actually has its 
own heap manager, which says that we have allocated over 10Meg of heap 
around the time of the crash.)

Another engineer posed the question to me, "Whose stack are the 
constructors using, and how big is it?" A question which I cannot 
answer. Is there a configuration option for that stack space? We had a 
problem with VxWorks, which tried to run all of the constructors with 
too small of a stack.

>Have you
>checked that malloc's constructor has already been called so that
>malloc itself is read to be called?
>
>  
>
Based on the population of the mypool variable, it looks like the 
constructor ran. I did not specifically test that. But I would assume 
that would be a problem for all of eCos if the malloc is not one of the 
first things constructed.

Dave

>        Andrew
>
>
>  
>

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

  reply	other threads:[~2005-05-07  2:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-06 13:57 David Brennan
2005-05-06 20:46 ` Andrew Lunn
2005-05-07  7:54   ` David Brennan [this message]
2005-05-09  8:16     ` Andrew Lunn
2005-05-10 10:03       ` David Brennan
2005-05-07 16:19 ` Edgar Grimberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=427C29C0.80000@brennanhome.com \
    --to=ecos@brennanhome.com \
    --cc=andrew@lunn.ch \
    --cc=ecos-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).