From: Nicholas N. <nj...@ca...> - 2003-05-14 07:41:10
|
On Tue, 13 May 2003, Michael Labhard wrote: > I am at a loss as to how to use valgrind. I have read the manual and a > howto. Using this command > > export GLIBCPP_FORCE_NEW=1; > valgrind > --skin=memcheck Memcheck is the default skin, so this flag is unnecessary > --leak-check=yes > --show-reachable=yes Don't use --show-reachable=yes and you won't the the "still reachable in loss record" messages below; they're not so important, they show memory that your program could have freed (it's still reachable via some pointer) but didn't bother to. > --logfile=debug.out > --suppressions=xfree-3.supp > --suppressions=xfree-4.supp --suppressions=default.supp --suppressions=glibc-2.2.supp default.supp is used as the default suppression file so you don't need to specify it. It's constructed at ./configure time from the relevant xfree/glibc/linux .supp files, so you don't need to mentiont them either. > src/.libs/lt-myapp > > My application produces hundreds of lines looking like > > ==26316== 216 bytes in 21 blocks are still reachable in loss record 77 of 124 > ==26316== at 0x40160989: malloc (in /usr/lib/valgrind/valgrind.so) > ==26316== by 0x40B33B2F: __GI___strdup (in /lib/libc-2.3.1.so) > ==26316== by 0x40F5C37A: resolve_object (in /usr/X11R6/lib/libX11.so.6.2) > ==26316== by 0x40F5BF7C: _XlcDynamicLoad (in /usr/X11R6/lib/libX11.so.6.2) > ==26316== > > What do I do with this stuff? It looks like it comes from an X11 library but > the command line includes suppressions for X11. Why isn't X11 output > suppressed? Where do I get a suppressions file for Qt? If you look in any of the .supp files, you'll see many suppressions for individual errors. These have been added as they were encountered. They should cover most X11 errors people get, but we may have missed some, or your machine might have an unusual configuration that means some errors are getting through. You can write your own suppressions; the manual currently doesn't explain how to very well, it would be easier to check out the CVS HEAD (from sourceforge.net) and use the --gen-suppressions feature to automatically generate suppressions (the feature isn't in 1.9.6). But first, just try "valgrind --leak-check=yes <program>", see how that works. N |