[Python-bugs-list] [ python-Bugs-621548 ] Numerous defunct threads left behind

noreply@sourceforge.net noreply@sourceforge.net
Sun, 13 Oct 2002 04:05:08 -0700


Bugs item #621548, was opened at 2002-10-10 22:25
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=621548&group_id=5470

Category: Threads
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Jamin W. Collins (jamincollins)
Assigned to: Nobody/Anonymous (nobody)
Summary: Numerous defunct threads left behind

Initial Comment:
I originally noticed this problem with Debian's
OfflineIMAP package and filed a report there:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=162369

The short of it is that when running offlineimap for an
extended period of time it will eventually leave a
large number of defunct threads behind that eventually
use up all available system processes.  Killing the
original offlineimap thread clears the problem for a while.

The Debian maintainer of OfflineIMAP referred this over
to the python maintainer, who in turn has asked (as you
can see from the link above) that I file a report here.

If there is any more information I can provide (beyond
that in the Debian case already) please let me know.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-10-13 13:05

Message:
Logged In: YES 
user_id=21627

The analysis that this is a Python bug is most likely wrong.
You write

> a number of defunct/zombie processes are spawned.

then John Goerzen writes

> It is likely, in any case, that this is a bug in Python
itself.   The 
> OfflineIMAP program does not fork 

However, John later points out that there are many threads
used in this package. Please understand that threads show up
as processes in Linux ps(1).

IOW, what you are seeing are the many threads, not any
additional processes.

It appears that the system is waiting for somebody to call
pthread_join. This should not be necessary, since Python
invokes pthread_detach for all of its threads. So if the
system does not reclaim terminated threads, it seems there
is a bug in your C library.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=621548&group_id=5470