Checker V0.1  (c) 1993 Tristan Gingold
Checker will be a free and GNU implementation of Purify(tm).

Hello!
This is the next and really better version of Checker.
The main feature added is code insertion and check for each pointer at
 run time !!

Checker is a library which can be used instead of the standard malloc.
The malloc of Checker is very robust, and warns you at each bad call.
Checker implements an garbage collector (In fact, a garbage detector).
Checker warns you each time you use a bad pointer. See the example
These three features help the programmer.

Checker is based on:
 the GNU Malloc written by Mike Haertel,
 nlist.c from the GNU libc,
 objdump.c from GNU Binutils v1.9,
 and of course my work.
It use gas V2.1.1 with some patches.
Checker has been only tested on Linux. But all the code, except functions
which handle the stack, the symbol table, and the address extractor must
work on other machine.

If checker is very robust, but it is slower than GNU Malloc.
Robust means that you can't cheat malloc. Checker warns you when
	o You call free or realloc before malloc
	o You try to free a free zone
	o You call free with a different address
Futhermore, Checker malloc try to be the most secure as possible: If you
alloc a zone, then free it, alloc another zone of the same size, refreeing
the first zone produce, in some case, a warning.
Checker implements a garbage detectors, which can be called in the program
or by a debuger, such as gdb.
The garbage detector displays all the family of memory leaks (or leaks),
with the functions which called malloc.

Checker comes with a special version of gas, which insert code:
Here the bogus file example.c
	#include <malloc.h>

	int main()
	{
	 char *zone=malloc(20);
	 char *ptr=NULL;
	 int i;
	 char c;
 
	 c=zone[1];	/* error: read an uninitialized char */
	 c=zone[-2];	/* error: read before the zone */
	 zone[25]=' ';  /* error: write after the zone */
	 *ptr = 2;	/* error: use a NULL pointer, must produce a core */
	}
To compile:
gcc -checker -o example.o example.c -g -c
gcc -o example example.o libchecker.o -g
( you can try 'gcc -o example -checker example.c', but it will use the
  checkered ibrairy and Checker will display some memory access errors... )
and then:
%./example
From Checker:
	Memory access error
	When Reading at address 0x1b015
	inside the heap
	1 bytes after the begin of the block
From Checker:
	The block was allocated from:
	 pc=0x000008ec in malloc() at malloc.c:425
	 pc=0x00000066 in main() at example.c:5
	 pc=0x0000002a in _entry() at /usr/lib/crt0.o:0
From Checker:
	Stack frames are:
	 pc=0x0000008b in main() at example.c:10
	 pc=0x0000002a in _entry() at /usr/lib/crt0.o:0
From Checker:
	Memory access error
	When Reading at address 0x1b012
	inside the heap
	2 bytes before the begin of the block
From Checker:
	The block was allocated from:
	 pc=0x000008ec in malloc() at malloc.c:425
	 pc=0x00000066 in main() at example.c:5
	 pc=0x0000002a in _entry() at /usr/lib/crt0.o:0
From Checker:
	Stack frames are:
	 pc=0x000000a5 in main() at example.c:11
	 pc=0x0000002a in _entry() at /usr/lib/crt0.o:0
From Checker:
	Memory access error
	When Writing at address 0x1b02d
	inside the heap
	5 bytes after the end of the block
From Checker:
	The block was allocated from:
	 pc=0x000008ec in malloc() at malloc.c:425
	 pc=0x00000066 in main() at example.c:5
	 pc=0x0000002a in _entry() at /usr/lib/crt0.o:0
From Checker:
	Stack frames are:
	 pc=0x000000bf in main() at example.c:12
	 pc=0x0000002a in _entry() at /usr/lib/crt0.o:0
From Checker:
	Memory access error
	When Writing at address 0x0
	inside the null pointer zone
	You probably use a NULL pointer.
	THIS WILL PRODUCE A SEGMENTATION FAULT.
From Checker:
	Stack frames are:
	 pc=0x000000cf in main() at example.c:13
	 pc=0x0000002a in _entry() at /usr/lib/crt0.o:0
segmentation fault.

To see other features, see try_*.c files.

So, now Checker is nearly as good as Purify(tm) (in term of features).

NOTE: This version of Checker *does* include the standard librairies (libc)
 compiled by Checker.

If you like Checker, see the TODO file...
If you found a bug, have a suggestion, dislike Checker, want to make it
better, want to port it, found an English mistake, email me:
 Tristan C/O marc@david.saclay.cea.fr
I can send you a reply in about 24 hours.

Checker could become a GNU package.

Good Luck.