Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Feb 2015 04:13:14 +0000
From:      bugzilla-noreply@freebsd.org
To:        python@FreeBSD.org
Subject:   [Bug 197376] lang/python27: random module leaks file descriptor into child process
Message-ID:  <bug-197376-21822-1ZSkrxGIUG@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-197376-21822@https.bugs.freebsd.org/bugzilla/>
References:  <bug-197376-21822@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197376

--- Comment #3 from Ed Maste <emaste@freebsd.org> ---
It is fixed in python 3.4.2 - see test result below. Looks like the fix[1] is
not in 2.x though. The fix is PEP 446 - issue 18571[2]

[1]
https://github.com/python/cpython/commit/621f57c094e7572bb4aa2734fe7264856921fc27
[2] http://bugs.python.org/issue18571

LLDB people do not see this issue on Linux; I do not yet know if they're using
Python 3 or if there's some other difference.

Also os.urandom() is sufficient to demonstrate the problem:

Python 2.7.9 (default, Jan  8 2015, 21:47:19) 
[GCC 4.2.1 Compatible FreeBSD Clang 3.3 (tags/RELEASE_33/final 183502)] on
freebsd10
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.urandom(1)
'8'
>>> os.system("./a.out")
File descriptor 3 is open.
512
>>> 
feynman% python3
Python 3.4.2 (default, Jan 28 2015, 05:38:04) 
[GCC 4.2.1 Compatible FreeBSD Clang 3.3 (tags/RELEASE_33/final 183502)] on
freebsd10
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.urandom(1)
b'\x00'
>>> os.system("./a.out")
0

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-197376-21822-1ZSkrxGIUG>