Bug 498979 - Python subprocess module has a race
Summary: Python subprocess module has a race
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: python
Version: 5.4
Hardware: All
OS: Linux
low
high
Target Milestone: rc
: ---
Assignee: James Antill
QA Contact: BaseOS QE
URL:
Whiteboard:
: 500805 (view as bug list)
Depends On:
Blocks: 498978
TreeView+ depends on / blocked
 
Reported: 2009-05-04 16:31 UTC by Shahar Frank
Modified: 2016-04-26 16:04 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 498978
Environment:
Last Closed: 2009-09-02 12:03:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1402 0 normal SHIPPED_LIVE python bug fix update 2009-09-01 12:08:43 UTC

Description Shahar Frank 2009-05-04 16:31:01 UTC
Sometimes when using subprocess, the fork is racing with the parent's waitpid
and wins. This leads to OS Error exception.

In practice the only problem in this state is that the parent lost the childs
return code.

For example:
  File "/usr/share/vdsm/storage/misc.py", line 61, in execCmd
    (out, err) = p.communicate(data)
  File "/usr/lib64/python2.4/subprocess.py", line 1083, in communicate
    self.wait()
  File "/usr/lib64/python2.4/subprocess.py", line 1007, in wait
    pid, sts = os.waitpid(self.pid, 0)
OSError: [Errno 10] No child processes

Comment 3 Shahar Frank 2009-05-31 08:39:38 UTC
*** Bug 500805 has been marked as a duplicate of this bug. ***

Comment 4 Shahar Frank 2009-06-08 15:59:47 UTC
The info on how to reproduce the problem and a proposed fixed can be found here:
 "Bug 498978 -  Python subprocess module have a race" (OVIRT)

Comment 6 Alan Pevec 2009-06-09 14:41:50 UTC
according to RPM changelog it's all in the latest python RPM:
* Tue May 26 2009 James Antill <james.antill> - 2.4.3-26.el5
- Add workaround for subprocess import with threads
- Resolves: 499095
- Resolves: rhbz#499097
- Resolves: rhbz#498979

http://cvs.devel.redhat.com/cgi-bin/cvsweb.cgi/rpms/python/RHEL-5/python.spec

Comment 17 errata-xmlrpc 2009-09-02 12:03:26 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1402.html


Note You need to log in before you can comment on or make changes to this bug.