[fpc-devel] I get duplicate GUIDs under Linux

Vincent Snijders vsnijders at quicknet.nl
Thu May 29 15:10:30 CEST 2008


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?

Vincent



More information about the fpc-devel mailing list