Category : Linux Files
Archive   : MCHECKR2.ZIP
Filename : INTRO

 
Output of file : INTRO contained in archive : MCHECKR2.ZIP

Checker V0.2 (c) 1993 Tristan Gingold
Checker is a memory access detector and garbage collector.

Hello!
This is the new version of Checker.
The main feature added is code insertion on stack.
This version has less bugs than Checker V0.1
Now, I can run a checkered version of GAS, without errors.

Checker is a package that allow you to compile a program with code inserted.
This code will check, at run time, all memory access. If one is bad, it will
display a warning. See the example bellow.
Checker is a library that can be used instead of the standard malloc.
The malloc of Checker is very robust, and warns you at each bad call.
Checker implements a garbage collector (In fact, a garbage detector).
Checker contains a new version of GAS, to perform code insertion.
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 uses gas V2.1.1 with some patches.

Checker has been only tested on Linux.

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 tries to be as secure as possible: If you
alloc a zone, then free it, alloc another zone of the same size, refreeing
the first zone produces, in some cases, a warning.
Checker implements a garbage detector that can be called in the program
or by a debugger, such as gdb.
The garbage detector displays all the memory leaks
with the functions which called malloc.

Here's a bogus file example.c
#include

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 -c
gcc -o example example.o libchecker.o -checker
and then:
% ./example
This program has been compiled with '-checker' option.
Checker is a memory access detector.
Checker is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
For more information, set CHECKEROPTS to '-h'

From Checker:
Memory access error
When Reading at address 0x15015
inside the heap
1 bytes after the begin of the block
From Checker:
The block was allocated from:
pc=0x00000920 in malloc() at malloc.c:425
pc=0x00000060 in main() at example.c:5
pc=0x0000002a in _entry() at /usr/lib/chkrcrt0.o:0
From Checker:
Stack frames are:
pc=0x00000085 in main() at example.c:10
pc=0x0000002a in _entry() at /usr/lib/chkrcrt0.o:0
From Checker:
Memory access error
When Reading at address 0x15012
inside the heap
2 bytes before the begin of the block
From Checker:
The block was allocated from:
pc=0x00000920 in malloc() at malloc.c:425
pc=0x00000060 in main() at example.c:5
pc=0x0000002a in _entry() at /usr/lib/chkrcrt0.o:0
From Checker:
Stack frames are:
pc=0x0000009f in main() at example.c:11
pc=0x0000002a in _entry() at /usr/lib/chkrcrt0.o:0
From Checker:
Memory access error
When Writing at address 0x1502d
inside the heap
5 bytes after the end of the block
From Checker:
The block was allocated from:
pc=0x00000920 in malloc() at malloc.c:425
pc=0x00000060 in main() at example.c:5
pc=0x0000002a in _entry() at /usr/lib/chkrcrt0.o:0
From Checker:
Stack frames are:
pc=0x000000b9 in main() at example.c:12
pc=0x0000002a in _entry() at /usr/lib/chkrcrt0.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=0x000000c9 in main() at example.c:13
pc=0x0000002a in _entry() at /usr/lib/chkrcrt0.o:0
segmentation fault.

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

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

If you like Checker, use it, and try to find bugs anywhere....
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 [email protected]
I can send you a reply during the week end.

Checker could become a GNU package.

Good Luck.