Hi Jeremy,

On Wed, Mar 21, 2012 at 12:37:47PM -0500, Jeremy C. Reed wrote:
| My co-worker was troubleshooting why some of our unittests (that work on 
| multiple operating systems and architectures) failed on OpenBSD and saw 
| that if you call srandom(0) to initialize the RNG, random() will always 
| return 0.  (I was able to reproduce this.)
| 
| If this is expected behaviour, please point to explanation.
| 
| He posted his tests and discussed the code related to this at:
| 
| https://banu.com/blog/42/openbsd-bug-in-the-random-function/

As already mentioned by others on this list, this was fixed in the
tree very recently, thanks to you and your co-worker for pointing it
out.

I'm curious though - how does a continuous stream of zeroes break your
unittests ?  I agree that it's pretty debianesque randomness (random()
is bad, but not *THAT* bad ;), but keep in mind that any RNG could in
theory produce an arbitrarily long sequence of zeroes too.

Can you provide some insight ?

Cheers,

Paul 'WEiRD' de Weerd

-- 
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
                 http://www.weirdnet.nl/                 

Reply via email to