How to debug deadlock with python?

不打扰是莪最后的温柔 提交于 2019-12-05 07:04:28

If you can compile your extension module with gcc (for example, by using Cygwin), you could use gdb and the pystack gdb macro to get Python stacks in that situation. I don't know if it would be possible to do something equivalent to pystack in Visual C++ Express, but you might get some ideas from the pystack macro implementation anyway.

Since you mention you only see asm/binary in the VC++ debugger, you should make sure you compile Python with debug symbols. If VC++ is still showing asm, it might be that you need to tell VC++ where the source files are (sorry, haven't used VC++ in years so I can't tell what exactly you might need to do if this was the case).

You might also get some important information by adding lots of logging calls to your code, both Python side and your C++ extension.

In any case, I am almost certain the deadlocks are not due to Queue, but your own code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!