Usenet comp.os.linux.announce (1993-2013)
 help / color / mirror / Atom feed
From: Julian Seward <Julian_Seward@muraroa.demon.co.uk>
Subject: Valgrind, an open-source memory debugger for x86-GNU/Linux
Date: Fri, 1 Mar 2002 07:29:21 CST	[thread overview]
Message-ID: <3C7E1F33.AA8300C2@muraroa.demon.co.uk> (raw)


Available at http://developer.kde.org/~sewardj
The 20020227b snapshot seems stable enough to be worth trying.

Valgrind is a GPL'd tool to help you find memory-management problems
in your programs. When a program is run under Valgrind's supervision,
all reads and writes of memory are checked, and calls to
malloc/new/free/delete are intercepted. As a result, Valgrind can
detect problems such as:

   Use of uninitialised memory 
   Reading/writing memory after it has been free'd 
   Reading/writing off the end of malloc'd blocks 
   Reading/writing inappropriate areas on the stack 
   Memory leaks -- where pointers to malloc'd blocks are lost forever 
   Passing of uninitialised and/or unaddressible memory to system calls 
   Mismatched use of malloc/new/new [] vs free/delete/delete [] 

Valgrind tracks each byte of memory in the original program with nine
status bits, one of which tracks addressibility of that byte, while
the other eight track the validity of the byte. As a result, it can
detect the use of single uninitialised bits, and does not report
spurious errors on bitfield operations.

You can use it to debug more or less any dynamically-linked ELF Linux
x86 executable, without modification, recompilation, or anything. If
you want, Valgrind can start GDB and attach it to your program at the
point(s) where errors are detected, so that you can poke around and
figure out what was going on at the time.

Valgrind works well enough to debug large programs.  Over the past few
weeks, various folks in the KDE development community have suffered
early snapshots of Valgrind.  After much invaluable feedback and
bug-fixing from the kde-core-devel crew, Valgrind can run large parts
of KDE3 without serious problems.  It can also run various other large
programs successfully, such as GIMP and Netscape 4.78.

A number of previously-undiscovered bugs in the upcoming KDE3 have
been discovered as a result.  
See http://www.osnews.com/story.php?news_id=704 for a short comment 
about it.

Full documentation is supplied. Also supplied are some hints and tips
for folks trying to get started with it.

To use: you need an x86 machine running Linux 2.2.X or 2.4.X and glibc
>= 2.1.X.  This covers most contemporary Linux distributions. I
develop it on RedHat 7.2, so that platform, at least, should work. It
is also known to work on RedHat 6.1, 6.2 and probably many other Linux
distros as well.

There are some important limitations:

   No support for threaded programs.  Many have complained about
   this, and it is under consideration.

   No support for MMX, SSE, SSE2, 3DNow insns.  When queried with a
   CPUID insn, Valgrind claims to be a pre-MMX P133, in an attempt to
   fool glibc into not using MMX extensions.

   Signal simulation is a bit flaky.  If you stick to POSIX signals
   you should be OK, but programs which do weird stuff with signals may
   have problems.

If you have problems with Valgrind, don't suffer in silence. Mail
me. It's under active development, and I'll do what I can to help you
get started.

Julian Seward, jseward@acm.org 
28 Feb 02


##########################################################################
# Send submissions for comp.os.linux.announce to: cola@stump.algebra.com #
# PLEASE remember a short description of the software and the LOCATION.  #
# This group is archived at http://stump.algebra.com/~cola/              #
##########################################################################



             reply	other threads:[~2002-03-01 13:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-01 13:29 Julian Seward [this message]
2002-03-18 17:51 ` Valgrind, an open-source memory debugger for x86-GNU/Linux Paul D Fox
  -- strict thread matches above, loose matches on Subject: below --
2002-03-01 13:29 Julian Seward
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