Hi, I have a reproducable crash on Windows XP with Python 2.7 which I would like to investigate. I have Visual Studio 2008 installed and I downloaded the pdb files. However I could not find any instructions on how to use them and was unsuccessful at getting anything out of it. I checked the developer guide but could not find anything on debugging crashes. On internet, this seems to be also an underdocumented topic. So, a few questions : - is there some documentation to help debugging crashes ? - are the pdb files released along python usable with Visual Studio and stock Python ? Or do you need a hand-compiled version ? cheers, Philippe
Le Tue, 14 May 2013 14:32:27 +0200, Philippe Fremy <phil@freehackers.org> a écrit :
Hi,
I have a reproducable crash on Windows XP with Python 2.7 which I would like to investigate. I have Visual Studio 2008 installed and I downloaded the pdb files. However I could not find any instructions on how to use them and was unsuccessful at getting anything out of it.
You may as well recompile Python in debug mode and then run it under the Visual Studio debugger. VS 2008 is adequate for building Python 2.7. See http://docs.python.org/devguide/setup.html#windows-compiling (that doesn't answer your question about pdb files, it's simply that I don't know the answer :-)) Regards Antoine.
On 14/05/2013 13:32, Philippe Fremy wrote:
I have a reproducable crash on Windows XP with Python 2.7 which I would like to investigate. I have Visual Studio 2008 installed and I downloaded the pdb files. However I could not find any instructions on how to use them and was unsuccessful at getting anything out of it.
I checked the developer guide but could not find anything on debugging crashes. On internet, this seems to be also an underdocumented topic.
So, a few questions : - is there some documentation to help debugging crashes ?
I don't think there is. As you say, it's somewhat underdocumented. Maybe someone else can point to something, but I'm not aware of anything.
- are the pdb files released along python usable with Visual Studio and stock Python ? Or do you need a hand-compiled version ?
I actually have no idea whether you drop in the .pdb files, but if you have VS anyway, it's easy enough to build and run within VS and let the debugger drop you into the code when it crashes. Are you in a position to post a reproducible test case to the tracker? Or were you holding back until you'd done some analysis? TJG
On 14/05/2013 13:32, Philippe Fremy wrote:
I have a reproducable crash on Windows XP with Python 2.7 which I would like to investigate. I have Visual Studio 2008 installed and I downloaded the pdb files. However I could not find any instructions on how to use them and was unsuccessful at getting anything out of it.
I checked the developer guide but could not find anything on debugging crashes. On internet, this seems to be also an underdocumented topic.
So, a few questions : - is there some documentation to help debugging crashes ? I don't think there is. As you say, it's somewhat underdocumented. Maybe someone else can point to something, but I'm not aware of anything. 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
On 14/05/2013 14:49, Tim Golden wrote: part of the compilation process anyway.
Are you in a position to post a reproducible test case to the tracker? Or were you holding back until you'd done some analysis?
I can reproduce it systematically, with an open source project (I am debugging winpdb) but this occurs in a middle of a multithreaded XML-RPC server running a python debugger in another thread. So no, I don't have a test case and identifying clearly the bug would make me a small and happy python contributor. cheers, Philippe
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@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. Catalin
From: Catalin Iacob 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@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.
Copying the .pdb files to the same directories as the matching DLL/EXE files (which may be C:\Windows\System32 or C:\Windows\SysWOW64 for python27.dll) should also make this work. VS will always look next to the executable file. Cheers, Steve
Hi, I don't know if it can help, but if you really don't know where your programcrash/hang occurs, you can use the faulthandler module: https://pypi.python.org/pypi/faulthandler It can be used to display te backtrace of all threads on an event like a signal or a timeout. It works with Python, but you will need a compiler (like Visual Studio) to install it on Windows. I failed to build a MSI installer on Windows 64-bit with Visual Studio 2010 express. If someone can help me to build MSI, please contact me. The documentation: http://docs.python.org/dev/library/faulthandler.html Victor Le mardi 14 mai 2013, Philippe Fremy a écrit :
Hi,
I have a reproducable crash on Windows XP with Python 2.7 which I would like to investigate. I have Visual Studio 2008 installed and I downloaded the pdb files. However I could not find any instructions on how to use them and was unsuccessful at getting anything out of it.
I checked the developer guide but could not find anything on debugging crashes. On internet, this seems to be also an underdocumented topic.
So, a few questions : - is there some documentation to help debugging crashes ? - are the pdb files released along python usable with Visual Studio and stock Python ? Or do you need a hand-compiled version ?
cheers,
Philippe
_______________________________________________ Python-Dev mailing list Python-Dev@python.org <javascript:;> http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/victor.stinner%40gmail.com
participants (6)
-
Antoine Pitrou -
Catalin Iacob -
Philippe Fremy -
Steve Dower -
Tim Golden -
Victor Stinner