View Single Post
  #1 (permalink)  
Old 12-10-2004
bernard's Avatar
bernard bernard is online now
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 834
UUID patch for Ice 2.0.0

On all platforms except Windows, IceUtil::generateUUID() uses /dev/urandom to generate UUIDs.

Unfortunately concurrent reads to /dev/urandom on Linux (at least up to 2.6.9smp) can return the same value. I posted a test-case on the linux-kernel mailing list that you could use to check /dev/urandom on your OS:
http://www.uwsg.indiana.edu/hypermai...11.3/0875.html
http://www.uwsg.indiana.edu/hypermai...12.0/1541.html

This bug will be fixed in the next 2.6 release; however until everybody upgrades to a kernel with the fix (which won't be soon) a work-around in IceUtil::generateUUID() is necessary.

You can apply the attached patch on a 2.0.0 distribution as follows:
$ gunzip patch.gz
$ cd $ICE_HOME
$ patch -p0 <~/patch

It changes the generateUUID() implementation, and improves the UUID test.
On Windows, generateUUID() is using the Windows-provided UUID generator, so you don't need this patch.

Cheers,
Bernard
Attached Files
File Type: gz patch.gz (2.3 KB, 396 views)
Reply With Quote