[ python-Bugs-994023 ] threads duplicated on fork() prevent child from terminating

SourceForge.net noreply at sourceforge.net
Mon Jul 19 20:59:08 CEST 2004


Bugs item #994023, was opened at 2004-07-19 11:59
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=994023&group_id=5470

Category: Threads
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: L.C. (Laurentiu C. Badea) (wotevah)
Assigned to: Nobody/Anonymous (nobody)
Summary: threads duplicated on fork() prevent child from terminating

Initial Comment:

(This is a repost from an older c.l.py submission to
prevent losing track of it)

It looks as if fork() duplicates the entire threads
info structure in the new process. This causes child
processes to attempt to handle or wait for nonexistent
threads and causes them to hang on exit.

Perhaps clearing Python's internal thread info after
the fork() is all that is needed to fix this (the fact
that the threads themselves are not duplicated  seems
to suggest that this was indeed the intention - and
also is POSIXly correct).

Original post with sample code for the problem is here
(also attached for your convenience):

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=e0bf36b5.0306191548.73b7383%40posting.google.com

The "bug" manifests itself by the program not exiting
voluntarily. The two processes created need to be
terminated individually.

Last tested on 2.3.3 (Fedora Core 2), but present since
2.1 I believe.


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

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


More information about the Python-bugs-list mailing list