[fpc-devel] I get duplicate GUIDs under Linux

Michael Van Canneyt michael at freepascal.org
Thu May 29 15:20:04 CEST 2008



On Thu, 29 May 2008, Vincent Snijders wrote:

> Michael Van Canneyt schreef:
> > 
> > On Thu, 29 May 2008, Graeme Geldenhuys wrote:
> > 
> > > 2008/5/29 Michael Van Canneyt <michael at freepascal.org>:
> > > > can you send me your test program, so I can test my fixes ?
> > >
> > > Here you go. It is pretty much what I sent before, except now I made
> > > it a console application instead of a fpGUI one. Below it tries to
> > > create 50,000 GUID's. My SQL version tries 5mil.
> > 
> > Well, after my patch, it creates 500.000 as well, no errors. I had to modify
> > your algoritm a bit to make it more efficient,
> > and I'm too lazy to wait for 5 million. 
> > So I guess the bug is fixed. It's merged to the fixbranch.
> > 
> 
> The bug was probably there, because GetRandomBytes (which was called if the
> kernel function didn't work) return duplicates if it is called within the same
> tick count. Can you fix that too, as suggested by Mattias?

I patched it so Randomize is called only once.
Merged to fixes.

Michael.



More information about the fpc-devel mailing list