1. 01 Agu, 2018 1 kayıt (commit)
  2. 11 Mar, 2018 1 kayıt (commit)
    • Nir Soffer's avatar
      bpo-33021: Release the GIL during fstat() calls (GH-6019) · 4484f9dc
      Nir Soffer yazdı
      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()
      4484f9dc
  3. 14 Ara, 2017 1 kayıt (commit)
    • Victor Stinner's avatar
      bpo-32329: Fix -R option for hash randomization (#4873) · 358e5e17
      Victor Stinner yazdı
      bpo-32329, bpo-32030:
      
      * The -R option now turns on hash randomization when the
        PYTHONHASHSEED environment variable is set to 0 Previously, the
        option was ignored.
      * sys.flags.hash_randomization is now properly set to 0 when hash
        randomization is turned off by PYTHONHASHSEED=0.
      * _PyCoreConfig_ReadEnv() now reads the PYTHONHASHSEED environment
        variable. _Py_HashRandomization_Init() now only apply the
        configuration, it doesn't read PYTHONHASHSEED anymore.
      358e5e17
  4. 12 Ara, 2017 1 kayıt (commit)
  5. 16 Kas, 2017 1 kayıt (commit)
    • Victor Stinner's avatar
      bpo-32030: Enhance Py_Main() (#4412) · a7368ac6
      Victor Stinner yazdı
      Parse more env vars in Py_Main():
      
      * Add more options to _PyCoreConfig:
      
        * faulthandler
        * tracemalloc
        * importtime
      
      * Move code to parse environment variables from _Py_InitializeCore()
        to Py_Main(). This change fixes a regression from Python 3.6:
        PYTHONUNBUFFERED is now read before calling pymain_init_stdio().
      * _PyFaulthandler_Init() and _PyTraceMalloc_Init() now take an
        argument to decide if the module has to be enabled at startup.
      * tracemalloc_start() is now responsible to check the maximum number
        of frames.
      
      Other changes:
      
      * Cleanup Py_Main():
      
        * Rename some pymain_xxx() subfunctions
        * Add pymain_run_python() subfunction
      
      * Cleanup Py_NewInterpreter()
      * _PyInterpreterState_Enable() now reports failure
      * init_hash_secret() now considers pyurandom() failure as an "user
        error": don't fail with abort().
      * pymain_optlist_append() and pymain_strdup() now sets err on memory
        allocation failure.
      a7368ac6
  6. 15 Kas, 2017 1 kayıt (commit)
    • Victor Stinner's avatar
      bpo-32030: Split Py_Main() into subfunctions (#4399) · f7e5b56c
      Victor Stinner yazdı
      * Don't use "Python runtime" anymore to parse command line options or
        to get environment variables: pymain_init() is now a strict
        separation.
      * Use an error message rather than "crashing" directly with
        Py_FatalError(). Limit the number of calls to Py_FatalError(). It
        prepares the code to handle errors more nicely later.
      * Warnings options (-W, PYTHONWARNINGS) and "XOptions" (-X) are now
        only added to the sys module once Python core is properly
        initialized.
      * _PyMain is now the well identified owner of some important strings
        like: warnings options, XOptions, and the "program name". The
        program name string is now properly freed at exit.
        pymain_free() is now responsible to free the "command" string.
      * Rename most methods in Modules/main.c to use a "pymain_" prefix to
        avoid conflits and ease debug.
      * Replace _Py_CommandLineDetails_INIT with memset(0)
      * Reorder a lot of code to fix the initialization ordering. For
        example, initializing standard streams now comes before parsing
        PYTHONWARNINGS.
      * Py_Main() now handles errors when adding warnings options and
        XOptions.
      * Add _PyMem_GetDefaultRawAllocator() private function.
      * Cleanup _PyMem_Initialize(): remove useless global constants: move
        them into _PyMem_Initialize().
      * Call _PyRuntime_Initialize() as soon as possible:
        _PyRuntime_Initialize() now returns an error message on failure.
      * Add _PyInitError structure and following macros:
      
        * _Py_INIT_OK()
        * _Py_INIT_ERR(msg)
        * _Py_INIT_USER_ERR(msg): "user" error, don't abort() in that case
        * _Py_INIT_FAILED(err)
      f7e5b56c
  7. 24 May, 2017 1 kayıt (commit)
  8. 23 May, 2017 1 kayıt (commit)
    • Eric Snow's avatar
      bpo-22257: Small changes for PEP 432. (#1728) · 6b4be195
      Eric Snow yazdı
      PEP 432 specifies a number of large changes to interpreter startup code, including exposing a cleaner C-API. The major changes depend on a number of smaller changes. This patch includes all those smaller changes.
      6b4be195
  9. 09 Ock, 2017 1 kayıt (commit)
    • Victor Stinner's avatar
      Issue #29157: Prefer getrandom() over getentropy() · 035ba5da
      Victor Stinner yazdı
      Copy and then adapt Python/random.c from default branch. Difference between 3.5
      and default branches:
      
      * Python 3.5 only uses getrandom() in non-blocking mode: flags=GRND_NONBLOCK
      * If getrandom() fails with EAGAIN: py_getrandom() immediately fails and
        remembers that getrandom() doesn't work.
      * Python 3.5 has no _PyOS_URandomNonblock() function: _PyOS_URandom()
        works in non-blocking mode on Python 3.5
      035ba5da
  10. 06 Ock, 2017 6 kayıt (commit)
    • Victor Stinner's avatar
      Issue #29157: Prefer getrandom() over getentropy() · ff558f5a
      Victor Stinner yazdı
      * 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) && !defined(sun)"
        with "if defined(HAVE_GETENTROPY)"
      * Enhance py_getrandom() documentation. py_getentropy() now supports ENOSYS,
        EPERM & EINTR
      ff558f5a
    • Victor Stinner's avatar
      b27df6fa
    • Victor Stinner's avatar
      py_getentropy() now supports ENOSYS, EPERM & EINTR · de2f1ea1
      Victor Stinner yazdı
      Issue #29157.
      de2f1ea1
    • Victor Stinner's avatar
      Issue #29157: getrandom() is now preferred over getentropy() · 2f796439
      Victor Stinner yazdı
      The glibc 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) && !defined(sun)
      
      with
      
          if defined(HAVE_GETENTROPY)
      2f796439
    • Victor Stinner's avatar
      Issue #29157: Simplify dev_urandom() · a49a2078
      Victor Stinner yazdı
      pyurandom() is now responsible to call getentropy() or getrandom().
      
      Enhance also dev_urandom() and pyurandom() documentation.
      a49a2078
    • Victor Stinner's avatar
      Issue #29157: dev_urandom() now calls py_getentropy() · dcdb60e4
      Victor Stinner yazdı
      Prepare the fallback to support getentropy() failure and falls back on reading
      from /dev/urandom.
      dcdb60e4
  11. 02 Ock, 2017 1 kayıt (commit)
  12. 20 Ara, 2016 1 kayıt (commit)
  13. 12 Kas, 2016 1 kayıt (commit)
  14. 20 Eyl, 2016 2 kayıt (commit)
    • Victor Stinner's avatar
      Catch EPERM error in py_getrandom() · 6d8bc46c
      Victor Stinner yazdı
      Issue #27955: Fallback on reading /dev/urandom device when the getrandom()
      syscall fails with EPERM, for example when blocked by SECCOMP.
      6d8bc46c
    • Victor Stinner's avatar
      Cleanup random.c · af597321
      Victor Stinner yazdı
      Issue #27955: modify py_getrnadom() and dev_urandom()
      
      * Add comments from Python 3.7
      * PEP 7 style: add {...}
      af597321
  15. 06 Eyl, 2016 1 kayıt (commit)
    • Victor Stinner's avatar
      os.urandom() now blocks on Linux · e66987e6
      Victor Stinner yazdı
      Issue #27776: The os.urandom() function does now block on Linux 3.17 and newer
      until the system urandom entropy pool is initialized to increase the security.
      
      This change is part of the PEP 524.
      e66987e6
  16. 16 Agu, 2016 4 kayıt (commit)
  17. 29 Tem, 2016 1 kayıt (commit)
  18. 16 Haz, 2016 1 kayıt (commit)
  19. 14 Haz, 2016 2 kayıt (commit)
  20. 10 Haz, 2016 1 kayıt (commit)
  21. 08 Haz, 2016 1 kayıt (commit)
  22. 07 Haz, 2016 1 kayıt (commit)
    • Victor Stinner's avatar
      os.urandom() doesn't block on Linux anymore · dddf4849
      Victor Stinner yazdı
      Issue #26839: On Linux, os.urandom() now calls getrandom() with GRND_NONBLOCK
      to fall back on reading /dev/urandom if the urandom entropy pool is not
      initialized yet. Patch written by Colm Buckley.
      dddf4849
  23. 12 Nis, 2016 1 kayıt (commit)
    • Victor Stinner's avatar
      Fix os.urandom() on Solaris 11.3 · 9d24271d
      Victor Stinner yazdı
      Issue #26735: Fix os.urandom() on Solaris 11.3 and newer when reading more than
      1,024 bytes: call getrandom() multiple times with a limit of 1024 bytes per
      call.
      9d24271d
  24. 07 Kas, 2015 1 kayıt (commit)
  25. 01 Eki, 2015 2 kayıt (commit)
  26. 30 Eyl, 2015 1 kayıt (commit)
  27. 18 Eyl, 2015 1 kayıt (commit)
  28. 30 Tem, 2015 1 kayıt (commit)
    • Victor Stinner's avatar
      py_getrandom(): getrandom() *can* return EINTR · 61d5aab9
      Victor Stinner yazdı
      See the latest version of getrandom() manual page:
      http://man7.org/linux/man-pages/man2/getrandom.2.html#NOTES
      
          The behavior when a call to getrandom() that is blocked while reading from
          /dev/urandom is interrupted by a signal handler depends on the
          initialization state of the entropy buffer and on the request size, buflen.
          If the entropy is not yet initialized, then the call will fail with the
          EINTR error.  If the entropy pool has been initialized and the request size
          is large (buflen > 256), the call either succeeds, returning a partially
          filled buffer, or fails with the error EINTR.  If the entropy pool has been
          initialized and the request size is small (buflen <= 256), then getrandom()
          will not fail with EINTR.  Instead, it will return all of the bytes that
          have been requested.
      
      Note: py_getrandom() calls getrandom() with flags=0.
      61d5aab9
  29. 30 Mar, 2015 1 kayıt (commit)