[uClibc]Re: Malloc problem

Doriguzzi Roberto doriguzzi at neuricam.com
Tue Oct 15 09:05:36 UTC 2002


Hello Miles, Thank you for the answer.

I wrote a simple piece of code like this:

int main()
{
  unsigned char *Frame;
  int i,k;

  k = 0;
  while(1)
  {
    Frame = (unsigned char *)malloc(0x100*0x100);

    for(i=0;i<0x10000;i++) Frame[i] = 0;

    k++;
    printf("N: %d\n",k);

    free(Frame);
  }
}

If I compile it with the glibc library it works for an infinite period of time.
If I compile it with the uclibc library it works until the memory (about 7 MB
on my embedded system) finishes. Always I get the message "Terminated". I
checked the memory while the program was running so now I can say that it's a
malloc problem.

Thanks, Roberto.


Miles Bader wrote:

> Doriguzzi Roberto <doriguzzi at neuricam.com> writes:
> > I've got a serious problem with malloc. I tried MALLOC = malloc and
> > MALLOC = malloc-930716 but the rusult was the same: every application
> > crash down because it can' t free the memory.
> > I'm using the latest uclibc (0.9.15) with the 2.4.18 kernel. The
> > processor is an ARM 720T running at 73 Mhz.
>
> What do you mean by `crash'?  Why do you think it's a problem with malloc?
>
> Did it print a message?  Did you use a debugger?  More details, please!
>
> -Miles
> --
> [|nurgle|]  ddt- demonic? so quake will have an evil kinda setting? one that
>             will  make every christian in the world foamm at the mouth?
> [iddt]      nurg, that's the goal




More information about the uClibc mailing list