[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Crash in python bindings on windows (in apache)

From: Marc Haesen <Marc.Haesen_at_telindus.be>
Date: 2005-10-14 17:33:23 CEST

The current python bindings crash in windows when used with viewcvs in
apache. The crash occurs when the apache server is restarted or stopped.

It is the routine svn_swig_py_pool_destroyed that is crashing because
the function call apr_threadkey_private_get(&val, _saved_thread_key);
returns NULL as val. This is because the svn_swig_py_pool_destroyed is
not called from the same thread that created the pool.

One possible fix is to replace the svn_swig_py_release_py_lock and
svn_swig_py_acquire_py_lock with the following two functions (only using
one thread_state for all threads):

#ifdef ACQUIRE_PYTHON_LOCK
static PyThreadState *thread_state;
#endif

void svn_swig_py_release_py_lock(void)
{
#ifdef ACQUIRE_PYTHON_LOCK
  thread_state = PyEval_SaveThread();
#endif
}

void svn_swig_py_acquire_py_lock(void)
{
#ifdef ACQUIRE_PYTHON_LOCK
  PyEval_RestoreThread(thread_state);
#endif
}

Marc

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Oct 14 17:34:43 2005

This is an archived mail posted to the Subversion Dev mailing list.