How to debug deadlock?

V

Victor Lin

Hi,

I am developing a multi-threading application, I encounter a deadlock.
I use Visual C++ Express 2008 to trace the program. Once the deadlock
occurs, I just pause the program and trace. I found that when deadlock
occurs, there will be two threads called python from my C++ extension.
All of them use Queue in python code, so I guess the deadlock might
caused by Queue. But however, once the extension goes into python
code, I can't see nothing but asm code and binary from the VC++
debugger. I would like to know are there any way to dump the call
stack of python code after I paused the program? And how can I know
what lock are there in threads caused the deadlock?

Thanks.
Victor Lin.
 
A

Aahz

I am developing a multi-threading application, I encounter a deadlock.
I use Visual C++ Express 2008 to trace the program. Once the deadlock
occurs, I just pause the program and trace. I found that when deadlock
occurs, there will be two threads called python from my C++ extension.
All of them use Queue in python code, so I guess the deadlock might
caused by Queue. But however, once the extension goes into python
code, I can't see nothing but asm code and binary from the VC++
debugger. I would like to know are there any way to dump the call
stack of python code after I paused the program? And how can I know
what lock are there in threads caused the deadlock?

You are already hosed if you have two threads calling into Python,
because you didn't properly acquire the GIL. I can't help beyond that;
try using the mailing list
http://mail.python.org/mailman/listinfo/capi-sig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top