public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] i386 Dynamic Memory Allocation Error
@ 2003-11-27  7:08 juelo ersono 
  2003-11-27  7:52 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: juelo ersono  @ 2003-11-27  7:08 UTC (permalink / raw)
  To: ecos-discuss

[-- Attachment #1: Type: text/plain, Size: 1431 bytes --]

Hi,

I'm using the i386 PC target with the all packages template (or net packages template). I have made no
changes in the configuration except changing startup type to FLOPPY and turning on Asserts & Tracing
option, and it seemes to work fine but I'm not able to allocate new memory. Take a look at this simple case:

//////////////
class Test
{
};

int main(void)
{
  new Test();
  return 0;
}
//////////////

When running the program I get following assertion fault:

ASSERT FAIL: <1>dlmalloc.cxx[767]void Cyg_Mempool_dlmalloc_Implementation::do_check_chunk()
(cyg_uint8 *)p + sz <= (cyg_uint8 *)(((mbinptr)((char*)&(av_[2*(0) + 2] - 2*(sizeof
(Cyg_Membool_dlmalloc_Implementation::Cyg_dlmalloc_size_t))))->fd)

I took a look at dlmalloc.cxx row 767 and got the information that this error only occurs when the
application has trashed the memory or if there are any coding errors in malloc. The simple program above
should not trash the memory, so I'll guess that there is a coding error?

Note that I have no problems with allocating memory at all using the i386 PC target with the default
packages template. Also I have tried this application on several different PC's and get the same error on all
of them.

Does anyone have any idea of why I get this error?

/Joel

____________________________________________________________
  Vad står det om dig på nätet? - http://www.lycos.se/



[-- Attachment #2: Type: text/plain, Size: 146 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] i386 Dynamic Memory Allocation Error
  2003-11-27  7:08 [ECOS] i386 Dynamic Memory Allocation Error juelo ersono 
@ 2003-11-27  7:52 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2003-11-27  7:52 UTC (permalink / raw)
  To: juelo ersono; +Cc: ecos-discuss

On Thu, Nov 27, 2003 at 08:08:17AM +0100, juelo ersono  wrote:
> Hi,
> 
> I'm using the i386 PC target with the all packages template (or net packages template). I have made no
> changes in the configuration except changing startup type to FLOPPY and turning on Asserts & Tracing
> option, and it seemes to work fine but I'm not able to allocate new memory. Take a look at this simple case:
> 
> //////////////
> class Test
> {
> };
> 
> int main(void)
> {
>   new Test();
>   return 0;
> }
> //////////////
> 
> When running the program I get following assertion fault:
> 
> ASSERT FAIL: <1>dlmalloc.cxx[767]void Cyg_Mempool_dlmalloc_Implementation::do_check_chunk()
> (cyg_uint8 *)p + sz <= (cyg_uint8 *)(((mbinptr)((char*)&(av_[2*(0) + 2] - 2*(sizeof
> (Cyg_Membool_dlmalloc_Implementation::Cyg_dlmalloc_size_t))))->fd)


I just run this on the synthetic target without problems.

To me it seems unlikely it is a problem with dlmalloc. More likely its
a heap problem.

Try running the test programs heaptest, dlmalloc[12] malloc[1-4].

    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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-11-27  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-27  7:08 [ECOS] i386 Dynamic Memory Allocation Error juelo ersono 
2003-11-27  7:52 ` Andrew Lunn

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).