Message253212
Hi,
Марк Коренберг added the comment:
> Man getrandom()
>
> As of Linux 3.19, the following bug exists:
>
> * Depending on CPU load, getrandom() does not react to interrupts
> before reading all bytes requested.
>
> So, is it goot to use this syscall now?
I saw a fix proposed on the LKML but it looks like it was not merged.
I don't know what to think about this bug.
getrandom(n, GRND_NONBLOCK) behaviour depends if /dev/urandom was
feeded with enough entropy and the value of n. It should not be
interrupted by signal for n <= 256.
Can you reproduce the bug? Which kind of applications can hang because
of this bug?
I would prefer to continue to use getrandom() syscall on Linux, avoid
using a file descriptor is really useful.
Maybe we can try to document the behaviour of os.urandom() for signal
handling? Or at least redirect users to getrandom() manual page. |
|
Date |
User |
Action |
Args |
2015-10-20 07:47:25 | vstinner | set | recipients:
+ vstinner, rhettinger, matejcik, socketpair |
2015-10-20 07:47:25 | vstinner | link | issue25420 messages |
2015-10-20 07:47:24 | vstinner | create | |
|