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

noreply@sourceforge.net noreply@sourceforge.net
Fri, 02 Nov 2001 15:59:57 -0800


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: Closed
>Resolution: Accepted
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.

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

>Comment By: Martin v. Löwis (loewis)
Date: 2001-11-02 15:59

Message:
Logged In: YES 
user_id=21627

Thanks for the patch, applied as posixmodule.c 2.207.


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

Comment By: Andrew I MacIntyre (aimacintyre)
Date: 2001-10-30 04:22

Message:
Logged In: YES 
user_id=250749

+1 on this, on the basis that:-
1) the changes are only to a section of code in Modules/posixmodule.c included in an #ifdef PYOS_OS2;
2) Michael appears to have a reasonable grasp of the platform specific issue; and is the only VAC++ person handy at the 
moment;
3) this patch won't have any significant affect on the popen support for the EMX/GCC port to OS/2, which will be #ifdef'ed 
separately.


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

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