Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Aug 2013 22:16:21 +0400
From:      Andrey Chernov <ache@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-current@freebsd.org, Jason Helfman <jgh@freebsd.org>
Subject:   Re: RAND_MAX issue?
Message-ID:  <521F8FF5.1050904@freebsd.org>
In-Reply-To: <201308291305.09931.jhb@freebsd.org>
References:  <CAMuy=%2BimSaoFBWsP_-SbM9Q4yQe1FBOw5owUhkOSWH_%2BuQJr7A@mail.gmail.com> <201308291305.09931.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 29.08.2013 21:05, John Baldwin wrote:
> On Thursday, August 29, 2013 11:59:53 am Jason Helfman wrote:
>> I am working on trying to resolve a build issue with devel/libvirt, and
>> posted to the libvirt mailing list, and received this feedback. Please read
>> this thread, and if you have any thoughts I would be interested in any
>> resolution.
>>
>> Here is a link to the thread:
>> https://www.redhat.com/archives/libvir-list/2013-August/msg01544.html
>>
>> Thanks!
> 
> It mostly seems to not matter reading the followups.  You would need to
> ask Bruce what he thinks about the assumption of RAND_MAX being 2^n-1
> for some n.
> 

The whole libvirt check looks like Linuxism based on wrong assumption
"combining a small number of pseudorandom bits to make a larger
pseudorandom number produce a uniform distribution". See explaining
comments on POSIX site:
http://austingroupbugs.net/view.php?id=743
BTW, they seems does not support new proposed addition to POSIX.
Moreover, returning old range (as it was before) will bring false safety
stopgap for combining with wrong result.

Two possible fixes: increase libvirt's internal RAND_MAX (quick and
dirty) or rewrite their incorrect combining (preferred).

-- 
http://ache.vniz.net/
bitcoin:1G6ugdNY6e5jx1GVnAU2ntj2NEfmjKG85r



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?521F8FF5.1050904>