From: moerchendiser2k3 on
Hi all,

I have a serious problem I want to solve. My app, where
Python is embedded crashs on OSX (10.6 SL). I can reproduce the crash
sometimes with a script that makes use of Python threads ( module:
threading).

'thelock->locked' is for sure still locked, but I can't identify the
problem.
Its just waiting, but it gets a 'EXC_BAD_ACCESS'. The line of the
crash
in PyThread_acquire_lock is the following one:

while ( thelock->locked ) {
status = pthread_cond_wait(&thelock->lock_released, &thelock-
>mut); <<<<<<<<<<

From the view of my code, I can exclude that the GIL was ensured but
not properly released
by PyStateGIL_Ensure and PyStateGIL_Release.

Any ideas how to get rid of this crash somehow? Thanks in advance!!

Bye, moerchendiser2k3

#0 0x00007fff86c95316 in __semwait_signal ()
#1 0x00007fff86c99131 in _pthread_cond_wait ()
#2 0x000000011c89f8f4 in PyThread_acquire_lock (lock=0x1013803c0,
waitflag=1) at thread_pthread.h:452
#3 0x000000011c84a414 in PyEval_RestoreThread (tstate=0x101380200) at
Python/ceval.c:334
#4 0x000000011c889725 in PyGILState_Ensure () at Python/pystate.c:592

From: Antoine Pitrou on

Hello,

> 'thelock->locked' is for sure still locked, but I can't identify the
> problem.
> Its just waiting, but it gets a 'EXC_BAD_ACCESS'. The line of the
> crash
> in PyThread_acquire_lock is the following one:
>
> while ( thelock->locked ) {
> status = pthread_cond_wait(&thelock->lock_released, &thelock-
> >mut); <<<<<<<<<<

Are you sure the crash happens in this thread and not another one?



From: moerchendiser2k3 on
Thanks Antoine! :) You were right. It was the wrong thread...uhmm...

Bye! :)