Bug 498979 - Python subprocess module has a race
Python subprocess module has a race
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: python (Show other bugs)
5.4
All Linux
low Severity high
: rc
: ---
Assigned To: James Antill
BaseOS QE
:
: 500805 (view as bug list)
Depends On:
Blocks: 498978
  Show dependency treegraph
 
Reported: 2009-05-04 12:31 EDT by Shahar Frank
Modified: 2016-04-26 12:04 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 498978
Environment:
Last Closed: 2009-09-02 08:03:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1402 normal SHIPPED_LIVE python bug fix update 2009-09-01 08:08:43 EDT

  None (edit)
Description Shahar Frank 2009-05-04 12:31:01 EDT
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 04:39:38 EDT
*** Bug 500805 has been marked as a duplicate of this bug. ***
Comment 4 Shahar Frank 2009-06-08 11:59:47 EDT
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 10:41:50 EDT
according to RPM changelog it's all in the latest python RPM:
* Tue May 26 2009 James Antill <james.antill@redhat.com> - 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 08:03:26 EDT
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.