Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!pt.cs.cmu.edu!ius2.cs.cmu.edu!edw From: edw@ius2.cs.cmu.edu (Eddie Wyatt) Newsgroups: comp.lang.c Subject: Re: Micro Soft C v.4.0 allocation problem Message-ID: <1145@ius2.cs.cmu.edu> Date: Wed, 6-May-87 09:57:22 EDT Article-I.D.: ius2.1145 Posted: Wed May 6 09:57:22 1987 Date-Received: Sat, 9-May-87 00:40:41 EDT References: <1051@mit-amt.MEDIA.MIT.EDU> Distribution: world Organization: Carnegie-Mellon University, CS/RI Lines: 34 Keywords: alloc, calloc Just write a simple test program like the following: extern char *calloc(); main() { while (calloc((unsigned) 10) != NULL); printf("Returned NULL\n"); } You may want to check the addresses returned by calloc to may sure that they are all ascending or dsecending order. If they are not then this might, but not necessarily, indicate something is wrong with calloc. Since you are using calloc in a large system, there are many ways in which memory heap can get corrupted. Things I have run up against are: 1. accessing memory that was freed 2. over indexing arrays 3. not allocating enough memory for what I am storing SUN systems provide a debugging package for the memory allocation routines malloc_debug(level) and malloc_verify() in /usr/lib/debug/malloc.o. I don't know if your system does but I have these VERY useful. -- Eddie Wyatt e-mail: edw@ius2.cs.cmu.edu