[Python-Dev] How to debug python crashes

Catalin Iacob iacobcatalin at gmail.com
Tue May 14 21:55:02 CEST 2013

Hi Philippe,

I don't have access to VS right now but out of my head what you need
to do is roughly outlined below.

On Tue, May 14, 2013 at 5:29 PM, Philippe Fremy <phil at freehackers.org> wrote:
> But what's the reason for releasing them ? If you need to recompile
> Python to use them, that would be strange because they are generated as
> part of the compilation process anyway.

They can indeed be used like this:

You should launch the python.exe process that is going to crash,
attach to it with the Visual Studio debugger and then reproduce the
crash. This should drop you in the debugger.

Once you're in the debugger and python.exe is stopped at the point of
the crash you should see the stack trace of each thread in a VS
window, the stacktrace will probably have lots of entries of the form
python27.dll!<hex-adress> (no function names because there VS doesn't
know where to find the PDB files). If you right click one of those
entries there's an option named "Symbol load information" or similar,
this will show a window from which you can make VS ask you where on
disk do you have PDB files. You then tell VS where to find
python27.pdb and then the stacktrace entries should automatically get
function names.


More information about the Python-Dev mailing list