I am using Ubuntu 12.04, Python 2.7.3.
I am having a segmentation fault in a C
extension I have co-written. It seems to come from a pointer that was not free'd properly.
I then use valgrind
to find memory leaks. According to that answer, I have to compile Python
in debug mode to get a valgrind
friendly version of Python
and get rid of its irrelevant reports.
How to compile Python
in debug mode?
Even though the answer I linked answers part of that question, it does not provide me enough details.
Indeed, I want to understand what is happening, not just type things at some places because "who knows? It could work".
Hence, I would like to know:
- What to download to compile Python?
- Where to type that
./configure
? - What is going to happen to my current installation? Is it going to affect my system?
I have read at many places that many processes on Ubuntu 12.04 are managed by Python and I do not want to mess up anything.
I am also trying to find answers to the questions mentioned by Yair Daon's comment:
Do you have to recompile
Python
once you are done using its debug compilation?- If yes, how to compile
Python
back to its standard mode?
- If yes, how to compile