Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!uunet!bcstec!misty!b-mrda!miller From: miller@b-mrda.ca.boeing.com (Mark Miller) Newsgroups: comp.os.msdos.programmer Subject: Re: Borland Turbo C 1.5 Message-ID: <24200009@b-mrda.ca.boeing.com> Date: 4 Jan 91 16:36:11 GMT References: <1991Jan3.125057.21477@cbnewsm.att.com> Organization: Boeing Commercial Airplanes MR&D Lines: 38 Sounds like a wild pointer. Look for one of the following instances: /* problem 1 */ char *p1; char *p2 = "Hello there"; strcpy(p2, p1); /* No memory allocated for p1 - overwrites other stuff */ /* problem 2 */ int array[10]; array[12] = 100; /* Writing past end of array */ /* problem 3 */ char array[4]; strcpy (array, "Four"); /* Trailing zero of string runs past end of array */ These and other such instances are tough to find. I have used the heapwalk() and heapcheck() functions to help in troubleshooting and to isolate the troublesome module. Also, check to see that all memory that you dynamically allocate (with malloc, calloc, etc.) is PROPERLY freed. That is, if you use farmalloc(), then you must use farfree() to free the allocated memory. Good luck. ------------------------------------------------------------------------------ Mark R. Miller | Boeing Commercial Airplane Company | Seattle, WA | Internet: miller@b-mrda.boeing.com | Voicenet: (206) 237-0960 | ------------------------------------------------------------------------------ Opinions expressed here do not necessarily reflect those of my employer. ------------------------------------------------------------------------------