[Patches] [ python-Patches-474169 ] Fix for OS/2 popen

noreply@sourceforge.net noreply@sourceforge.net
Tue, 23 Oct 2001 10:54:47 -0700


Patches item #474169, was opened at 2001-10-23 10:54
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=474169&group_id=5470

Category: Core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Muller (mikemuller)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix for OS/2 popen

Initial Comment:
This is a fix for a long-standing bug in the OS/2
implementation of popen().  It definitely is a problem
under the Visual Age build: it may also be a problem
under the EMX build for similar reasons.

The C library fdopen() function tries to lock an
internal mutex semaphore.  If this is performed in a
critical section (as it currently is) and another
thread already owns the mutex, the entire python
process locks up into a deadly embrace: the fdopen
thread is waiting on the semaphore and all other
threads are waiting for the fdopen thread to exit the
critical section.

The fix is simple: just move the fdopen() out of the
critical section.  The only thing that needs to be
there is the dup() and async_system() calls.

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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=474169&group_id=5470