From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,cd1c330d79c205c5 X-Google-Attributes: gid10d4db,public X-Google-ArrivalTime: 2002-03-01 05:30:53 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!usenetserver.com!news.alt.net!cola.stump.algebra.com!robomod!not-for-mail From: Julian Seward Newsgroups: comp.os.linux.announce Subject: Valgrind, an open-source memory debugger for x86-GNU/Linux Date: Fri, 1 Mar 2002 07:29:21 CST Organization: Altopia Corp. - Usenet Access - http://www.altopia.com Message-ID: <3C7E1F33.AA8300C2@muraroa.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-Path: X-COLA-Policy: http://stump.algebra.com/~cola X-COLA-Info-1: Send submissions to cola@stump.algebra.com X-COLA-Info-2: Send complaints to cola-admin@stump.algebra.com X-Comment: moderators do not necessarily agree or disagree with this article. X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) X-Accept-Language: en X-Auth: PGPMoose V1.1 PGP comp.os.linux.announce iQBVAwUAPH+CMSFvAtx2nXvNAQElqwH/YBqClPS2W08p0o16nu4JRDsrmXfR1KAR kyk/5DfSyNuBTn/knIrZDiF+qfXGEyp5o//gSIfAOH1lGtWHenVewQ== =KTHI Xref: archiver1.google.com comp.os.linux.announce:1853 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/ # ##########################################################################