This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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.
History
Date User Action Args
2015-10-20 07:47:25vstinnersetrecipients: + vstinner, rhettinger, matejcik, socketpair
2015-10-20 07:47:25vstinnerlinkissue25420 messages
2015-10-20 07:47:24vstinnercreate