[New-bugs-announce] [issue32580] Fallback to dev_urandom doesn't work when py_getrandom returns -1

Jernej Simončič report at bugs.python.org
Wed Jan 17 08:11:08 EST 2018

New submission from Jernej Simončič <jernej+s-python at eternallybored.org>:

I'm playing with Gentoo in LXC running on ARM-based QNAP NAS, and when trying to compile Python 3.5.4, the build failed with "Fatal Python error: failed to get random numbers to initialize Python" (full details at https://forums.gentoo.org/viewtopic-p-8172124.html ).

glibc in the environment is 2.25 (supports getrandom), while kernel is 3.10 (doesn't support getrandom).

Looking at random.c, pyurandom returns -1 instead of falling back to dev_urandom when py_getrandom returns -1, so the attached fix is simple.

components: Build
files: random_fallback.patch
keywords: patch
messages: 310158
nosy: jernejs
priority: normal
severity: normal
status: open
title: Fallback to dev_urandom doesn't work when py_getrandom returns -1
versions: Python 3.5, Python 3.6
Added file: https://bugs.python.org/file47389/random_fallback.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list