Bug 1103450 - double close of subprocess pipes when the child process fails starting
Summary: double close of subprocess pipes when the child process fails starting
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Bohuslav "Slavek" Kabrda
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 963267 1044336 1047050 1110147 1129239 1178319 1204320 (view as bug list)
Depends On:
Blocks: fedora19rtt
TreeView+ depends on / blocked
 
Reported: 2014-05-31 20:13 UTC by Attila Fazekas
Modified: 2015-03-23 13:20 UTC (History)
16 users (show)

Fixed In Version: python-2.7.5-12.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-24 01:57:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
test_double_close.py (595 bytes, text/x-python)
2014-05-31 20:13 UTC, Attila Fazekas
no flags Details

Description Attila Fazekas 2014-05-31 20:13:44 UTC
Created attachment 901129 [details]
test_double_close.py

Description of problem:
The subprocess module double closes the file pipefds on error.

The above issue when the subprocess used with eventlet and probably by using regular threads can lead to fatal issue,
when one thread closes another treads file descriptor.

In the attached program, the subprocess closes the epoll fd of the evenentlet.
Eventlet tries to handle the network socket as epollfd, by adding the newly created connection (fd=3) to the closed epfd (fd=3), which causes EINVAL.

Version-Release number of selected component (if applicable):
python-libs-2.7.5-11.fc20.x86_64

How reproducible:
always

Steps to Reproduce:
1. Install eventlet
2. Run the attached program.


Actual results:
[Errno 22] Invalid argument
Bug triggered


Expected results:
$ python test_double_close.py 
OK

Please backport http://hg.python.org/cpython/rev/43749cb6bdbd
or upgrade python 2.7.x to >= 2.7.6


Additional info:
Python 3.3.2 also affected.

Comment 1 Bohuslav "Slavek" Kabrda 2014-06-19 11:38:08 UTC
BTW I've run the test in [1] (upstream test for this feature for Python 3) on current F20 build of python3 and it doesn't fail - also, judging from the comments in the upstream bug, I think this is fixed in 3.3.2.

[1] http://hg.python.org/cpython/rev/c11754defe1c

Comment 2 Fedora Update System 2014-06-19 14:36:06 UTC
python-2.7.5-12.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/python-2.7.5-12.fc20

Comment 3 Fedora Update System 2014-06-19 23:01:07 UTC
Package python-2.7.5-12.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-2.7.5-12.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-7538/python-2.7.5-12.fc20
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2014-06-24 01:57:50 UTC
python-2.7.5-12.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 David Shea 2014-10-09 16:00:46 UTC
*** Bug 1110147 has been marked as a duplicate of this bug. ***

Comment 8 David Shea 2014-10-13 14:11:41 UTC
*** Bug 1044336 has been marked as a duplicate of this bug. ***

Comment 9 David Shea 2014-10-13 14:12:01 UTC
*** Bug 1129239 has been marked as a duplicate of this bug. ***

Comment 10 David Shea 2014-11-07 14:58:51 UTC
*** Bug 963267 has been marked as a duplicate of this bug. ***

Comment 11 David Lehman 2014-12-02 19:49:17 UTC
*** Bug 1047050 has been marked as a duplicate of this bug. ***

Comment 12 David Shea 2015-01-05 15:09:09 UTC
*** Bug 1178319 has been marked as a duplicate of this bug. ***

Comment 13 David Shea 2015-03-23 13:20:17 UTC
*** Bug 1204320 has been marked as a duplicate of this bug. ***


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