[Python-bugs-list] [ python-Bugs-694062 ] os.popen() hangs on {Free,Open}BSD

SourceForge.net noreply@sourceforge.net
Mon, 03 Mar 2003 12:05:54 -0800


Bugs item #694062, was opened at 2003-02-26 18:12
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=694062&group_id=5470

Category: Python Interpreter Core
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Jason R. Mastaler (jasonrm)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.popen() hangs on {Free,Open}BSD

Initial Comment:
I'm seeing odd behavior with os.popen() on 
certain platforms such as FreeBSD and OpenBSD. 
 
FWIW, I posted about this problem almost two 
years ago on c.l.p, and never got a resolution. 
 
See 
http://mail.python.org/pipermail/python-list/2001-May/042373.html 
 
Now, many Python and FreeBSD upgrades later, 
I see the problem still exists. Now however, I need to 
find a solution as I can't workaround it any longer. 
 
I've attached about the simplest test case I could 
produce below. You can call it from a .forward or 
.qmail file.  
 
On Free/OpenBSD, the program runs but leaves a  
python process lying around: 
 
jasonrm    142  0.0  0.2  2576 2008  ??  I     5:42PM   
0:00.02 python /tmp/hang (python2.2) 
 
On other platforms such as Linux, the program also 
runs, but no process is left hanging around.  
 
I've been able to reproduce the problem on Free/OpenBSD 
only. The problem doesn't appear on IRIX, BSD/OS or  
Linux. 
 
Please let me know if I can do anything more to help 
debug this.  

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

>Comment By: Jason R. Mastaler (jasonrm)
Date: 2003-03-03 13:05

Message:
Logged In: YES 
user_id=85984

> Try finding out what stdin/stdout/stderr refer to 
> (with fstat or something).

Can you be more specific here?

I've attached the output of `fstat -m -p 15437' below
in case that helps.

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

Comment By: Jack Jansen (jackjansen)
Date: 2003-03-03 03:57

Message:
Logged In: YES 
user_id=45365

Just for fun I tried it on MacOSX, but running from the shall, not qmail, and I don't see any problems there. At least, not if I pass a small input message. If I pass a large input message I get a "broken pipe", but that is to be expected (as true doesn't really read it's input).

My guess is that this is a third-party error, somehow related to how qmail sets up stdin/stdout/stderr (apparently slightly different on Free/OpenBSD and the other systems). Try finding out what stdin/stdout/stderr refer to (with fstat or something). 

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

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