[Ubuntu Wiki] Update of "Valgrind" by brian-murray

Ubuntu Wiki noreply at ubuntu.com
Thu Jan 3 17:20:40 UTC 2013


Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ubuntu Wiki" for change notification.

The "Valgrind" page has been changed by brian-murray:
http://wiki.ubuntu.com/Valgrind?action=diff&rev1=16&rev2=17

  
  This makes it ideal for tracking down segmentation faults, bus errors, and general memory leaks.
  
- Please ensure you have packages with debug symbols installed.  You can do this by following the instructions at DebuggingProgramCrash.
+ /!\ Please ensure you have packages with debug symbols installed.  You can do this by following the instructions at DebuggingProgramCrash.
  
   1. Make sure Valgrind is installed.  {{{
  sudo apt-get install valgrind
@@ -20, +20 @@

   1. Remove any old Valgrind logs: {{{
  rm valgrind.log*
  }}}
-  1. Start the program under control of `memcheck` (valgrind can't solve paths, so you should feed it the full program path, to get it: `which <program>`): {{{
+  1. Start the program under control of `memcheck`:
+ {{{
- G_SLICE=always-malloc G_DEBUG=gc-friendly  valgrind -v --tool=memcheck --leak-check=full --num-callers=40 --log-file=valgrind.log <program> <arguments>
+ G_SLICE=always-malloc G_DEBUG=gc-friendly  valgrind -v --tool=memcheck --leak-check=full --num-callers=40 --log-file=valgrind.log $(which <program>) <arguments>
  }}}
+  1. N.B. valgrind can't solve paths, so you should feed it the full program path, to get it: $(which <program>)
   1. The program will start.  It may take a while; this is normal, because Valgrind must perform extensive checking to detect memory errors.
   1. Perform any actions necessary to reproduce the crash.
   1. Package up the log files (no need if there is only one): {{{



More information about the Ubuntu-bugsquad mailing list