This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/24092] on seeds 0 and 1, srandom() initializes the random number generator in the same way
- From: "yann at droneaud dot fr" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 18 Jun 2019 07:59:11 +0000
- Subject: [Bug libc/24092] on seeds 0 and 1, srandom() initializes the random number generator in the same way
- Auto-submitted: auto-generated
- References: <bug-24092-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=24092
Yann Droneaud <yann at droneaud dot fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |yann at droneaud dot fr
--- Comment #16 from Yann Droneaud <yann at droneaud dot fr> ---
It's possible some existing programs rely on srandom(0) being the same as
srandom(1): such programs would expect random() outputs to be the one reporter
is getting.
So modifying the random() behavior for srandom(0) could break existing
programs.
Other libraries/environment made such changes and were required to provide
backward compatibility:
Glib: G_RANDOM_VERSION=1
https://developer.gnome.org/glib/stable/glib-running.html
Python: PYTHONHASHSEED=0 or random.seed(,version=1)
https://docs.python.org/2.7/library/random.html#random.seed
https://docs.python.org/3.7/library/random.html#random.seed
https://docs.python.org/2.7/using/cmdline.html#envvar-PYTHONHASHSEED
https://docs.python.org/3.7/using/cmdline.html#envvar-PYTHONHASHSEED
Sad.
--
You are receiving this mail because:
You are on the CC list for the bug.