
Hi, I'm having a deadlock on import in my embedded python 2.3rc2, on Win2000, built with Visual C++ 7.1. Having spent a fair amount of time going through the code, and various threads, it is still not clear to me if I'm hitting the problem described in the thread: http://mail.python.org/pipermail/python-dev/2003-February/033436.html or if I'm triggering it because of something else alltogether, as I'm only seeing the problem on Win2000, on Linux it works fine. Basically my code does this in one C level thread: PyGILState_STATE _tstate = PyGILState_Ensure (); PyObject* usermod = PyImport_ImportModule ("echo"); Where echo.py is just: print "ECHO" import time time.sleep(1) print "DONE" It never prints out "DONE". If I take away the sleep(), it finishes, printing DONE. running with THREADDEBUG=15, I'm getting the output below, and the last two lines leave me utterly puzzled, as if something would be quite wrong on my machine (Win2000 under VmWare Linux host). Why could the same thread be unable reacquire a lock it just held? PyThread_init_thread called 1084: PyThread_allocate_lock() -> 01647578 1084: PyThread_acquire_lock(01647578, 1) called 1084: PyThread_acquire_lock(01647578, 1) -> 1 1084: PyThread_release_lock(01647578) called 1084: PyThread_acquire_lock(01647578, 1) called 1084: PyThread_acquire_lock(01647578, 1) -> 1 1084: PyThread_release_lock(01647578) called PyThread_allocate_lock called 1084: PyThread_allocate_lock() -> 0164A280 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called PyThread_allocate_lock called 1084: PyThread_allocate_lock() -> 0256DD40 1084: PyThread_acquire_lock(0256DD40, 1) called 1084: PyThread_acquire_lock(0256DD40, 1) -> 1 1084: PyThread_release_lock(0256DD40) called 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called PyThread_allocate_lock called 1084: PyThread_allocate_lock() -> 01648DA8 1084: PyThread_acquire_lock(01648DA8, 1) called 1084: PyThread_acquire_lock(01648DA8, 1) -> 1 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called 1084: PyThread_release_lock(01648DA8) called 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 1084: PyThread_release_lock(0164A280) called 1084: PyThread_acquire_lock(0164A280, 0) called 1084: PyThread_acquire_lock(0164A280, 0) -> 1 ECHO 1084: PyThread_release_lock(01648DA8) called 1084: PyThread_acquire_lock(01648DA8, 1) called Harri

Some precisions to my mail: On Thursday 31 July 2003 11:53, Harri Pasanen wrote:
It is actually Python 2.3b2, Win2000 under vmWare, linux (Mandrake 9.1 host). That python passes all tests, except test_httplib fails with socket.error: (10060, 'Operation timed out') Instrumenting the python code a bit, I noticed that import_lock is 0164A280 here and it the deadlocking 01648DA8 is something else.
I'll try with Python 2.3 final and try to isolate it further. Harri

Quoth Harri Pasanen: [...]
I don't know about the deadlock problem, but this test_httplib failure sounds much like bug 764095, which was fixed in 2.3c1. -- Steven Taschuk staschuk@telusplanet.net "Its force is immeasurable. Even Computer cannot determine it." -- _Space: 1999_ episode "Black Sun"

Some precisions to my mail: On Thursday 31 July 2003 11:53, Harri Pasanen wrote:
It is actually Python 2.3b2, Win2000 under vmWare, linux (Mandrake 9.1 host). That python passes all tests, except test_httplib fails with socket.error: (10060, 'Operation timed out') Instrumenting the python code a bit, I noticed that import_lock is 0164A280 here and it the deadlocking 01648DA8 is something else.
I'll try with Python 2.3 final and try to isolate it further. Harri

Quoth Harri Pasanen: [...]
I don't know about the deadlock problem, but this test_httplib failure sounds much like bug 764095, which was fixed in 2.3c1. -- Steven Taschuk staschuk@telusplanet.net "Its force is immeasurable. Even Computer cannot determine it." -- _Space: 1999_ episode "Black Sun"
participants (2)
-
Harri Pasanen
-
Steven Taschuk