Re: Debugging standard C library routines
- From: Richard Heathfield <invalid@xxxxxxxxxxxxxxx>
- Date: Sun, 01 Oct 2006 07:54:04 +0000
achintmehta@xxxxxxxxx said:
The application/software that is being run, is messing up the memory
due to which a subsequent malloc fails.
Initialise every pointer. Check every malloc/calloc/realloc to ensure it
succeeded before you rely on its return value. Check that every array
access is within bounds (0 to n - 1, for an array of n elements). Set
indeterminate ('dangling') pointers to NULL.
Following these simple steps will get rid of 99.90072% of all known
memory-related crashes.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.
- Follow-Ups:
- Re: Debugging standard C library routines
- From: Frederick Gotham
- Re: Debugging standard C library routines
- References:
- Debugging standard C library routines
- From: achintmehta
- Debugging standard C library routines
- Prev by Date: Re: Help with code (parse error)
- Next by Date: Re: rolling dice
- Previous by thread: Re: Debugging standard C library routines
- Next by thread: Re: Debugging standard C library routines
- Index(es):
Relevant Pages
|