This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/24092] on seeds 0 and 1, srandom() initializes the random number generator in the same way


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]