From owner-freebsd-current Fri Mar 29 11:32:49 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id LAA14471 for current-outgoing; Fri, 29 Mar 1996 11:32:49 -0800 (PST) Received: from Root.COM (implode.Root.COM [198.145.90.17]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id LAA14466 for ; Fri, 29 Mar 1996 11:32:46 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by Root.COM (8.7.5/8.6.5) with SMTP id LAA02763; Fri, 29 Mar 1996 11:32:15 -0800 (PST) Message-Id: <199603291932.LAA02763@Root.COM> X-Authentication-Warning: implode.Root.COM: Host localhost [127.0.0.1] didn't use HELO protocol To: ache@astral.msk.su (aka Andrey A. Chernov, Black Mage) cc: imb@scgt.oz.au (michael butler), current@freebsd.org Subject: Re: random .. not so .. In-reply-to: Your message of "Fri, 29 Mar 1996 16:46:22 +0300." <199603291346.QAA00701@astral.msk.su> From: David Greenman Reply-To: davidg@Root.COM Date: Fri, 29 Mar 1996 11:32:15 -0800 Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >> > BSD: state[i] = 1103515245 * state[i - 1] + 12345; >> > Linux: state[i] = 1103515145 * state[i - 1] + 12345; >> > ^ >> That line is utterly WRONG in BOTH implementations. The state it creates >> is so incredibly UNRANDOM, that seeding is almost pointless. The following >> program outputs a PBM image showing a bit in the result of successive calls >> to random(), for consecutive values of srandom(). >> >> The results are TERRIBLE (for example, the 151st value returned by random() >> is 0 for seed 0..14, then 1 for seed 15..30, then 0 for seed 31..46, etc.) > >Yes, the bug really hits, here is some of FreeBSD-current results, >very visible patterns exists. They created by proposed program: >a | split -l 100; paste x[a-b]* | tr -d "\t" > >I plan to aply proposed fix, if nobody against. The proposed fix was a patch to the GPL'd libc...that means that it is covered by the GPL. I don't think you can use the patch directly without contaminating our non-GPL'd sources. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project