[Zope-dev] Zope stops responding (Threads still present)

Leonardo Rochael Almeida leo@hiper.com.br
07 Jun 2002 17:56:00 -0300


On Fri, 2002-06-07 at 16:36, Ahsan Imam wrote:
> Hello All,
> 
>    Zope stops responding to requests, however when I check the zope
> process I see seven threads plus watchdog thread. ( ps auxww | grep z2
> ). I am not sure why it stops responding. 

Try to follow the debuging procedure outlined here.

http://zope.org/Members/4am/debugspinningzope

It helped me debug a double free problem in the python DBAPI of the
latest sqlrelay-0.33pre prerelease.

In my case, however, I had to adapt the recipe a little. Since the
trouble spot happened inside a place where the Pythons Great Interpreter
Lock was held, the PyRun_SimpleString() part would just freeze waiting
for the lock to be released. This is what I did

* back up your Data.fs (you can do it anytime, even with Zope running,
even with it frozen under gdb). This is important since releasing the
GIL could cause severe memory corruption (and possibly Data.fs
corruption).

inside gdb, before calling PyRun_SimpleString(), type:
'call PyEval_ReleaseLock()'
(without the quotes).

this might cause an immediate segfault (SIG11), but the process should
still be there inside gdb, so you may now call PyRun_SimpleString() and
it should work. You should probably kill the process after that. Let it
R.I.P. after so much torture :-)

But only do the routine above if calling PyRun_SimpleString() as
mentioned in that page results in a freeze.

-- 
Ideas don't stay in some minds very long because they don't like
solitary confinement.