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 <rep...@bugs.python.org>
<http://bugs.python.org/issue31255>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to