[New-bugs-announce] [issue31255] Test getrandom before using it

李明宇 report at bugs.python.org
Tue Aug 22 03:40:09 EDT 2017

New submission from 李明宇:

If a GNU/Linux system has glibc-2.25 and <linux-3.17, getrandom and getentropy will be declared in system headers, without a syscall implementation in the kernel.

For the build system of python, getentropy gets passed in configure, but fails at runtime, such as:

> Fatal Python error: getentropy() failed

strace gives

> syscall_318(0x7f369b1535d0, 0x18, 0, 0x13e, 0x7f369b1535d0, 0x7f369b1535e8) = -1 (errno 38)

The glibc developers regard testing the usability of a syscall to be a task of python build system.  Besides AC_TEST_FUNCS(... getentropy ...) which only test whether getentropy is defined in the system, runtime checks in configure is needed.

messages: 300672
nosy: 李明宇
priority: normal
severity: normal
status: open
title: Test getrandom before using it
type: compile error
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list