This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Status of GCC memory checking, -fcheck-memory-usage
- From: Claus Fischer <claus dot fischer at clausfischer dot com>
- To: gcc at gcc dot gnu dot org
- Cc: AWLaFramboise at aol dot com, rra at stanford dot edu
- Date: Sun, 10 Feb 2002 12:39:27 +0100
- Subject: Re: Status of GCC memory checking, -fcheck-memory-usage
- References: <20020210122130.A956@clausfischer.com>
Post Scriptum: Example:
cat >ex.c <<EOF
#include <stdio.h>
int main(void) {
char *x;
scanf("%s",x);
return 0;
}
EOF
checkergcc -Wall -W -o ex ex.c
./ex
>From Checker (pid:01056): (rus) read uninitialized byte(s) in the
stack.
When Reading 4 byte(s) at address 0xbffffbf8, inside the stack.
Stack frames are:
pc=0x08048730 in main at ex.c:4
pc=0x08054f0b in this_main at stubs-main.c:13
pc=0x4002fa42 in checker_text_stubs_end at stubs/end-stubs.c:7
pc=0x08048648 in *unknown* at *unknown*:0
>From Checker (pid:01056): (fun) function warning.
scanf: No width field for string.
Stack frames are:
pc=0x08054ebe in chkr_stub_scanf at stubs-stdio.c:91
pc=0x08048765 in main at ex.c:4
pc=0x08054f0b in this_main at stubs-main.c:13
pc=0x4002fa42 in checker_text_stubs_end at stubs/end-stubs.c:7
pc=0x08048648 in *unknown* at *unknown*:0
Not that anyone would intentionally write such code :-)
But it shows the potential of the tool. There's much
more to it than just malloc debugging.
I'm really disappointed that this very nice tool should have to go.
Claus
--
Claus Fischer <claus.fischer@clausfischer.com>
http://www.clausfischer.com/