Message253212
| Author |
vstinner |
| Recipients |
matejcik, rhettinger, socketpair, vstinner |
| Date |
2015年10月20日.07:47:24 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<CAMpsgwbEzZupakZjqGU2vZ5_nx9awNrHeVLWQEfL2BGYOrFa1Q@mail.gmail.com> |
| In-reply-to |
<1445321792.33.0.31258617461.issue25420@psf.upfronthosting.co.za> |
| Content |
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. |
|