[Cython] Debugging a segfault in a cython generated module
Stefan Behnel
stefan_ml at behnel.de
Sat Apr 19 11:01:32 CEST 2008
Brian Granger wrote:
> Is valgrind a good option? Any hints on getting started with cython+valgrind?
I've never seen a better tool than valgrind for C code debugging, including
all of its tools. I use memcheck and callgrind most when debugging and optimising.
AFAIR from their web page, valgrind does not run on MacOS, though. Did that
change?
There's nothing special in using memcheck, I usually call it with the command
line that you can find in lxml's Makefile. You also need the suppression file
for the Python interpreter.
http://codespeak.net/svn/lxml/trunk/Makefile
http://codespeak.net/svn/lxml/trunk/valgrind-python.supp
You just have to take care that you have debugging symbols in all libraries
that you want to debug, and you might want to disable excessive compiler
optimisations, like function inlining. They make the debug output harder to read.
Stefan
More information about the Cython-dev
mailing list