- publishing free software manuals
Valgrind 3.3 - Advanced Debugging and Profiling for GNU/Linux applications
by J. Seward, N. Nethercote, J. Weidendorfer and the Valgrind Development Team
Paperback (6"x9"), 164 pages
ISBN 0954612051
RRP £12.95 ($19.95)

Get a printed copy>>>

3.12 An Example Run

This is the log for a run of a small program using Memcheck. The program is in fact correct, and the reported error is as the result of a potentially serious code generation bug in GNU g++ (snapshot 20010527).

$ valgrind -v ./bogon  
==25832== Valgrind 0.10, a memory error detector for x86
==25832== Copyright (C) 2000-2001, and GNU GPL'd, by
            Julian Seward.
==25832== Startup, with flags:
==25832== --suppressions=redhat71.supp
==25832== reading syms from /lib/ld-linux.so.2
==25832== reading syms from /lib/libc.so.6
==25832== reading syms from /lib/libgcc_s.so.0
==25832== reading syms from /lib/libm.so.6
==25832== reading syms from /lib/libstdc++.so.3
==25832== reading syms from valgrind.so
==25832== reading syms from /proc/self/exe
==25832== 
==25832== Invalid read of size 4
==25832==    at 0x8048724: BandMatrix::ReSize(int,int,int) 
             (bogon.cpp:45)
==25832==    by 0x80487AF: main (bogon.cpp:66)
==25832==  Address 0xBFFFF74C is not stack'd, malloc'd 
           or free'd
==25832==
==25832== ERROR SUMMARY: 1 errors from 1 contexts
            (suppressed: 0 from 0)
==25832== malloc/free: in use at exit: 0 bytes in 0 blocks.
==25832== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==25832== For a detailed leak analysis, rerun with:
            --leak-check=yes

The GCC folks fixed this about a week before gcc-3.0 shipped.

ISBN 0954612051Valgrind 3.3 - Advanced Debugging and Profiling for GNU/Linux applicationsSee the print edition