[Pyobjc-dev] Re: [Pyobjc-checkins] CVS: pyobjc/Modules/objc objc_support.m,1.63,1.64
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2004-03-28 15:14:37
|
Hmm, One of your GIL-related patches completely broke the mcfoo program, it now consistently deadlocks. On the bright side, this is a lot better than "crashes or deadlocks after a while, most of the time" :-). What I don't understand is that the deadlock occurs due to a call to PyGILState_Ensure in thread 2, *at a location where that thread should already own the GIL*: #0 0x90017048 in semaphore_wait_signal_trap () #1 0x9000e890 in _pthread_cond_wait () #2 0x95fd0324 in PyThread_acquire_lock () #3 0x95fa44f8 in PyEval_RestoreThread () #4 0x95fc63fc in PyGILState_Ensure () #5 0x004a004c in -[NSObject(PyObjCSupport) __pyobjc_PythonObject__] (self=0xa5f62728, _cmd=0x3a03) at Modules/objc/objc_support.m:57 #6 0x004a119c in pythonify_c_value (type=0x3903 "", datum=0xa5f6272c) at Modules/objc/objc_support.m:964 #7 0x004b3930 in ObjC_FFICaller (aMeth=0x164e750, self=0x164a350, args=0x40) at Modules/objc/libffi_support.m:1102 #8 0x004ad344 in objcsel_call (self=0x164e750, args=0x25c030) at Modules/objc/selector.m:575 #9 0x95f4a8d0 in PyObject_Call () #10 0x95fa9ba8 in PyEval_GetFuncDesc () #11 0x95fa9598 in PyEval_GetFuncDesc () #12 0x95fa6c64 in PyEval_EvalCode () #13 0x95fa7e30 in PyEval_EvalCodeEx () #14 0x95f5f354 in PyFunction_SetClosure () #15 0x95f4a8d0 in PyObject_Call () #16 0x004adac4 in pysel_call (self=0x164e750, args=0x0, kwargs=0x0) at Modules/objc/selector.m:1032 #17 0x95f4a8d0 in PyObject_Call () #18 0x95fa91ec in PyEval_CallObjectWithKeywords () #19 0x95fd39c0 in _PyObject_GC_Del () #20 0x900247e8 in _pthread_body () Ronald P.S. I don't think it is necessary to call PyGILState_Ensure in __pyobjc_PythonObject__ (it should only be called when we own the GIL), but adding the call should be harmless. |