<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Python/random.c, branch v3.6.7</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/'/>
<entry>
<title>[3.6] bpo-33021: Release the GIL during fstat() calls (GH-6019) (GH-6160)</title>
<updated>2018-03-20T19:40:18+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2018-03-20T19:40:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=f3e6eadbcf4f3e0fe53f4784485b1c8464c7d282'/>
<id>f3e6eadbcf4f3e0fe53f4784485b1c8464c7d282</id>
<content type='text'>
fstat may block for long time if the file descriptor is on a
non-responsive NFS server, hanging all threads. Most fstat() calls are
handled by _Py_fstat(), releasing the GIL internally, but but
_Py_fstat_noraise() does not release the GIL, and most calls release the
GIL explicitly around it.

This patch fixes last 2 calls to _Py_fstat_no_raise(), avoiding hangs
when calling:
- mmap.mmap()
- os.urandom()
- random.seed()
(cherry picked from commit 4484f9dca9149da135bbae035f10a50d20d1cbbb)

Co-authored-by: Nir Soffer &lt;nirsof@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fstat may block for long time if the file descriptor is on a
non-responsive NFS server, hanging all threads. Most fstat() calls are
handled by _Py_fstat(), releasing the GIL internally, but but
_Py_fstat_noraise() does not release the GIL, and most calls release the
GIL explicitly around it.

This patch fixes last 2 calls to _Py_fstat_no_raise(), avoiding hangs
when calling:
- mmap.mmap()
- os.urandom()
- random.seed()
(cherry picked from commit 4484f9dca9149da135bbae035f10a50d20d1cbbb)

Co-authored-by: Nir Soffer &lt;nirsof@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-32329: Fix sys.flags.hash_randomization (#4875)</title>
<updated>2017-12-15T00:39:48+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>victor.stinner@gmail.com</email>
</author>
<published>2017-12-15T00:39:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=22097aaa77b4f0473552fe840358d77e5b9a253f'/>
<id>22097aaa77b4f0473552fe840358d77e5b9a253f</id>
<content type='text'>
sys.flags.hash_randomization is now properly set to 0 when hash
randomization is turned off by PYTHONHASHSEED=0.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
sys.flags.hash_randomization is now properly set to 0 when hash
randomization is turned off by PYTHONHASHSEED=0.</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #29157: Prefer getrandom() over getentropy()</title>
<updated>2017-01-06T23:07:45+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>victor.stinner@gmail.com</email>
</author>
<published>2017-01-06T23:07:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=ff558f5aba40bd173f336503def886a12f8db016'/>
<id>ff558f5aba40bd173f336503def886a12f8db016</id>
<content type='text'>
* dev_urandom() now calls py_getentropy(). Prepare the fallback to support
  getentropy() failure and falls back on reading from /dev/urandom.
* Simplify dev_urandom(). pyurandom() is now responsible to call getentropy()
  or getrandom(). Enhance also dev_urandom() and pyurandom() documentation.
* getrandom() is now preferred over getentropy(). The glibc 2.24 now implements
  getentropy() on Linux using the getrandom() syscall.  But getentropy()
  doesn't support non-blocking mode. Since getrandom() is tried first, it's not
  more needed to explicitly exclude getentropy() on Solaris. Replace:
  "if defined(HAVE_GETENTROPY) &amp;&amp; !defined(sun)"
  with "if defined(HAVE_GETENTROPY)"
* Enhance py_getrandom() documentation. py_getentropy() now supports ENOSYS,
  EPERM &amp; EINTR
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* dev_urandom() now calls py_getentropy(). Prepare the fallback to support
  getentropy() failure and falls back on reading from /dev/urandom.
* Simplify dev_urandom(). pyurandom() is now responsible to call getentropy()
  or getrandom(). Enhance also dev_urandom() and pyurandom() documentation.
* getrandom() is now preferred over getentropy(). The glibc 2.24 now implements
  getentropy() on Linux using the getrandom() syscall.  But getentropy()
  doesn't support non-blocking mode. Since getrandom() is tried first, it's not
  more needed to explicitly exclude getentropy() on Solaris. Replace:
  "if defined(HAVE_GETENTROPY) &amp;&amp; !defined(sun)"
  with "if defined(HAVE_GETENTROPY)"
* Enhance py_getrandom() documentation. py_getentropy() now supports ENOSYS,
  EPERM &amp; EINTR
</pre>
</div>
</content>
</entry>
<entry>
<title>merge 3.5 (#29057)</title>
<updated>2017-01-02T04:30:26+00:00</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2017-01-02T04:30:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=46322587ecb725c99211c3365a7ba2cbfc574403'/>
<id>46322587ecb725c99211c3365a7ba2cbfc574403</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>only include sys/random.h if it seems like it might have something useful (#29057)</title>
<updated>2017-01-02T04:29:36+00:00</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2017-01-02T04:29:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=493ac1bbe02a57d08e0f8a76b436626f86b03796'/>
<id>493ac1bbe02a57d08e0f8a76b436626f86b03796</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>merge 3.5 (#28932)</title>
<updated>2016-12-20T07:54:57+00:00</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2016-12-20T07:54:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=b0eb986eb236c41ebf098233940e038c7b993b9f'/>
<id>b0eb986eb236c41ebf098233940e038c7b993b9f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>add a specific configure check for sys/random.h (closes #28932)</title>
<updated>2016-12-20T07:54:25+00:00</updated>
<author>
<name>Benjamin Peterson</name>
<email>benjamin@python.org</email>
</author>
<published>2016-12-20T07:54:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=fb2ae15c6704a072afeef4786749d9bb2ce7d68d'/>
<id>fb2ae15c6704a072afeef4786749d9bb2ce7d68d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #28676: merge from 3.5</title>
<updated>2016-11-12T21:38:03+00:00</updated>
<author>
<name>Ned Deily</name>
<email>nad@python.org</email>
</author>
<published>2016-11-12T21:38:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=7d895d3c37e2ff5189d2d8b71def4e2fee34f10b'/>
<id>7d895d3c37e2ff5189d2d8b71def4e2fee34f10b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #28676: Prevent missing 'getentropy' declaration warning on macOS.</title>
<updated>2016-11-12T21:35:48+00:00</updated>
<author>
<name>Ned Deily</name>
<email>nad@python.org</email>
</author>
<published>2016-11-12T21:35:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=7ae411264933bfc845c3647cde478508c7981ad3'/>
<id>7ae411264933bfc845c3647cde478508c7981ad3</id>
<content type='text'>
Patch by Gareth Rees.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Patch by Gareth Rees.
</pre>
</div>
</content>
</entry>
<entry>
<title>(Merge 3.5) Catch EPERM error in py_getrandom()</title>
<updated>2016-09-20T20:49:52+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>victor.stinner@gmail.com</email>
</author>
<published>2016-09-20T20:49:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=75024c6589539f72af69ce61cd6493b193989c2d'/>
<id>75024c6589539f72af69ce61cd6493b193989c2d</id>
<content type='text'>
Issue #27955: Fallback on reading /dev/urandom device when the getrandom()
syscall fails with EPERM, for example when blocked by SECCOMP.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Issue #27955: Fallback on reading /dev/urandom device when the getrandom()
syscall fails with EPERM, for example when blocked by SECCOMP.
</pre>
</div>
</content>
</entry>
</feed>
