bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with glibc


From: Andreas Schwab
Subject: Re: Problems with glibc
Date: 14 May 2001 18:22:36 +0200
User-agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.0.104

"Miola, Marcelo de Brito" <address@hidden> writes:

|>      Hi,
|> 
|>              I'm developing a simulator for real-time systems at
|> University of Sao Paulo State (Brazil) and I'm having serious problems
|> with glibc. When I start my simulator, it crashes always in the same place
|> and it gives me the following error:
|> 
|>              Segmentation fault (core dumped)
|> 
|>              Actually, I'm using the glibc v. 2.1.3-22 and this error
|> occurs in the following code:
|> 
|>              void *wmalloc(int size){
|>                 void *new=NULL;
|>                    printf("\nRequired memory: %d.\n",size);
|>                 if(size<=0)
|>                       wmemerr(2); //wmemerr is a routine to print error
|>                                //messages caused by memory leaks
|>                 /* the program crashes in the following line */
|>                 new=(void *)malloc(size);

If you need to cast the return value of malloc you are most likely doing
something seriously wrong.  Did you include <stdlib.h>?

Andreas.

-- 
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
address@hidden
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5



reply via email to

[Prev in Thread] Current Thread [Next in Thread]