[ python-Bugs-686667 ] os.spawnv(P_WAIT, ...) on Linux doesn't handle EINTR

SourceForge.net noreply at sourceforge.net
Mon May 9 14:07:14 CEST 2005


Bugs item #686667, was opened at 2003-02-14 17:47
Message generated for change (Comment added) made by markmc
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=686667&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Bernhard Herzog (bernhard)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.spawnv(P_WAIT, ...) on Linux doesn't handle EINTR

Initial Comment:
The implementation of os.spawnv when called with the
P_WAIT flag calls waitpid to wait for the subprocess.
If this function is aborted early because of a signal,
i.e. if it raises OSError with EINTR, it should be
called again.

I ran across this bug when trying to write a test case
for a script that stops another process. Both the
script and the other process are executed as
subprocesses of the test program. The stop script is
executed with os.spawnv(P_WAIT,  ...) to wait until the
script completed. Unfortunately when it stops the other
process a SIGCHLD is sent to the test program which
then aborts the waitpid with an exception.

Tested with Python 2.1.3, 2.2 and CVS from 2003-02-13
Platform: Debian GNU/Linux, Kernel 2.4.20

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

Comment By: Mark Mc Loughlin (markmc)
Date: 2005-05-09 13:07

Message:
Logged In: YES 
user_id=116392

Seeing this on Ubuntu with Sabayon
(www.gnome.org/projects/sabayon):

  http://bugzilla.gnome.org/show_bug.cgi?id=303034

Python version is 2.4.1

This is particularily painful because there's no way to get
the PID of the process which waitpid was wating on when it
was interrupted, so there's no way to reap the child

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

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


More information about the Python-bugs-list mailing list