Skip to content
Aleksey Midenkov edited this page Oct 7, 2018 · 1 revision

Leak check

valgrind \
    --undef-value-errors=no \
    --log-file=leaks.log \
    --num-callers=30 \
    --leak-check=full \
    --track-origins=no \
    "$@"
  • Reachable blocks (those to which a pointer was found) are not shown.
    To see them, rerun with: --leak-check=full --show-reachable=yes
  • Use --undef-value-errors=no to disable conditional jump and other undef value usage display.

Memory corruption check

valgrind \
    --leak-check=no \
    --track-origins=yes \
    --log-file=corruptions.log \
    --num-callers=30 \
    "$@"
  • Use --track-origins=yes to see where uninitialised values come from. --track-origins is slow. First time run slow tests without it.

Suppressions example

{                                                                                                        
   <1>                                                                                                   
   Memcheck:Leak                                                                                         
   ...                                                                                                   
   fun:OCIEnvCreate                                                                                      
}

{                                                                                                        
   <2>                                                                                                   
   Memcheck:Cond                                                                                         
   ...                                                                                                   
   fun:OCIEnvCreate                                                                                      
}
Clone this wiki locally