From mboxrd@z Thu Jan 1 00:00:00 1970 From: albaugh@agames.com (Mike Albaugh) To: help-gcc@gnu.org Subject: Re: Segmentation Fault: new char[12] Date: Wed, 08 Dec 1999 10:35:00 -0000 Message-id: <82m7qn$pji$2@null.agames.com> References: <82jp3a$pal$1@nnrp1.deja.com> <82kesh$994$1@nnrp1.deja.com> <82ls9f$8il$1@nnrp1.deja.com> X-SW-Source: 1999-12/msg00120.html atharaken@my-deja.com wrote: : Any free tools to detect memory leaks!!! Purify and Insure both cost a : lot. Any others! I don't think the "memory leak" is your biggest problem. The visible result of a memory leak is that malloc() returns 0 after some amount of time, but your code checks for that. Getting a _SEGFAULT_ from malloc() (or free(), or whatever) is almost always caused by your application corrupting the malloc "headers" that are often stored adjacent to the allocated memory. You need to be looking for array-bounds violations, not memory-leaks. Mike | albaugh@agames.com, speaking only for myself From mboxrd@z Thu Jan 1 00:00:00 1970 From: albaugh@agames.com (Mike Albaugh) To: help-gcc@gnu.org Subject: Re: Segmentation Fault: new char[12] Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: <82m7qn$pji$2@null.agames.com> References: <82jp3a$pal$1@nnrp1.deja.com> <82kesh$994$1@nnrp1.deja.com> <82ls9f$8il$1@nnrp1.deja.com> X-SW-Source: 1999-12n/msg00120.html Message-ID: <19991231222400.riFUwk_yLRUYWpRSvsSe8RjsrYKh8tWQcbLLMlMoO-g@z> atharaken@my-deja.com wrote: : Any free tools to detect memory leaks!!! Purify and Insure both cost a : lot. Any others! I don't think the "memory leak" is your biggest problem. The visible result of a memory leak is that malloc() returns 0 after some amount of time, but your code checks for that. Getting a _SEGFAULT_ from malloc() (or free(), or whatever) is almost always caused by your application corrupting the malloc "headers" that are often stored adjacent to the allocated memory. You need to be looking for array-bounds violations, not memory-leaks. Mike | albaugh@agames.com, speaking only for myself