This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: cse.c bug
- To: egcs at cygnus dot com
- Subject: Re: cse.c bug
- From: Thomas Koenig <ig25 at mvmap66 dot ciw dot uni-karlsruhe dot de>
- Date: Tue, 30 Sep 1997 21:36:18 +0100 (MET)
- Reply-To: Thomas dot Koenig at ciw dot uni-karlsruhe dot de (Thomas König)
I wrote:
>[Did I mention that playing around with Checker is fun? :-]
Before I get more E-Mails asking what Checker is, here is its
description from the Linux GNU/Debian package:
# Drop-in addition to `gcc' that allows programmers to find most
# memory-related bugs easily. Checker automatically finds:
# .
# * null pointer dereferences (read, write, and execute accesses)
# * writes to read-only memory
# * accesses to free blocks (read, write, and execute)
# * reads/writes to uninitialized bytes (in automatic and dynamic memory)
# * reads/writes to "red zones" (in automatic and dynamic memory)
# * reads/writes/executes outside memory segments
# * free called with address not obtained from malloc
# * free an already freed block
# * ...and many more!
# .
# Checker's main disadvantage is that it causes the program to run many
# times slower. You can compile your program to use Checker by using
# the command `checkergcc' in place of `gcc'.
Checker does this by manipulating the output of the assembler. Each
assembler instruction is replaced by a sequence of instructions which
checks all these things. Of course, this is highly machine-dependend,
causes enormous code bloat and makes the code slooooow.
Checker so far is only available for i386-linux and sparc-linux (AFAIK).
The only version which really works is the one for Debian hamm
(unstable). It includes glibc2.0.5 and a few other goodies, and is
based on gcc 2.7.2.3. It has found quite a number of bugs in my
programs, and at least four bugs in glibc (or so I'm told :-). If you
run Linux/386 with glibc 2.0.5, try to get this version from
ftp://ftp.debian.org/pub/linux/debian/hamm/hamm/binary-i386/devel/checker_0.8-18.deb
If you don't have dpkg installed, you can unpack a *.deb file it with
"ar x foo.deb ; tar -xvzf data.tar.gz"
The tests I've run on egcs were done with the first-stage compiler,
with "CC=checkergcc configure".
--
Thomas Koenig, Thomas.Koenig@ciw.uni-karlsruhe.de, ig25@dkauni2.bitnet.
The joy of engineering is to find a straight line on a double
logarithmic diagram.