Skip to content

UsingValgrindToDebug

StefanBehnel edited this page Aug 24, 2011 · 5 revisions

#format wiki #language en

Placeholder for knowledgeable people to describe the procedure to run valgrind and interpret the output.

From the valgrind home page:

Valgrind is an award-winning suite of tools for debugging and profiling Linux programs. With the tools that come with Valgrind, you can automatically detect many memory management and threading bugs, avoiding hours of frustrating bug-hunting, making your programs more stable. You can also perform detailed profiling, to speed up and reduce memory use of your programs.

The Valgrind distribution currently includes four tools: a memory error detector, a cache (time) profiler, a call-graph profiler, and a heap (space) profiler. It runs on the following platforms: X86/Linux, AMD64/Linux, PPC32/Linux, PPC64/Linux.

<<AttachList>>

Here is a suppression file that you can use with Cython modules:

https://github.com/lxml/lxml/raw/master/valgrind-python.supp

You can use this command line to run the Python interpreter under valgrind control:

valgrind --tool=memcheck --leak-check=full --num-callers=30 --suppressions=valgrind-python.supp python myprogram.py

This page explains some of the PyMalloc issues:

http://hg.python.org/cpython/raw-file/tip/Misc/README.valgrind

Clone this wiki locally