-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Noland wrote:
> I guess that I am still trying to understand the original bug... The
> demo program that was included in the bug report seems to work fine
> here, unless I don't know what the output *should* look like.  It seems
> to work both before and after this change on FreeBSD.  FWIW, we use mesa
> glut, not freeglut.
> 
> balrog% ./opengl-demo
> These numbers are random
> 1219944491
> 1580682328
> 7689659
> 391079993
> 1581482531
> 571799598
> 246523261
> 820492564
> 1026025761
> 121279717
> IRQ's not enabled, falling back to busy waits: 2 0
> 
> These numbers are not
> 386222616
> 1547925878
> 1373331788
> 433122960
> 1675509037
> 327321748
> 1590998669
> 1595741086
> 1844648666
> 1936201370

I believe that running the test multiple times will generate the same
output after "These numbers are not".  That's the bug.  The code calls
HASH_RANDOM_INIT with a constant value.  If HASH_RANDOM_INIT modifies
the global random number generator state (e.g., by calling srandom),
applications will get a predictable random number sequence after calling
into GLX... whether they want it or not.

The available choices for fixing the bug seemed to be:

 1. Use our own random number generator that doesn't modify the global
state.

 2. Just don't call srandom, but use random anyway.  This also modifies
the global state and could break other applications.  This seems
unlikely, but it is possible.

 3. Use a system random number generator that doesn't modify the global
state.

I picked option 3.  Option 2 was my second choice.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkq5SnoACgkQX1gOwKyEAw/H6ACeNo9DP7wTYMLecSA+z0FAUPRr
oewAnRiR4KTaq+izFYGNreYzaY6Et1Ox
=ueET
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to