From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16178 invoked by alias); 7 May 2005 02:36:42 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 16138 invoked from network); 7 May 2005 02:36:37 -0000 Received: from unknown (HELO smtp816.mail.sc5.yahoo.com) (66.163.170.2) by sourceware.org with SMTP; 7 May 2005 02:36:37 -0000 Received: from unknown (HELO brennanhome.com) (zzxxyyzz@sbcglobal.net@69.232.156.213 with login) by smtp816.mail.sc5.yahoo.com with SMTP; 7 May 2005 02:36:36 -0000 Received: (qmail 2589 invoked from network); 7 May 2005 02:36:35 -0000 Received: from localhost.brennanhome.cxm (HELO ?127.0.0.1?) (127.0.0.1) by brennanhome.com with SMTP; 7 May 2005 02:36:35 -0000 Message-ID: <427C29C0.80000@brennanhome.com> Date: Sat, 07 May 2005 07:54:00 -0000 From: David Brennan User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) MIME-Version: 1.0 To: Andrew Lunn CC: eCos Discussion List References: <427B77BF.5010302@brennanhome.com> <20050506201207.GJ31731@lunn.ch> In-Reply-To: <20050506201207.GJ31731@lunn.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [ECOS] Memory allocation failure X-SW-Source: 2005-05/txt/msg00100.txt.bz2 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