From: SBPM Marc GINGOLD <marc@david.saclay.cea.fr>
Subject: New version of Checker in tsx-11
Date: Sat, 26 Feb 1994 17:41:04 GMT [thread overview]
Message-ID: <1994Feb26.174104.27970@cs.cornell.edu> (raw)
Checker V0.3 (c) 1993, 1994 Tristan Gingold
Hello! This is the new version of Checker. Checker is a debugging
tool suite which will find memory errors at runtime. As most programmers
know, runtime memory errors are difficult to track down; therefore, it is
likely that you will be well rewarded for taking the time to learn
how to use Checker!
Version 0.3 of Checker uses a new malloc, has support for language
internationalization, corrects several bugs, gives more information,
and is faster.
Checker is a package designed to find memory access errors and bad
usage of malloc at run time. When Checker finds an error, it displays
a warning along with the current stack frames. For more information
about this, see the example below.
The malloc library of Checker is very robust; however, it is slower than
GNU Malloc. Robust means that you can't cheat malloc. Checker warns you if
o You call free or realloc before you malloc the memory block
o You try to free an already free zone
o You call free with a bad address (not returned by malloc, calloc
or realloc)
Futhermore, Checker's malloc tries to be as secure as possible: when you free
a block, it becomes 'aged' and will be really freed after n calls to free in
order to catch bugs where you access a block after it has been freed and
when you try to free a block more than once.
Checker implements a garbage detector that can be called either in your
program or by a debugger, such as gdb. The garbage detector displays
all the memory leaks along with the functions that called malloc.
EXAMPLE:
Here's a 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:
% checkergcc -o example.o example.c -c
% checkergcc -o example example.o
and then run the program:
% ./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
General Public License for more details.
For more information, set CHECKEROPTS to '-h'
>From Checker:
Memory access error
When Reading at address 0xe9ed, inside the heap.
1 bytes after the begin of the block
The block was allocated from:
pc=0x00000347 in malloc() at malloc.c:164
pc=0x00000070 in main() at example.c:5
pc=0x0000003a in _entry() at /usr/lib/chkrcrt0.o:0
>From Checker:
Stack frames are:
pc=0x000000a2 in main() at example.c:10
pc=0x0000003a in _entry() at /usr/lib/chkrcrt0.o:0
>From Checker:
Memory access error
When Reading at address 0xe9ea, inside the heap.
2 bytes before the begin of the block
The block was allocated from:
pc=0x00000347 in malloc() at malloc.c:164
pc=0x00000070 in main() at example.c:5
pc=0x0000003a in _entry() at /usr/lib/chkrcrt0.o:0
>From Checker:
Stack frames are:
pc=0x000000c5 in main() at example.c:11
pc=0x0000003a in _entry() at /usr/lib/chkrcrt0.o:0
>From Checker:
Memory access error
When Writing at address 0xea05, inside the heap.
5 bytes after the end of the block
The block was allocated from:
pc=0x00000347 in malloc() at malloc.c:164
pc=0x00000070 in main() at example.c:5
pc=0x0000003a in _entry() at /usr/lib/chkrcrt0.o:0
>From Checker:
Stack frames are:
pc=0x000000e8 in main() at example.c:12
pc=0x0000003a in _entry() at /usr/lib/chkrcrt0.o:0
>From Checker:
Memory access error
When Writing at address 0x0, inside the NULL zone.
You probably use a NULL pointer.
THIS SHOULD PRODUCE A SEGMENTATION FAULT.
>From Checker:
Stack frames are:
pc=0x000000fd in main() at example.c:13
pc=0x0000003a in _entry() at /usr/lib/chkrcrt0.o:0
segmentation fault.
To see other features in Checker, see the testsuite/try_*.c files.
Checker has been only been tested on Linux.
If you like Checker, use it, and try to find bugs....
If you find a bug, have a suggestion, dislike Checker, want to make it
better, want to port it, or find an English mistake, email me at:
Tristan C/O marc@david.saclay.cea.fr
I can send you a reply during the weekend.
Checker could become a GNU package.
IF YOU GET Checker-V0.3.tgz, YOU ALSO NEED Checker-libs.tgz.
Good Luck.
Tristan.
Begin2
Title = Checker
Version = V0.3
Desc1 = Checker is a malloc debugger, a garbage collector and a
Desc2 = detector of bad memory access. It uses code insertion.
Desc3 = Checker prints a message when a bad memory pointer is used,
Desc4 = when you read an unitialized buffer...
Desc5 =
Author = Tristan Gingold (C/O authorEmail)
AuthorEmail = marc@david.saclay.cea.fr
Maintainer = Tristan Gingold (C/O MaintEmail)
MaintEmail = marc@david.saclay.cea.fr
Site1 = tsx-11.mit.edu
Path1 = /incoming
File1 = CheckerV0.3.tgz
FileSize1 = ~252000 bytes.
Site2 = tsx-11.mit.edu
Path2 = /incoming
File2 = Checker-libs.tgz
FileSize2 = ~1Mb
Site3 =
Path3 =
File3 =
FileSize3 =
Site4 =
Path4 =
File4 =
FileSize4 =
Required1 = Checker-libs.tgz, Linux v0.99.15, Libc V4.5.19, GCC V2.5.x
Required2 = and a program to be checked !
Required3 =
Required4 =
CopyPolicy1 = GNU LIBRARY GENERAL PUBLIC LICENSE (LGPL) and GPL
CopyPolicy2 =
Keywords = Checker, malloc, garbage collector, code insertion
Comment1 = Checker provides a new version of GAS, to do code insertion,
Comment2 = a checkered version of libc.a
Comment3 = Some syscalls (mmap, ipc) are not supported yet.
Comment4 = instead of 'gcc -checker', now use 'checkergcc'
RelFiles1 = libc.chkr.a (v4.5pl19), libm.chkr.a, libgcc.chkr.a, lib*.chkr.a
RelFiles2 = libchecker.o, ld, as, checkergcc
RelFiles3 =
Entered = 22FEB94
EnteredBy = Tristan Gingold (C/O)
CheckedEmail = marc@david.saclay.cea.fr
End
reply other threads:[~1994-02-26 17:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox